Add display-popup fallback bindings

While display-popup was added in 3.2 the -B, -b, and -S flags were not
introduced until 3.3. This adds fallback bindings which forego these
flags to retain functionality at the cost of aesthetics.
This commit is contained in:
2026-01-27 11:01:59 +00:00
parent 50d9c3be28
commit 2bdc15debd

View File

@@ -66,14 +66,16 @@ bind a run-shell ~/.local/share/tmux/layouts/window-auto
if -b '[ "`uname`" = "Darwin" ]' \ if -b '[ "`uname`" = "Darwin" ]' \
'set -g default-command "reattach-to-user-namespace -l $SHELL"' 'set -g default-command "reattach-to-user-namespace -l $SHELL"'
if -b '~/.config/tmux/check-version.sh ">" 3.2' { if -b '~/.config/tmux/check-version.sh ">=" 3.2 && ~/.config/tmux/check-version.sh "<" 3.3' {
# Open a popup with running the default shell bind T display-popup -d '#{pane_current_path}' -E $SHELL
bind T display-popup -S fg=#54546D -b rounded -d '#{pane_current_path}' -E $SHELL bind S display-popup -w 60 -h 10 -E '~/.config/tmux/session.sh'
# Open a popup with session creator/switcher bind P display-popup -w 60 -h 10 -E '~/.config/tmux/project.sh'
bind I display-popup -d '#{pane_current_path}' -E '$SHELL -i ~/.config/tmux/interpreter.sh'
}
if -b '~/.config/tmux/check-version.sh ">=" 3.3' {
bind T display-popup -S fg=#54546D -d '#{pane_current_path}' -E $SHELL
bind S display-popup -B -w 60 -h 10 -E '~/.config/tmux/session.sh' bind S display-popup -B -w 60 -h 10 -E '~/.config/tmux/session.sh'
# Open a popup with project selector
bind P display-popup -B -w 60 -h 10 -E '~/.config/tmux/project.sh' bind P display-popup -B -w 60 -h 10 -E '~/.config/tmux/project.sh'
# Open a popup to pick an interpreter then launch it
bind I display-popup -S fg=#54546D -b rounded -d '#{pane_current_path}' -E '$SHELL -i ~/.config/tmux/interpreter.sh' bind I display-popup -S fg=#54546D -b rounded -d '#{pane_current_path}' -E '$SHELL -i ~/.config/tmux/interpreter.sh'
} }