Repository navigation
Description
Windows Terminal version
1.23.12811.0
Windows build number
10.0.19045.0
Other Software
Remote: vim-9.1.1336
Local: OpenSSH_for_Windows_10.0p2 Win32-OpenSSH-GitHub, LibreSSL 4.2.0 (also happens with 9.5p1)
Local: Linux yomi 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Steps to reproduce
- ssh to remote system
vim doesntexist
Expected Behavior
vim would open with an empty buffer.
Actual Behavior
vim opens and immediately inputs text into the file in more than 75% of cases. Sometimes, it does work as expected. For me, it almost always inserts c0c0 or /c0c0, but rarely seems to insert slightly different text.
Related seems to be issue #1637 which is marked as fixed in 2020 (with Terminal 1.4 or so?). I found that issue through #12164 which was eventually marked as a dupe of the former.
There's vim/vim#6365 marked as closed with the fix being in Terminal.
If I run the command from #1637 (comment) I get this (after pressing enter a few more times to get hd to output):
00000000 1b 5b 32 3b 32 52 1b 5b 33 3b 33 52 0a 0a 0a 0a |.[2;2R.[3;3R....|
This doesn't match the given expected output nor the given actual output from Terminal at the time.
Additionally, from vim/vim#6365 (comment), if I have vim output that additional logging info, I get this:
==== start log session Sun Nov 23 14:36:33 2025 ====
0.025072600 : raw terminal output: "ESC[?1049hESC[22;0;0tESC[>4;2mESC[?1hESC=ESC[?2004hESC[?1004h"
0.025164054 : raw terminal output: "ESC[1;30rESC[?12hESC[?12lESC[22;2t"
0.025541736 : raw terminal output: "ESC[27mESC[23mESC[29mESC[mESC[HESC[2JESC[2;1H▽ESC[6n"
0.025575884 : raw terminal output: "ESC[2;1H ESC[3;1HESCPzzESC\ESC[0%mESC[6n"
0.025629137 : raw terminal output: "ESC[>c"
0.025661407 : raw terminal output: "ESC]10;?^GESC]11;?^G"
0.026055930 : SafeState: Start triggering
0.026663372 : setting timeout timer to 2 sec 0 nsec
0.026957183 : looking for messages on channels
0.026976768 : SafeState: back to waiting, triggering SafeStateAgain
0.121551739 : raw key input: "ESC[3;3RESC[2;2RESC[3;3RESC[2;2Rc0/c0c0ESC\"
0.121703787 : SafeState: reset: key typed
0.122962544 : setting timeout timer to 2 sec 0 nsec
0.123107819 : SafeState: Start triggering
0.123143032 : looking for messages on channels
0.123156800 : SafeState: back to waiting, triggering SafeStateAgain
0.148485774 : raw key input: "c0/c0c0ESC\00/0000ESC\"
0.148595563 : SafeState: reset: key typed
0.149243984 : setting timeout timer to 2 sec 0 nsec
0.149646816 : SafeState: Start triggering
0.149685080 : looking for messages on channels
0.149699609 : SafeState: back to waiting, triggering SafeStateAgain
3.559813415 : raw key input: ":"
3.559925446 : SafeState: reset: key typed
3.560017843 : SafeState: Start triggering
3.560047949 : looking for messages on channels
3.560059937 : SafeState: back to waiting, triggering SafeStateAgain
3.834924500 : raw key input: "q"
The ESCs are literal 0x1bs. You can see in the 12th or 18th lines the strings c0c0. (I've attached the actual file, just in case.) logfile.txt
My TERM is set to xterm-256color. Two workarounds mentioned in the vim issue, set t_u7= and set ambw=double do not appear to help. Changing my TERM to linux, for testing, does seem to help.
Activity
lhecker commentedon Nov 24, 2025
See here for a lengthy discussion with lots of links: #18004
Recent versions of Windows Terminal had a few fixes. There's two remaining problems to my knowledge:
OpenConsole.exeyou have on your system and simply copy it overC:\Windows\System32\conhost.exe. This may break OS updates until you use DISM to restore your OS integrity. But this will fix a lot of bugs on your Windows 10 setup.o-sdn-o commentedon Nov 24, 2025
Please note that on Windows 10, replacing the supplied conhost.exe with OpenConsole.exe will introduce other issues, for example, sftp access
sftp user@win10will completely stop working.DHowett commentedon Nov 24, 2025
Issues like this are important to us, because that's pretty much what happens when we upgrade conhost in the Windows source code as well. Do you know if it repros there?
o-sdn-o commentedon Nov 24, 2025
When replacing the default conhost.exe with OpenConsole.exe:
sftp user@127.0.0.1session hangs.sftp user@127.0.0.1session closes immediately:With default conhost.exe everything works as it should:
o-sdn-o commentedon Nov 24, 2025
DHowett commentedon Nov 24, 2025
Sorry. On Windows 11 with conhost. You covered that though :)
DHowett commentedon Dec 3, 2025
Yep, I'm gonna call this a /duplicate of PowerShell/openssh-portable#806
Thanks!
microsoft-github-policy-service commentedon Dec 3, 2025
Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!
Fyren commentedon Apr 8, 2026
Sorry for the late reply, but I finally got around to compiling openssh myself. The indicated PR (PowerShell/openssh-portable#806) was merged into
latestw_all(PowerShell/openssh-portable@2586de1) in December and I built the current head of that branch for testing.I ran through the same things mentioned in the original report and the behavior is the same. In most cases running vim ends up automatically switching to insert mode and inserting text. Changing TERM to linux still appears to stop the problem from happening.
The example command piped to
hdis still weird but is maybe working as expected, but I don't understand what the echo'd stuff is supposed to do to the terminal. My output is different because I have to hit enter a few times to gethdto produce output, which are the extra0as, I guess? If I have vim log its output, it's the same as the original.