Replies: 5 comments 4 replies
-
Excellent question! The trick with anything running under Cygwin (and MSYS2 by extension) is that it is not dumping text to stdout. One of its default modes of operation simulates a terminal using the Win32 console APIs by processing stdout for control sequences. And there are absolutely control sequences that change how input is generated. It's not a stretch to imagine that Cygwin is detecting one of those control sequences and translating it into a request for |
Beta Was this translation helpful? Give feedback.
-
OK, thanks! Do I have any choice regarding Cygwin's default MO? I only got Cygwin to get 64-bit versions of my old GnuWin32 tools. To be honest, in normal use, they don't make any difference. And CAT is one I almost never use. |
Beta Was this translation helpful? Give feedback.
-
If I just start d:\cygwin\bin\cat.exe (it'll wait to process stdin), TERM is not in it's Windows environment. If I set TERM in my shell before starting CAT.EXE, it's inherited, but using either of the values you mentioned doesn't alter the behavior in question. [Was that test meaningful?] |
Beta Was this translation helpful? Give feedback.
-
This bug has plagued me for years, but I keep stubbornly using cat.exe instead of the internal type command anyway. The end-result is, tab filename completion no longer works, and the shell has to be terminated and re-opened entirely. It's awful. |
Beta Was this translation helpful? Give feedback.
-
OT: What is ENABLE_AUTO_POSITION (0x100)? I see it in OpenConsole and not in Conhost. What does it do? |
Beta Was this translation helpful? Give feedback.
-
TCC 30.00.22 x64
Microsoft Windows 10 Pro for Workstations
10.0.19045.3086 (2009, 22H2)
WindowsTerminal 1.18.2305.26002 (preview)
Using Cygwin's CAT.EXE ((GNU coreutils) 9.0), if I CAT some binary file (by mistake the first time) the console's input mode is very likely to be changed to include ENABLE_VIRTUAL_TERMINAL_INPUT. Whether or not that happens depends on the binary file and is consistent for a given file. This has a devastating effect on my shell (TCC) but it also happens in PowerShell/PWSH (apparently without the devastating effect). For example, in PowerShell, before and after issuing
d:\cygwin\bin\cat.exe d:\wt\exe\WindowsTerminal.exe
... before ...after ...
The same happens in a Windows console. It does not happen if I use another means of sending the file to stdout ... TCC's TYPE, PowerShell's TYPE, an older (32-bit) Gnu CAT.EXE ((GNU coreutils) 5.3.0), WSL CAT (each of those producing visually different output).
I wouldn't expect Cygwin's CAT.EXE to do that on purpose. And whether or not it happens depends on the binary file. So I must ask whether sending garbage to stdout could cause it.
Beta Was this translation helpful? Give feedback.
All reactions