Termux: Combine Ctrl+b into a single button for tmux

Termux's extra-keys support macros, combining CTRL and another key into one button - handy for the tmux prefix.

1 min read

When using Termux with tmux, you often have to type Ctrl + b. Pressing two keys in a row is a bit annoying, so I added a dedicated button in Termux.

Add this to ~/.termux/termux.properties:

extra-keys = [ \
  ['ESC','/','-','HOME','UP','END','PGUP'], \
  ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN'], \
  [{macro: 'CTRL b', display: 'C-b'}] \
]

Then run:

termux-reload-settings

The C-b button will show up on the on-screen keyboard, and one tap sends the tmux prefix.