Skip to content

Commit

Permalink
Fix #147 (ANSI parser bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
cronvel committed Feb 17, 2021
1 parent 7efe12d commit 188a875
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ results
build
.grunt
__issue.js
__issues
package-lock.json

node_modules
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

v1.47.1
-------

Fix #147 (ANSI parser bug)


v1.47.0
-------

Expand Down
4 changes: 2 additions & 2 deletions lib/TextBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ TextBuffer.prototype.lineToCells = function( line , parser , baseAttr , offset =
Object.assign( attrObject , part.markup ) ;

// Remove incompatible flags
if ( attrObject.defaultColor && attrObject.color ) { delete attrObject.defaultColor ; }
if ( attrObject.bgDefaultColor && attrObject.bgColor ) { delete attrObject.bgDefaultColor ; }
if ( attrObject.defaultColor && attrObject.color !== undefined ) { delete attrObject.defaultColor ; }
if ( attrObject.bgDefaultColor && attrObject.bgColor !== undefined ) { delete attrObject.bgDefaultColor ; }

attr = this.object2attr( attrObject ) ;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ const ANSI_CODES = {


// /!\ Should be moved to string-kit once finished /!\
const parseAnsiRegexp = /\x1b\[([0-9;]+)m|(.[^\x1b]+)/g ;
const parseAnsiRegexp = /\x1b\[([0-9;]+)m|(.[^\x1b]*)/g ;

misc.parseAnsi = str => {
var match , ansiCodes , raw , output = [] ;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "terminal-kit",
"version": "1.47.0",
"version": "1.47.1",
"description": "256 colors, keys and mouse, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, and many more... Whether you just need colors and styles, build a simple interactive command line tool or a complexe terminal app: this is the absolute terminal lib for Node.js!",
"main": "lib/termkit.js",
"directories": {
Expand Down

0 comments on commit 188a875

Please sign in to comment.