Make using check-version.sh support and/or

This commit is contained in:
2026-06-08 13:47:36 +01:00
parent 8d3b3316d2
commit 09e429c998
2 changed files with 97 additions and 28 deletions

View File

@@ -28,7 +28,7 @@ set -g status-interval 2
set -g default-terminal "tmux-256color"
# Enable true-color
if '~/.config/tmux/check-version.sh "<" 3.2' \
if '~/.config/tmux/check-version.sh "< 3.2"' \
'set-option -as terminal-features ",xterm*:Tc"' \
'set-option -as terminal-features ",xterm*:RGB"'
@@ -52,7 +52,7 @@ unbind -T copy-mode-vi MouseDragEnd1Pane
# Enable changing cursor shape per pane, vim or zsh should emit escape
# sequences to change cursor shape.
# iTerm2 only requires this before tmux 2.9
if '[ -n $ITERM_PROFILE ] && ~/.config/tmux/check-version.sh "<" 2.9' \
if '[ -n $ITERM_PROFILE ] && ~/.config/tmux/check-version.sh "< 2.9"' \
'set -ga terminal-overrides "*:Ss=\E]1337;CursorShape=%p1%d\7"'
# VTE compatible terminals.
if '[ ! -n $ITERM_PROFILE ]' \
@@ -61,7 +61,7 @@ if '[ ! -n $ITERM_PROFILE ]' \
# Enable strikethrough on VTE compatible terminals.
set -ga terminal-overrides 'xterm*:smxx=\E[9m'
if -b '~/.config/tmux/check-version.sh ">=" 3.2 && ~/.config/tmux/check-version.sh "<" 3.3' {
if -b '~/.config/tmux/check-version.sh ">= 3.2" and "< 3.3"' {
bind A if -F '#{==:#{session_name},agent}' { detach-client } {
display-popup -d '#{pane_current_path}' -w 50% -h 90% -E ~/.config/tmux/agent.sh
}
@@ -72,7 +72,7 @@ if -b '~/.config/tmux/check-version.sh ">=" 3.2 && ~/.config/tmux/check-version.
bind S display-popup -w 60 -h 10 -E ~/.config/tmux/session.sh
bind T display-popup -d '#{pane_current_path}' -E $SHELL
}
if -b '~/.config/tmux/check-version.sh ">=" 3.3' {
if -b '~/.config/tmux/check-version.sh ">= 3.3"' {
bind A if -F '#{==:#{session_name},agent}' { detach-client } {
display-popup -S fg=#54546D -b rounded -d '#{pane_current_path}' -w 75% -h 90% -E ~/.config/tmux/agent.sh
}