Skip to content

Commit

Permalink
When getting a tmux option, first check session option
Browse files Browse the repository at this point in the history
It seems logical to check session options, failing which, then, check
global options. This allows, for example, per-session customization of
the color tmux variables.
  • Loading branch information
jdelkins committed Apr 7, 2021
1 parent 99e7ef7 commit 4a6708a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ export LC_ALL=C
get_tmux_option() {
local option="$1"
local default_value="$2"
local option_value="$(tmux show-option -gqv "$option")"
local option_value="$(tmux show-option -qv "$option")"
if [ -z "$option_value" ]; then
option_value="$(tmux show-option -gqv "$option")"
fi
if [ -z "$option_value" ]; then
echo "$default_value"
else
Expand Down

0 comments on commit 4a6708a

Please sign in to comment.