In bash I can hit Ctrl + a and go to first of the command line.

But in screen Ctrl + a does not do this. How do I go to first of command line in screen?


You can press Ctrl+a followed by a to go to the beginning of the line. The a sends a Ctrl+a to the terminal.


The long way

Take a look at this Q&A from SuperUser, titled: Bash vs. Gnu screen : Replace Ctrl-A with Ctrl-Shift-A. There are several options but the easiest would be to remap Ctrl+aCtrl+a to something else for screen so that Ctrl+a can be freed for use by Bash.

excerpt from one of the answers

By default, C-a C-a is bound to the other command (switch to most recently active screen) in screen. To have C-a C-a send an actual C-a and have C-a o switch windows, put the following in your .screenrc:

escape ^A^A
bind o other

The short way

As @jordanm has pointed out in the comments. The above solution isn't necessary, however. The 2nd highest upvoted answer to that same Q&A states that you can simply type Ctrl+a+a and screen will send a Ctrl+a to Bash.

  • I don't necessary want to use C+a. Is there any shortcut specific to screen? – Mohsen Aug 7 '13 at 4:08
  • You failed to mention the second most upvoted answer in that thread superuser.com/a/237223/190213. It's the most straightforward (IMO) and the method I personally use. – jordanm Aug 7 '13 at 4:19
  • @jordanm - didn't scroll that far down. 8-). I've never run into this issue, I use tmux. – slm Aug 7 '13 at 4:23
  • @Mohsen - see updates. – slm Aug 7 '13 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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