dschlitt
(Danny Schlitt)
April 18, 2020, 8:25pm
63
If anyone else is having issues with the vertical split shortcut and is running tmux 3.0 or higher you need to escape the backslash because they’ve changed parsing libraries.
bind-key \\ split-window -h -c '#{pane_current_path}'
opened 09:49PM - 06 Jul 19 UTC
closed 10:20PM - 06 Jul 19 UTC
As per in [tmux 3.0 CHANGELOG](https://raw.githubusercontent.com/tmux/tmux/3.0/C… HANGES):
> * INCOMPATIBLE: tmux's configuration parsing has changed to use yacc(1). There
is one incompatible change: a \ on its own must be escaped or quoted as
either \\ or '\' (the latter works on older tmux versions).
The behavior of parsing `\` is breaking. Well, I understand breaking changes are sometimes necessary -- but then how to bind <kbd>C-\\</kbd> ?
The following is a configuration line that is working well on tmux <= 2.9:
```tmux
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
```
In 3.0, it fails to parse near `\`:
```
.tmux.conf:250: unknown key: C- if-shell
```
I would like to have a configuration file that is compatible with **both 2.x and 3.0** (because `if-else` is not possible in 2.x). I have tried the following but neither one works:
```
bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind -n C-'\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
```
Thanks!