2

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 '19 at 14:37
  • try TERM=vt100 && export TERM – tatsu Jul 1 '19 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. – Matilda Smeds Jul 2 '19 at 10:33
  • 1
    Great! Could you post an answer explaining what you did? – terdon Jul 2 '19 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. – Matilda Smeds Jul 15 '19 at 19:50
4

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.

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.