_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:
;5A;5B;5C;5DThe 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_
_From @zadjii-msft on May 25, 2017 16:26_
@Karasuni What build number are you on? (open cmd.exe, run ver)
_From @Karasuni on May 25, 2017 16:27_
@zadjii-msft Version 10.0.15063
_From @sunjoong on May 25, 2017 18:0_
@Karasuni - Does that happen in pure bash console or in extaned terminal (I don't know the exact term) like tmux? I don't use terminal programs like screen or tmux, use pure bash console, and... my ctrl+left and ctrl+right do nothing, ctrl+up and ctrl+down ring a bell. I think screenshot(s) of terminal window might be helpful to figure it out.
_From @zadjii-msft on May 25, 2017 18:4_
@Karasuni any chance I could have you comment out this line from the .tmux.conf file and tell me if it still happens?
https://github.com/gpakosz/.tmux/blob/master/.tmux.conf#L12
set -s escape-time 10 # faster command sequences
You'll need to make sure all tmux sessions are killed to reload the conf.
_From @Karasuni on May 25, 2017 18:4_
@sunjoong Both in bash.exe in cmd.exe and bash.exe itself.

When using tmux it's similar:

_From @sunjoong on May 25, 2017 18:49_
I found similar issue on other site, My terminal returns ;5A;5D;5B;5C whenever I use CTRL+arrow.
_From @zadjii-msft on July 19, 2017 21:32_
@Karasuni Could I get you to post your /etc/inputrc file and your ~/.inputrc file (if it exists?)
Have you done anything else to change your environment (other than change your tmux configuration?) I'm having a particularly hard time reproducing the situation that causes this.
_From @Karasuni on July 19, 2017 21:39_
@zadjii-msft Here are the files. The original issue still persists (though I haven't actively used the environment lately)
_From @zadjii-msft on July 19, 2017 21:48_
Darn, nothing in there.
What's the output of env?
_From @Karasuni on July 19, 2017 22:5_
@zadjii-msft
raven@GWEN:~$ env
SHELL=/bin/bash
TERM=xterm-256color
USER=raven
NAME=GWEN
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
HOSTTYPE=x86_64
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/ProgramData/Oracle/Java/javapath:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/MongoDB/Server/3.2/bin:/mnt/c/Program Files (x86)/Skype/Phone:/mnt/c/Program Files/Microsoft Network Monitor 3:/mnt/c/dev/tools/Vagrant/bin:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/dev/tools/nodejs:/mnt/c/Program Files/Calibre2:/mnt/c/Users/raven/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/raven/AppData/Roaming/npm
PWD=/home/raven
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/raven
LOGNAME=raven
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
_=/usr/bin/env
I've also encountered the issue while using the embedded terminal in IntelliJ and reported it there where it's been briefly discussed.
_From @zadjii-msft on November 28, 2017 0:43_
Hey @Karasuni
I'm finally getting back to trying to track down this bug. Is it still reproing for you? It looks like it was patched in IntelliJ's side, but if it's still happening for you in conhost that's another issue.
What happens when you press Ctrl+V, Ctrl+Arrow from the bash commandline?
Can you bind Alt+Arrow to other actions in your tmux.conf? For example, https://gist.github.com/spicycode/1229612#file-tmux-conf-L41-L45
If you're able to bind those keys and use them successfully, then I'd be super confused as to what's wrong.
Hey so this issue's from 2017, and the chances we'll be able to track down it's original repro are _slim to none_. We also haven't heard any other reports of it recently, so there's a good chance the original problem is gone. I'm going to mark it as "No-Recent-Activity" - if someone has an active repro we can investigate, that's great! Please comment here ASAP. Otherwise the bot will come through in a couple days.
EDIT: Turns out, adding the No-Recent-Activity label counts as activity? I've instead added "needs-author-feedback", which will cause the bot to add No-Recent-Activity, _then_ close it.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
the issue is sitill here ...
You've provided no additional information. If you have an actual repro for this bug and can explain what is happening and what you think should happen, as well as what version of Windows you're on, that would help us a lot.
@jsn1993 Could you give us more info? The Ctrl+arrow keys have worked pretty consistently for a _few_ Windows releases at this point, so I bet something else is going on. Could you maybe file a new issue with repro steps?
@jsn1993 Could you give us more info? The Ctrl+arrow keys have worked pretty consistently for a _few_ Windows releases at this point, so I bet something else is going on. Could you maybe file a new issue with repro steps?
I know it works for cmd.exe. I'm running WSL ubuntu 18.04 though. I'm not sure it makes a difference in terminal. I was searching online and some issues were redirected to this one.
@jsn1993 Could you give us more info? The Ctrl+arrow keys have worked pretty consistently for a _few_ Windows releases at this point, so I bet something else is going on. Could you maybe file a new issue with repro steps?
I can also use ctrl+A to move to the beginning of the line in WSL, but no luck with ctrl+arrow
@jsn1993 Could you give us more info? The Ctrl+arrow keys have worked pretty consistently for a _few_ Windows releases at this point, so I bet something else is going on. Could you maybe file a new issue with repro steps?
ver on cmd.exe: Microsoft Windows [Version 10.0.18363.592]
Based on my investigation, _the default configuration of bash does not allow Ctrl+Arrow to navigate by word._
Have you configured your inputrc to allow this? If not, this is not a bug.
Based on my investigation, _the default configuration of bash does not allow Ctrl+Arrow to navigate by word._
Have you configured your
inputrcto allow this? If not, this is not a bug.
I checked the default /etc/inputrc
44 # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving 45 "\e[1;5C": forward-word
46 "\e[1;5D": backward-word
47 "\e[5C": forward-word
48 "\e[5D": backward-word
49 "\e\e[C": forward-word
50 "\e\e[D": backward-word
For what it's worth, if you have an .inputrc file in your home directory, then the default /etc/inputrc file _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/inputrc to your ~/.inputrc file.
The original issue from 2017 had exactly this problem, ~/.inputrc was present and it did not include the default /etc/inputrc.
Most helpful comment
Based on my investigation, _the default configuration of bash does not allow Ctrl+Arrow to navigate by word._
Have you configured your
inputrcto allow this? If not, this is not a bug.