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?

viuser
  • 2,564
  • 3
  • 29
  • 57

1 Answers1

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.

Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268
  • 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. – Anthony Geoghegan Mar 08 '21 at 11:27