If I set key bind of C-b to c-a in tmux how can I move the cursor to the beginning of the line?

Tmux

Tmux Problem Overview


I just move from GNU screen to tmux, in screen when I hit C-a, then type a again can take me to the beginning of the line, I wonder if I stick with C-a in tmux how can I work around this?

Tmux Solutions


Solution 1 - Tmux

Maybe its an issue about the version I am using, but if the above code does not work for you, try this:

set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix

Solution 2 - Tmux

As you know, C-b is the default prefix in tmux. C-b C-b is used to send an actual C-b character to the terminal. If you switch the prefix to C-a, you just need to rebind some keys to update which one sends the send-prefix command.

For your .tmux.conf:

# You probably already put this in
set prefix C-a

unbind-key C-b
bind-key C-a send-prefix

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmkoView Question on Stackoverflow
Solution 1 - Tmuxuser1978011View Answer on Stackoverflow
Solution 2 - TmuxchepnerView Answer on Stackoverflow