4

I like to use command-line commands CTRL-a (beginning of line) and CTRL-e (end of line), but when I start a tmux session, these commands don't work. CTRL-key seems to be interpreted as caret ^, as in the terminal I see ^A and ^E respectively. CTRL-b works without any issues.

I'm using xfce4-terminal and zshell, if that makes any difference.

Setting set -g default-terminal 'screen-256color' in .tmux.conf did not help.

Would be grateful for any help.

6
  • 1
    I don't remember the details (hence only a comment) but it sounds like you need to enable emacs-style keyboard shortcuts in either tmux or zsh or both.
    – terdon
    Jul 1, 2019 at 14:37
  • try TERM=vt100 && export TERM
    – tatsu
    Jul 1, 2019 at 15:15
  • @terdon Thanks for the reply, I searched for emacs-style bindings specifically, and found this answer stackoverflow.com/a/39520371 which solved my problem. I never knew the issue was originating from zsh, considering in zsh these bindings work. Jul 2, 2019 at 10:33
  • 1
    Great! Could you post an answer explaining what you did?
    – terdon
    Jul 2, 2019 at 10:56
  • @terdon Done! It's a very short answer, but it explains what solved my issue. Thanks again for your reply, it helped me to search more accurately for information. Jul 15, 2019 at 19:50

1 Answer 1

6

After making the following changes to my dot files, I was able to use emacs style key bindings also inside a tmux session.

# .zshrc
bindkey -e

# .tmux.conf
set -g mode-keys emacs
set -g status-keys emacs

This answer on StackOverflow helped me solve my issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .