diff --git a/core/ansi_escape_parser.js b/core/ansi_escape_parser.js index 7f60c438..8cc4dbb6 100644 --- a/core/ansi_escape_parser.js +++ b/core/ansi_escape_parser.js @@ -12,6 +12,7 @@ const _ = require('lodash'); exports.ANSIEscapeParser = ANSIEscapeParser; +const BS = 0x08; const TAB = 0x09; const CR = 0x0d; const LF = 0x0a; @@ -99,6 +100,14 @@ function ANSIEscapeParser(options) { charCode = text.charCodeAt(pos) & 0xff; // 8bit clean switch (charCode) { + case BS: + self.emit('literal', text.slice(start, pos + 1)); + start = pos + 1; + + self.column = Math.max(1, self.column - 1); + + self.positionUpdated(); + break; case TAB: self.emit('literal', text.slice(start, pos + 1)); start = pos + 1;