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.

To navigate to the starting and end of a command, I usually use Ctrla and Ctrle.

However, when I work within a GNU screen, those keybinding do not work becuase perhaps they are being used by the GNU screen. Is there another way to move to the starting or the end of the command?

I am on CentOS6.2

share|improve this question
add comment

3 Answers

up vote 9 down vote accepted

Ctrl-A followed by the letter 'a' will send the Ctrl-A sequence to the shell.

Or you could map the screen command key to something other than Ctrl-A

share|improve this answer
add comment

The default readline binding for beginning-of-line is Ctrla. As this conflicts with screen's command prefix, you can either rebind the screen prefix, as suggested by Johnny, or include another binding in your .inputrc to map the readline behaviour to another keybind, for example to map the same behaviour to Alta, you could use:

"\ea": beginning-of-line

This will allow you to use either Ctrl or Alt a outside of screen and Alta within.

All of the readline bindings can be customized for both Emacs (the default) or vi mode.

A full list of all of the readline commands is availbale here: http://linux.about.com/library/cmd/blcmdl3_readline.htm

share|improve this answer
add comment

As others have said, Ctrl-a is often used by emacs and the shells' emacs mode. What I generally do is use screen's escape command to set the key sequence to Ctrl-z. Most of the time, I'm not looking to stop a program only to run another - for that, I open a new screen window and run the program. When I do, it is easy enought to type Ctrl-z z. Also, I very often ssh to other systems and run screen there, where I might use Ctrl-a as well.

share|improve this answer
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.