I find Bash keyboard shortcuts such as Ctrl-a (jump to start of line), Ctrl-k (cut text following caret), Ctrl-n/Ctrl-p (next/previous line in command history) immeasurably useful in day-to-day CLI work.

It's a shame that these shortcuts don't work when SSH'd into a remote xterm.

Is there a way to enable these shortcuts over SSH?

  • 2
    These commands should work over SSH. What happens if you set -o emacs?
    – Chris Down
    Commented Nov 13, 2012 at 14:16
  • 2
    And ps $$? It might not even be bash. (ksh and zsh default to vi bindings if EDITOR=vi.)
    – Mikel
    Commented Nov 13, 2012 at 14:41

1 Answer 1


Editing command line (including shortcuts) is a feature of a shell, not a terminal emulator (for the most part). So just put bash into emacs mode on a remote xterm:

$ set -o emacs
  • This works like a charm, sincere thanks.
    – user490123
    Commented Nov 13, 2012 at 15:07

You must log in to answer this question.

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