Friday, 15 September 2017

ubuntu - Putty SSH: CTRL+Cursor keys don't work skip to previous/next word


When I am connected to my local Ubuntu dev server with putty (from my Windows 7 box) via SSH, the following key combinations don't work to move the cursor forward and backward on word boundaries:



  • Ctrl+Left Arrow on the cursor pad

  • Ctrl+Right Arrow on the cursor pad


The cursor only moves one character at a time. I'm using bash.



Answer



Add these two lines to your ~/.inputrc file on the destination machine:


"\eOD": backward-word
"\eOC": forward-word

To make sure that they are the correct sequences, at a Bash prompt, type Ctrl-V Ctrl-LeftArrow and Ctrl-V Ctrl-RightArrow, you should see:


^[OD^[OC

When you start a new session, the keys will be available or you can press Ctrl-xCtrl-r to re-read the ~/.inputrc file for the current session.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...