terminal: Ctrl arrow keys don't behave as expected
From @Karasuni on May 25, 2017 16:19
Using Bash on Windows the ctrl+arrow keys don’t behave as expected. Instead of navigating per word it instead prints a few characters:
- Ctrl + UP =>
;5A - Ctrl + DOWN =>
;5B - Ctrl + LEFT =>
;5C - Ctrl + RIGHT =>
;5D
The issue also appears in tmux when trying to resize te terminal using Oh My Tmux command Ctrl+A + arrow key
Copied from original issue: Microsoft/WSL#2153
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 9
- Comments: 23 (16 by maintainers)
For what it’s worth, if you have an
.inputrcfile in your home directory, then the default/etc/inputrcfile is not read. If you want to have the default bindings then you can either copy the file contents, or add the directive$include /etc/inputrcto your~/.inputrcfile.The original issue from 2017 had exactly this problem,
~/.inputrcwas present and it did not include the default/etc/inputrc.If you’re using zsh, there are instructions here https://hellricer.github.io/2019/05/21/ctrl-arrows-in-terminal.html
Based on my investigation, the default configuration of bash does not allow <kbd>Ctrl+Arrow</kbd> to navigate by word.
Have you configured your
inputrcto allow this? If not, this is not a bug.I can also use ctrl+A to move to the beginning of the line in WSL, but no luck with ctrl+arrow