@@ -14,6 +14,9 @@ show_copy_config='@prefix_highlight_show_copy_mode'
1414copy_attr_config=' @prefix_highlight_copy_mode_attr'
1515prefix_prompt=' @prefix_highlight_prefix_prompt'
1616copy_prompt=' @prefix_highlight_copy_prompt'
17+ empty_prompt=' @prefix_highlight_empty_prompt'
18+ empty_attr_config=' @prefix_highlight_empty_attr'
19+ empty_has_affixes=' @prefix_highlight_empty_has_affixes'
1720
1821tmux_option () {
1922 local -r value=$( tmux show-option -gqv " $1 " )
@@ -30,8 +33,10 @@ tmux_option() {
3033default_fg=' colour231'
3134default_bg=' colour04'
3235default_copy_attr=' fg=default,bg=yellow'
36+ default_empty_attr=' fg=default,bg=default'
3337default_prefix_prompt=$( tmux_option prefix | tr " [:lower:]" " [:upper:]" | sed ' s/C-/\^/' )
3438default_copy_prompt=' Copy'
39+ default_empty_prompt=' '
3540
3641highlight () {
3742 local -r \
@@ -42,16 +47,23 @@ highlight() {
4247 copy_highlight=" $5 " \
4348 output_prefix=" $6 " \
4449 output_suffix=" $7 " \
45- copy=" $8 "
50+ copy=" $8 " \
51+ empty=" $9 "
4652
4753 local -r status_value=" $( tmux_option " $status " ) "
4854 local -r prefix_with_optional_affixes=" $output_prefix$prefix$output_suffix "
4955 local -r copy_with_optional_affixes=" $output_prefix$copy$output_suffix "
5056
57+ if [[ " on" = " $empty_has_affixes " ]]; then
58+ local -r empty_with_optional_affixes=" $output_prefix$empty$output_suffix "
59+ else
60+ local -r empty_with_optional_affixes=" $empty "
61+ fi
62+
5163 if [[ " on" = " $show_copy_mode " ]]; then
52- local -r fallback=" ${copy_highlight} #{?pane_in_mode,$copy_with_optional_affixes ,}"
64+ local -r fallback=" ${copy_highlight} #{?pane_in_mode,$copy_with_optional_affixes ,${empty_highlight} $empty_with_optional_affixes }"
5365 else
54- local -r fallback=" "
66+ local -r fallback=" ${empty_highlight} $empty_with_optional_affixes "
5567 fi
5668
5769 local -r highlight_on_prefix=" ${prefix_highlight} #{?client_prefix,$prefix_with_optional_affixes ,$fallback }#[default]"
@@ -67,11 +79,15 @@ main() {
6779 output_suffix=$( tmux_option " $output_suffix " " " ) \
6880 copy_attr=$( tmux_option " $copy_attr_config " " $default_copy_attr " ) \
6981 prefix_prompt=$( tmux_option " $prefix_prompt " " $default_prefix_prompt " ) \
70- copy_prompt=$( tmux_option " $copy_prompt " " $default_copy_prompt " )
82+ copy_prompt=$( tmux_option " $copy_prompt " " $default_copy_prompt " ) \
83+ empty_prompt=$( tmux_option " $empty_prompt " " $default_empty_prompt " ) \
84+ empty_attr=$( tmux_option " $empty_attr_config " " $default_empty_attr " ) \
85+ empty_has_affixes=$( tmux_option " $empty_has_affixes " " off" )
7186
7287 local -r \
7388 prefix_highlight=" #[fg=$fg_color ,bg=$bg_color ]" \
74- copy_highlight=" ${copy_attr: +# [default,$copy_attr]} "
89+ copy_highlight=" ${copy_attr: +# [default,$copy_attr]} " \
90+ empty_highlight=" ${empty_attr: +# [default,$empty_attr]} "
7591
7692 highlight " status-right" \
7793 " $prefix_prompt " \
@@ -80,7 +96,10 @@ main() {
8096 " $copy_highlight " \
8197 " $output_prefix " \
8298 " $output_suffix " \
83- " $copy_prompt "
99+ " $copy_prompt " \
100+ " $empty_prompt " \
101+ " $empty_highlight " \
102+ " $empty_has_affixes "
84103
85104 highlight " status-left" \
86105 " $prefix_prompt " \
@@ -89,7 +108,10 @@ main() {
89108 " $copy_highlight " \
90109 " $output_prefix " \
91110 " $output_suffix " \
92- " $copy_prompt "
111+ " $copy_prompt " \
112+ " $empty_prompt " \
113+ " $empty_highlight " \
114+ " $empty_has_affixes "
93115}
94116
95117main
0 commit comments