-
Notifications
You must be signed in to change notification settings - Fork 139
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
previous command becomes ‘[A’ #112
Comments
Please share your It sounds like there might be an entry that captures a partial key sequence, throwing off other key sequences. Clink uses a custom terminal input driver, so some extended keys (and particularly Esc) have different escape sequences than usual. Also, in case this is related: when adding new key sequences, the best way to find out the right escape sequence to use is to run |
P.S. Also, I'm not able to reproduce this, so can you share any additional information about the configuration or locale or etc? Please share the clink.log file, too, if possible. |
I ran locale: |
If the inputrc file came from Use That's the one I need to see. Maybe it's the same Also, can you confirm what are the repro steps?
EXPECTED: activates the previous history entry. |
Oh! I understand now roughly what's happening, thanks to your use of
Somehow the initial Are you using WSL or cygwin in Cmder? Or anything else other than simply launching cmd.exe? It appears something is intercepting console input and forwarding it (inaccurately), causing Clink to sometimes see the real input stream but sometimes see a preprocessed simulated input stream. This sounds very similar to this known issue in ConEmu: |
One more question: Does this happen with Clink in a standalone cmd.exe as well? Or only inside Cmder/ConEmu? |
Yes, I am using cygwin in Cmder. This is the default startup task of Cmder. |
Ugh. Ok, I will try to investigate inside ConEmu's source code and see if I can find more details and/or a workaround. That might take a while, though. |
This part is very interesting.
Maybe *nix commands are leaving the console mode set to an unexpected mode, or maybe some ConEmu internal state isn't restored after a *nix command. If we can enable me to reproduce the issue, that will significantly improve the chances of successfully resolving this problem. Thanks! |
Yay, I can repro now:
Investigating... UPDATE:
|
It's the ConEmu "Terminal Mode". You can observe the terminal mode change by doing this:
Normally there will be a "WK" in the status bar (hover over it to see a description). In the "XK" mode ConEmu intercepts all keyboard input and converts it to Xterm input. That's what's interfering with Clink (and it will interfere with CMD.exe and some other programs, too). |
This is ConEmu #2302 and is fixed in ConEmu 210422. Cmder currently includes ConEmu 210304. I confirmed that I can't reproduce the problem in the latest ConEmu -- the terminal mode switches back to Windows ("WK") immediately. But I can repro it in older ConEmu versions. The issue was affecting Far and other programs, too. You can either copy ConEmu 210422 into a Cmder installation, or wait for Cmder to pick up the latest ConEmu, or wait 5 seconds before using extended keys (arrows, Ins, Del, etc) after using a program that requires Xterm mode. |
Use the arrow keys to call up the previous command, strange characters will appear.
I haven't encountered this problem before. I only discovered it recently. It may be related to the update of windows. I tested it on a colleague's computer and another computer of mine, and it all reappeared.
Below is a screenshot.
It seems that the readline module has a few strange inputs.
The text was updated successfully, but these errors were encountered: