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.

Solution:

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 CtrlV CtrlLeftArrow and CtrlV CtrlRightArrow, you should see:

^[OD^[OC

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