Unable to set prefix key to Ctrl-h in tmux on Lubuntu/Xfce

195 Views Asked by At

I would like Ctrl-h to be the prefix in tmux, rather than Ctrl-b. It worked fine on previous Ubuntu installs, also with Xfce. This time, I installed Lubuntu. Ctrl-h just won't work. It's like there is no prefix at all, including Ctrl-b. If I define other keys in the config file instead (e.g., 'a' or 'j'), they work just fine as prefix. The problem lies just with "h". Any pointers? This is my .tmux.config:

unbind C-b
set-option -g prefix C-h
bind-key C-h send-prefix
1

There are 1 best solutions below

0
0xeedfade On

This is a recurring issue, people try to bind 'C-h' in tmux and wonder what is happening to their key strokes.

Your terminal is configured to send ^h if you press the <Backspace> key. VT100 terminals will receive this sequence and delete one character to the left. Historically, Control + h generates the escaped sequence ^h. The terminal emulator will receive it and react before tmux, which is why tmux won't respond to it.

Lubuntu is probably using a different default terminal than Ubuntu with compatibility mode enabled, or the same terminal but with different default settings. You should be able to disable the VT100 emulation, or switch back to the previous terminal emulator you were using.

Another solution could be to avoid C-h, so that your config works with more terminals. When I encountered this issue, I started using 'Alt' instead of 'Control' (called Meta in tmux and marked M): M-a for prefix and M-h, M-l for quick vim-like navigation keys between windows. In the end I found it easier to reach, leading to a more ergonomic setup.