Win10's ANSI doesn't like 2>NUL

May 20, 2008
11,400
99
Syracuse, NY, USA
1545620957855.png
 
May 20, 2008
11,400
99
Syracuse, NY, USA
This persists in build 30. In a half-hour or so I'll find out if the latest insider preview of Windows 10 helps.
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
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.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
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?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
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)?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
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.
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
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
Thread starter Title Forum Replies Date
KarstenG PSUBST issues with Win10 2004 ? Support 4
vefatica Win10 woes. Support 4
vefatica TCMD output invisible on Win10 Support 22
vefatica Win10, alternative screen buffer, cursor doesn't blink Support 11
V Ctrl-Home/End don't work in Win10 Support 3
samintz How to? Drag & Drop in Win10 Support 2
jaltman tcmd 21.0.19 win10 16179 console window loses content Support 2
T @execstr[] on Win10 Support 5
TT's Help! Uninstalling TCC did not restore cmd.exe as Win10 default batch file processor. Support 4
P Color directories in Win10 build 10586 console Support 11
vefatica ANSI, PROMPT ... ??? Support 1
vefatica ANSI??? Support 9
samintz ANSI issues Support 3
FreezerBurnt ANSI Prompt messes up list output. Support 39
samintz ANSI Colors Support 33
nickles ANSI Colors Windows 7 no longer working Support 6
samintz WAD ANSI issue Support 3
AndrewJ TakeCommand v23 + ANSI color sequences leads to black on black text Support 6
K ANSI Not Working Support 8
vefatica ANSI, ANSIWin10 ... ? Support 2
vefatica How do I see Windows 10's ANSI in action? Support 3
M Please explain TCMD's ANSI x3.64 support Support 4
M ANSI is used to show files instead of OEM in version 17 to 19 ! Support 5
vefatica ANSI Support 11
vefatica WAD ANSI still misbehaves with build 35 Support 36
vefatica ANSI misbehavior????? Support 4
Peter Murschall UNICODE mixed with ANSI Code Support 11
J Piping ANSI control sequences through 'type' Support 4
gschizas Take Command (Environment) doesn't show v2 ANSI colors Support 30
B How to? Convert Unicode to ANSI Support 1
D Can ANSI escape sequences be used in keystroke aliases? Support 8
vefatica WAD ANSI <ESC>[K Support 5
M Ansi.sys and old Dos programs Support 7
R ansi.sys ?? Support 15
E Shorter prompt / ANSI codes support Support 10
vefatica Setting array variable ignores leading spaces (and @execarray doesn't) Support 4
MickeyF Why doesn't my python program get executed without specifying its path? Support 2
gworley Virtual network drive filename completion doesn’t get directories Support 0
M Trying to use ffind with a @file.lst doesn't work Support 4
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
vefatica Fixed JOBS /K doesn't work Support 2
E Fixed SHRALIAS doesn't work / SHRALIAS.EXE is missing in v20.11.35 Support 2
D WAD Reboot doesn't shutdown or restart Support 13
M Documentation Q.Search doesn't support selection? Support 1
R Fixed 7ZIP Compression Method Option Doesn't Work Support 1
T Regex engine doesn't recognize native DOS line endings Support 2
E Fixed DEDUPE doesn't handle filenames with whitespace properly when symlinking Support 1
D Docking doesn't persist Support 5
E WAD DESCRIBE under TCC 19 doesn't work with diacritics Support 14
C VIEW PRINT /Wrap doesn't work Support 0

Similar threads