3

Years ago, an Ubuntu update broke this and I've never found a solution.

  • I have fish as my default shell.
  • Ubuntu 12.10
  • Locally (Gnome Terminal), Home and End keys work fine in both fish and bash.
  • When I log in by SSH using PuTTY, then run bash, Home and End work fine inside of bash.
  • However, when I log in by SSH using PuTTY, in the default fish shell, pressing Home key produces [1~ (sometimes erasing the line, sometimes not). When I press End, it produces [4~.
  • If I use the default fish shell in Bitvise SSH client, Home and End work correctly.

How do I get Home and End to work correctly?

4

Try something like this:

bind \e\[1~ beginning-of-line
bind \e\[3~ delete-char
bind \e\[4~ end-of-line

You can preserve this setting by append this option at fish_default_key_bindings:

/usr/share/fish/functions/fish_default_key_bindings.fish

Caution! If you have a typing error with the setting file, some keys doesn't work :)

See also Home/End keys broken in screen when term is set to xterm

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.