Closed mertzt89 closed 8 years ago
I didn't see #49 which may be addressing this
Do you use pty.js
and/or execute in shell
for your command ?
Also: Does Windows even support ANSI Codes ? Sorry, but I have most of my windows knowledge from Wikipedia
I use both pty.js and "execute in shell" with command "apm show build-tools"
Console output with set to "Ignore ANSI Color Codes":
wintest of C:\Users\mertz\github\build-tools
[?25l
[0m[0K
[1G[?25h[?25l
[0;36mbuild-tools[0m[0K
├── [0;33m4.3.2[0m[0K
├── https://github.com/deprint/build-tools-cpp[0K
├── Build your projects in atom[0K
├── 14747 downloads[0K
└── 16 stars[0K
[0K
Run `apm install build-tools` to install this package.[0K
[0K
[0K
[1G[?25h
With set to "Remove ANSI Color Codes": In lib/pipeline/output-stream.coffee i added some prints
data = data.substr(0, m.index)
return data
in: (data) ->
console.log 'before: ', data
data = @removeAnsi data if @stream.highlighting isnt 'nh' or @stream.ansi_option is 'remove'
console.log 'after: ', data
return if data is ''
@buffer += data
Result on output console: Blank
Output on debug console:
before: [?25l
[0m[0K
[1G[?25h
after:
before: [?25l
[0;36mbuild-tools[0m[0K
├── [0;33m4.3.2[0m[0K
├── https://github.com/deprint/build-tools-cpp[0K
├── Build your projects in atom[0K
├── 14747 downloads[0K
└── 16 stars[0K
[0K
Run `apm install build-tools` to install this package.[0K
[0K
[0K
[1G[?25h
after:
I could probably spend more time to help you debug/fix this and continue to do windows testing. I more or less wanted to make sure that you intend for it to be functional at this stage.
Actually I think I already found the problem (and it's not windows-specific, so I can fix it):
The ANSI Specification is quite large (at least for a simple console like mine). The package only implements the most common color codes, which are more than sufficient for building projects, and ignores all other codes.
... at least, that's what it should do.
Right now, it does not detect when a non-color code ends, so it assumes that the entire output is one large escape code and removeAnsi
then does what it is supposed to do and removes it.
I should be able to fix it in the next couple of days :bow:
Fixed in v4.3.3
.
Remove ANSI
removes all ANSI Codes.
Parse ANSI
only removes and highlights color codes, which means that, in your example, \x1b[0K
and others will remain visible.
When using "Remove ANSI Color Codes" or "Parse ANSI Color Codes" options it causes the console output to be blank instead of just removing/parsing the ANSI formatting.
OS: Windows 7 atom: 1.3.2 build-tools: 4.3.2