Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Win10's ANSI doesn't like 2>NUL

May
12,845
164
1545620957855.png
 
This persists in build 30. In a half-hour or so I'll find out if the latest insider preview of Windows 10 helps.
 
System applet:
1546706516945.png


Registry
1546706604715.png


1546706650667.png


1546706822692.png


Odd ... with ESET if I change those unprintables to ^e I get:

1546706926497.png
 
TCC is not involved. The API to turn ANSI on & off is SetConsoleMode with the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag. After doing the redirection, Windows is turning off that flag. TCC notices this when it executes the next command, and turns it back on.

You need to contact Microsoft about why they're doing that.
 
TCC is not involved. The API to turn ANSI on & off is SetConsoleMode with the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag. After doing the redirection, Windows is turning off that flag. TCC notices this when it executes the next command, and turns it back on.

You need to contact Microsoft about why they're doing that.
CMD doesn't exhibit this problem. Are you going to work around it?
 
CMD uses different APIs for redirection. I could emulate the CMD behavior, but it would result in losing 99% of the TCC line editing features.
Earlier you said "TCC notices this when it executes the next command, and turns it back on". I don't know how it works but ... can't TCC notice it earlier, say, before issuing the next prompt (without ill effect)?
 
If it's at all costly, never mind. I probably redirect stderr perhaps once in tens of thousand commands. And that would be almost 100% in BTMs where it would have to be the last line to cause a problem. FWIW, "alias post_exec noop" gets rid of it but I canned that idea for the reason just mentioned.
 
I can't move it earlier because that would cause it to fail in batch files. I can add it earlier *as well* as the later check, but there'll be a performance hit. And Windows will still be turning off ANSI *during* the command. And there's no guarantee that Windows won't be doing the same thing elsewhere.

So - I can add a hack to hide it in some cases. But only Microsoft can actually fix it.
 

Similar threads

Back
Top