-
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
Arrow keys broken in msys2 bash programs after installing Terminal #6054
Comments
I found #4949 but it was hard to understand exactly everything going on in there, so I decided to make a new issue and we can merge if it's fundamentally the same behavior/issye that's being described in there, instead of adding noise permanently to that task if it's not. |
Through some combination of resetting settings, switching back and forth between legacy console and new console, resetting ConEmu to default (although my repro conditions didn't involve ConEmu), and setting |
So this worries me more than you having the problem to begin with 😉 How long have you been forcing msys 3.1 contains the runtime changes from cygwin 3.1. Cygwin 3.1 no longer treats the windows console as term=cygwin (it prefers |
To directly answer your question: TERM=cygwin was my ultimate fix to the problem. I only set it at the end of my debugging. Until then the TERM setting was... whatever it was inheriting from the environment. Including when I did the msys upgrade. The issues also persisted across reboots after uninstalling/reinstalling WT, as I was trying really hard to make sure it wasn't some stale state issues. So, the full order of events was:
I'm spookum, I tell you what. |
So I did a clean msys2 install just to be sure, and yeah unless I set TERM=cygwin in my .bashrc many programs just seem to fall over head. I think the precipitating moment was installing WT which changed the default conhost (maybe? Not really sure if that's what happens when WT is installed), which then changed the default value of $TERM in my environment which then broke everything. I think many msys programs need to be updated or configured to handle TERM=xterm-256 or anything not-cygwin correctly. |
More updates:
I think in general I should get off Cygwin, but I should probably dig into why less requires TERM=cygwin for arrows to work right. |
msys2/MSYS2-packages#1124 is the closest other issue I've managed to find about this, but nothing I've tried works except setting TERM=cygwin. |
Also #6045 looks topically similar. Hm. |
I am starting to think my issue is just that I was confused about how arrows keys are 'supposed' to work in a real terminal emulator and I was spoiled by TERM=cygwin defaulting me to some less robust input handling mode, and I need to just map arrow keys manually in the relevant apps until I either give up or get the responsiveness style I want. |
I got similar behavior today, |
Weird, having term be xterm-256color is what made things wonky for me (but again, that's probably because I'm used to non-xterm behavior for my command line programs). |
@jljse how did you change the terminal type 'from the window's title bar' exactly? |
msys2/MSYS2-packages#1684 might also be relevant. Still reading through that. |
Right click on the window's title bar, and select 'Options...'. currently, I do workaround almost everyday:
|
What terminal emulator are you using? mintty, which comes with msys2? I'm using WT directly but running msys bash inside it. |
ah... I misunderstand about context. I wrote about mintty (shortcut point to msys2_shell.cmd) . |
Environment
Steps to reproduce
0a) Edit: Reverting msys2-runtime did not resolve the issue.
0b) Edit2: The same thing happens if I run bash directly via ConEmu with -new_console:p5
cmd.exe
C:\<msys2 install path>\usr\bin\bash.exe --login -i
less
orvim
cmd.exe
settings, select 'Use legacy console'cmd.exe
, observe applications respond to arrow keys againExpected behavior
Actual behavior
less, vim, etc. do not respond to arrow keys at all. bash history however does correctly respond, interestingly.
Side notes
For completeness, the full list of packages I upgraded before experiencing this issue: https://gist.github.com/akrieger/f3f7bdc38f22e663d156526ea94df839
The text was updated successfully, but these errors were encountered: