configurationtmuxremap

tmux changes "\" to spacebar when prefix is pressed


In tmux.conf I have mapped \ (alt gr + q) to rename session and it worked fine up until few months ago, then stopped responding to \ when prefix is activated.

By chance I've figured out that tmux somehow started responding to spacebar for session rename when prefix is pressed.
I have remapped it to other characters for testing purposes and only \ is not responding and is changed to spacebar, this is happening even after fresh Linux installation.

Intrestingly, it does recognize \ when it's written out in terminal or any CLI editor and it's not problem with UTF8 because I've played with different option:

Configuration for session and window rename

# Rename session and window
bind \  command-prompt -I "#S" "rename-session -- '%%'"
bind |  command-prompt -I "#W" "rename-window -- '%%'"

Tmux version is 3.2, I couldn't find anything regarding this problem in man or in tmux issues on GitHub.


Solution

  • tmux 3.0 made two incompatible changes in config file parsing. One is

    a \ on its own must be escaped or quoted as either \\ or '\' (the latter works on older tmux versions).

    See here. So you should try bind \\ ... or bind '\' ... instead.