begin-selection commands in tmux.conf has a problem.
fodrh1201 opened this issue · 3 comments
fodrh1201 commented
- tmux version : 2.7
- Platform : Linux x86_64
- $TERM inside and outside of tmux : xterm-256color
if-shell -b '[ "$(echo -e "$TMUX_VERSION\n"2.4 | sort -V | head -n1)" == "2.4" ]' \
'bind -T copy-mode-vi "v" send-keys -X begin-selection; \
bind -T copy-mode-vi "y" send-keys -X copy-pipe-and-cancel "pbcopy"; \
'
these commands don't work.
but I changed them not to include 'if sentence', and they do work.
bind-key -T copy-mode-vi "v" send-keys -X begin-selection
bind-key -T copy-mode-vi "y" send-keys -X copy-pipe-and-cancel "pbcopy"
I don't know why if-sentence does not work in tmux 2.7.
wookayin commented
I think it works for me with tmux 3.0 so the syntax should work.
Can you check the output of the following?
$ echo -e "$TMUX_VERSION\n"2.4 | sort -V
fodrh1201 commented
the output is the following
2.4
2.7
I think that if phrase is correct, but I don't know why it doesn't work. Let me take a closer look.
wookayin commented
Confirmed it is not working on older tmux versions.
The problem was that double equal (==
) was being used to compare if two strings are equal, but this is wrong. I should use single equal (=
) as the string equality operator.
Please let me know if it works for you!