Closed smallscript closed 2 years ago
The output detection works differently than you might think. For instance, one can't actually set the output color of a line. One can only classify a line as a particular type that is associated with a color. The classification is sometimes ignored when there are conflicting circumstances. The other thing VS does not allow is changing the actual text of the output window. For instance, I've had several requests to suppress lines of output in the debug view. Can't do it because VS does not provide a hook to modify text.
So while a good idea, there would be no way to remove the escacpe sequences from the output. The sections could be colored but the escape codes would remain.
I wonder if simply making another VS (channel) log-panel-window might be an easier more flexible solution then?
Thoughts...?
p.s., I can't remember at the moment what VS actually calls the set of panels that are grouped with build, etc. But I remember they are not too hard to create; it's been quite a while since I was on the Microsoft DevDiv Team working on VS.
Mike Ward mailto:notifications@github.com Saturday, July 14, 2018 8:00 AM
The output detection works differently than you might think. For instance, one can't actually set the output color of a line. One can only classify a line as a particular type that is associated with a color. The classification is sometimes ignored when there are conflicting circumstances. The other thing VS does not allow is changing the actual text of the output window. For instance, I've had several requests to suppress lines of output in the debug view. Can't do it because VS does not provide a hook to modify text.
So while a good idea, there would be no way to remove the escacpe sequences from the output. The sections could be colored but the escape codes would remain.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mike-ward/VSColorOutput/issues/76#issuecomment-405028823, or mute the thread https://github.com/notifications/unsubscribe-auth/AKB-n-NELNx291-myHjY9Ow1F2d1anZNks5uGgefgaJpZM4VPtfj.
This is an old issue but still valid.
In my case webpack produces a lot of colored console text like this:
1>assets by chunk 8.95 MiB (name: main)
1> asset [1m[32mbundle.js[39m[22m 7.91 MiB [1m[32m[emitted][39m[22m (name: main)
1> asset [1m[32mbundle.css[39m[22m 1.03 MiB [1m[32m[emitted][39m[22m (name: main)
1>assets by info 530 KiB [1m[32m[immutable][39m[22m
When I run the command in a terminal (inside Visual Studio) the colors look fine! When running as part of the build, the output window only shows the above uncolored message
@Khaos66 As stated above, there is no hook to modify the output text in the build window. This is limitation that Visual Studio imposes.
When I run the command in a terminal (inside Visual Studio) the colors look fine!
The terminal window has a terminal shell, the build window does not.
Writing an ANSI tty escape filter to remove them is a small amount of code. And not too much more to convert them to make calls to some internal API.
With that said, plugging such a small library into context is the real work.
Do you think it is reasonable/feasible to have it auto-detect ANSI TTY color codes and both hide the ANSI TTY codes and use them to colorize the text.
That would be awesome for simply streaming stderr output and other similarly embedded pre-colorized streams of data.
I'm interested in doing the work, but would like to know if the author thinks it is feasible. See also this tool And related comments Visual Studio Marketplace comments