Home/End keys do not work in tmux

前端 未结 8 1524
无人及你
无人及你 2021-01-30 10:37

I\'m currently using tmux with xterm-256color $TERM variable. When in bash under tmux, pressing home/end would insert tilde characters (~). Outside of tmux the home/end keys wor

相关标签:
8条回答
  • 2021-01-30 11:10

    It appears the main problem is with using xterm-256color for $TERM. I switched $TERM to screen-256color and the problem went away.

    0 讨论(0)
  • 2021-01-30 11:12

    From tmux FAQ:

    PLEASE NOTE: most display problems are due to incorrect TERM! Before reporting problems make SURE that TERM settings are correct inside and outside tmux.

    Inside tmux TERM must be "screen", "tmux" or similar (such as "tmux-256color"). Don't bother reporting problems where it isn't!

    Outside, it should match your terminal: particularly, use "rxvt" for rxvt and derivatives.

    Add the following command to your ~/.tmux.conf:

    set -g default-terminal tmux-256color
    

    PS: any solution involving binding the keys explicitly is a hack, and as such bound to fail.

    0 讨论(0)
提交回复
热议问题