0

When I am in PuTTY, and I execute a bunch of commands, I often want to use the same command I just used. So I press the "Up" arrow. The last command now shows up, but I want to edit it a little.

I couldn't figure out how to edit it, until I realised it let me edit it using "vi" commands.

Does anyone know what setting in PuTTY I have to change to allow me to edit it normally instead of having to use "vi" commands?

Thanks

4
  • Your issue is related to the machine you are using PuTTY to connect to, not with PuTTY. You'll need to supply us with more info about the operating system and shell you are connecting to. Dec 6, 2013 at 4:20
  • This is caused by the shell being in the vi editing mode. Check your shell documentation. Quite commonly setting editing mode to emacs mode, ie. executing set -o emacs helps.
    – tvm
    Dec 6, 2013 at 5:33
  • Bash and all other shells that use the readline library use emacs editing mode by default. Either you set your shell to work like that or someone else did it for you.
    – romainl
    Dec 7, 2013 at 14:33
  • @tvm that fixed the issue! Dec 10, 2013 at 21:30

1 Answer 1

1

This is not the PuTTy issue, It's caused by bash readline.

I think the result would be looks like mine if you execute the following two commands:

$ bind -v | grep keymap
set keymap vi-insert
$ bind -v | grep editing-mode
set editing-mode vi

That means, the bash shortcut was set as vi-like (default is emacs-like). If you want to revert to original, input the following two commands:

set editing-mode emacs
set keymap emacs

And re-start your PuTTy. I think everything will be fine.

However, if this is the public server, and many people are all using it. You can try find previous-history by using ctrl + p. Or find the shortcuts about previous-history by:

$ bind -p | grep previous-history
"\C-p": previous-history
"\eOA": previous-history
"\e[A": previous-history
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .