-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESC key press in CMD prompt #5239
Comments
Environment: The problem is in pseudoconsole output when ESC key is pressed while running CMD.EXE.
Ignore the dashed lines, they separate the reads from pseudoconsole's output pipe. I typed 'j' 4 times and then pressed ESC. I see that after ESC is pressed the cursor is positioned at the right spot by ESC[26;5H but then spaces are sent to erase text. Unfortunately the spaces move the cursor. Any ideas? Maybe something to do with console mode flags? |
It's really interesting that this only happens after FAR manager's been launched. |
Also, I see that as soon as I type a char the cursor positioning escape sequence is sent. I have rebuilt OpenSSH (because it also uses pseudoconsole) with some trace code and the same behavior occurs. Almost looks like FAR Manager 'did something' to the pseusoconsole that makes it not flush all of its output. |
Unfortunately I'm not seeing this on the Maybe this has to do with our weird |
It's interesting that 5 SPC characters are sent in order to blank out 4 |
The whole trace looks like it's from a pretty old version of conpty tbh. There's a lot of optimizations we've done to emit less text, but I can't really recall what timeframe those were done in exactly. There's clearly some bug that's happening here, but I'm 🤞 that this was actually already fixed |
I have installed Windows Terminal. Is there a way to force CreatePseudoConsole to use it instead of the old conhost which is on my system. maybe you can point me to a link about how to make it happen. It appears I have created a bug report for something which is in the rear view mirror for a while. |
I'm not sure there's really a recommended way at the moment unfortunately. This has been a pain area we've been thinking of solutions for actively, but don't have a definitive plan for quite yet. @DHowett-MSFT might have some ideas for workarounds for you |
Does this specifically require far 2.0? I just (accidentally) tried it with Far 3.0. Here's my results:
(also cool: this) |
Just tried with 'Far Manager, version 3.0.0.5555 x64' and the problem does NOT occur. It looks like it requires 'Far Manager, version 2.0 (build 1807) x86'. Do you have this version? I can easily zip my 'far 2.0' folder and attach it. Thank you for being persistent on this problem report. I am not married to 'far 2.0' in any way, just like it because it provides a good testing 'exercise' for my projects involving Windows Terminal. |
Also, I was able to duplicate the problem using your VtPipeTerm tool. Options: --debug --conpty --headless I launched 'far 2.0', pressed F10 to terminate, got back into the command line, typed a couple of chars, pressed ESC and the cursor failed to return where it should. conhost version: 6.3.18362.1 |
I'm tempted to resolve this as external considering that this has always worked for Far 3.0, and only doesn't work in Far 2.0. I suppose we could try and take a look at what we're doing wrong in the Far 2.0 case, but I'm definitely inclined to endorse the workaround of "upgrade Far". I'll let @DHowett-MSFT make the final call on this one |
Okay, this is because FAR 2.0 turns off the display of the cursor. There's two issues here:
It's Far's job to restore the cursor state when it exits, and with #2829 merged ConPTY will now do the more correct thing (hide the cursor). 😄 Thanks! |
Thanks! Problem solved, I see the issue doesn't show in the latest build of the Terminal when I force VtPipeTerm to use the latest OpenConsole exceutable. |
Environment
Steps to reproduce
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: