I can't get this putty to handle alt + left/right properly.
(Edit: By "properly", I obviously mean the way I have grown used to moving the cursor about;-)
Usually I can do:
cat > /dev/null
..<hold alt and left arrow>..
to get the proper key. In this case I get: ^[^[[D
I then proceed to do:
bind '^[^[[D:backward-word'
I've also tried:
bind '\e\e[D:backward-word'
Please note that this problem is the same in screen (with TERM=screen) and outside of screen (with TERM=xterm).
Any tips on what I should try next? Any putty options that need to be enabled/disabled?
Left and Right keys move the cursor one single char. Home and end keys move the cursor to the beginning and end of line resp. Ctrl + A and Ctrl + E combos bring my cursor to the beginning and end resp. This is the behaviour I would like for all my shells.
When using word processors, the 'up arrow' moves your cursor up one line of typed characters at a time, the 'down' arrow moves it down one line of typed characters at a time. The left and right arrows move the cursor one character to the left or right. To move more than one character, press the key continually.
Press w (“word”) to move the cursor to the right one word at a time. Press b (“back”) to move the cursor to the left one word at a time. Press W or B to move the cursor past the adjacent punctuation to the next or previous blank space.
This format of bind
doesn't work for me either for some reason, but I've had success with bind -f
.
~/.bashrc:
if [ -f ~/.readline-bindings ] ; then
bind -f ~/.readline-bindings
fi
~/.readline-bindings:
"\e[1;3D": backward-word
"\e[1;3C": forward-word
Note the space after the :
character. Obviously you should use your own control sequence here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With