Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
2  
These commands should work over SSH. What happens if you set -o emacs? –  Chris Down Nov 13 '12 at 14:16
2  
And ps $$? It might not even be bash. (ksh and zsh default to vi bindings if EDITOR=vi.) –  Mikel Nov 13 '12 at 14:41
add comment

1 Answer

up vote 1 down vote accepted

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
share|improve this answer
    
This works like a charm, sincere thanks. –  KomodoDave Nov 13 '12 at 15:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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