terminal: Arrow keys broken in msys2 bash programs after installing Terminal

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.815]
Windows Terminal version (if applicable): 1.0

Any other software? msys2 bash version 4.4.23(2)-release (x86_64-pc-msys)

Steps to reproduce

  1. Note I also did an msys upgrade, which did upgrade msys2-runtime (3.0.7-6 -> 3.1.4-2). Not sure if that triggered this or installing Windows terminal did. I cannot find a way to safely revert my msys2-runtime package to confirm. 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
  2. Install msys2
  3. Run cmd.exe
  4. Run C:\<msys2 install path>\usr\bin\bash.exe --login -i
  5. Try to use an application that responds to arrow keys like less or vim
  6. Note that the applications do not respond to arrow keys
  7. In cmd.exe settings, select ‘Use legacy console’
  8. Repeat 2-4 after restarting cmd.exe, observe applications respond to arrow keys again

Expected behavior

  • less and vim and etc should respond to arrow keys (less should scroll, vim cursor should move)

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

So this worries me more than you having the problem to begin with 😉

How long have you been forcing TERM=cygwin? Was that a new change?

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 TERM=xterm-265 now). If you were setting TERM=cygwin across an MSYS upgrade, there’s a chance applications were still expecting data from the cygwin console translator.