3

I have the following entries in my ~/.tmux.conf

# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

which usually have been sufficient to use tmux with Ctrl-A + Ctrl-A to jump to the beginning of a line. Since a while now Tmux instead just prints a ^A highlighted in the cursor colour.

Did something change on Tmux that I missed with some update or is it invoked by zsh or termite (Terminal Emulator)?

Complete ~/.tmux.conf:

set-option -ga terminal-overrides ",xterm-termite:Tc"

# source /usr/lib/python3.7/site-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"

# enable utf-8 on status bar
set-option -g status on
# set-option -g status-utf8 on

# remap prefix from 'C-b' to 'C-a'
unbind C-b
set -g prefix C-a
bind-key C-a send-prefix

# split panes using | and -
# bind | split-window -h
# bind - split-window -v
# split window and fix path for tmux 1.9
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %

# reload config file (change file location to your the tmux.conf you want to use)
#bind r source-file ~/.tmux.conf
unbind r
bind r \
    source-file ~/.tmux.conf \;\
        display 'Reloaded tmux config.'

# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# modes
# setw -g mode-attr bold 
# set -g message-attr bold
# setw -g window-status-bell-attr bold
# setw -g window-status-current-attr bold

set -g status-bg colour2

# switch panes using vim keybindings
# bind -n M-h select-pane -L
# bind -n M-l select-pane -R
# bind -n M-k select-pane -U
# bind -n M-j select-pane -D

# switch panels
bind k selectp -U # switch to panel Up
bind j selectp -D # switch to panel Down 
bind h selectp -L # switch to panel Left
bind l selectp -R # switch to panel Right

set-window-option -g mode-keys vi

# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
Marlon Richert
  • 3,715
  • 5
  • 30
baxbear
  • 191
  • 8

1 Answers1

1

In tmux, Ctrl + A to go to the beginning of line only applies while in "copy" mode. While not in "command" or "copy" mode, the position of the curser is controlled by the current pane's shell or program, not tmux.

So you need to enter "copy" mode first, then hit Ctrl + A for line start. For default keys, this would be:

Ctrl + A
[
Ctrl + A

Does this work for you?

AdminBee
  • 21,637
  • 21
  • 47
  • 71
Artur Meinild
  • 682
  • 5
  • 15
  • Nope, it doesn't work, still I am sure I could make my prompt jump to the beginning of the line (after I typed something) to add e.g. sudo to it using "Ctrl+a Ctrl+a". Your proposal doesn't even work in copy mode for me. Still thank you for trying to help! – baxbear Jul 30 '20 at 13:16
  • If you want your prompt to go at the beginning of line, I think you should define this keyboard shortcut in your shell, and not tmux. In this way, it could just be a simple shortcut, like Ctrl + B - or Home even. – Artur Meinild Jul 30 '20 at 13:18