Friday, November 8, 2013

Move terminal cursor to front of prompt while attached to GNU Screen

Moving your cursor to the front of a terminal prompt will save you time and frustration. To move your cursor to the front of the terminal prompt in a bash shell session simply use the key binding

C - a

Since it is common that C - a is the key binding for GNU Screen, you have to use:

C - a - a

The other option is to bind it to a key for your shell. In bash, add this line to ~/.bashrc

bind '"\C-p": beginning-of-line'

Then

source ~/.bashrc

Now you can nail that cursor home anywhere with:

C - p

This is the two-step of terminal prompt dance moves. Learn it.

No comments:

Post a Comment