2

With FreeBSD 11.1 and tmux 2.7, pressing (backspace) sends ^? and ctrl+ does also send ^?.

The default behavior (no tmux) is:

  • ^H for
  • ^? for ctrl+

How can I get this default behavior with tmux? Or at least achieve that and ctrl+ don't send the same control character?

PS: okay, calling stty ek before starting tmux works. But isn't there some way to cleanly configure tmux?

1 Answer 1

3

tmux only pays attention to the stty settings (no config- or terminfo-data). Here's the code:

/*
 * Check for backspace key using termios VERASE - the terminfo
 * kbs entry is extremely unreliable, so cannot be safely
 * used. termios should have a better idea.
 */
bspace = tty->tio.c_cc[VERASE];
if (bspace != _POSIX_VDISABLE && (key & KEYC_MASK_KEY) == bspace)
    key = (key & KEYC_MASK_MOD) | KEYC_BSPACE;

So... setting stty is the only way to go.

1
  • Thanks. I was trying to use Ctrl-Backspace (^?) as my Tmux prefix key. To get this to work, I had to stop the character being used as the erase character (stty erase "") before starting Tmux. Commented Mar 8, 2021 at 11:27

You must log in to answer this question.

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