Tighten status line with tmux conditionals.
dblume

dblume commited on 2021-11-21 16:58:55
Showing 1 changed files, with 2 additions and 3 deletions.

... ...
@@ -35,8 +35,7 @@ set -g status-keys vi
35 35
 set -g status-fg white
36 36
 set -g status-bg colour235
37 37
 set -g status-left-length 10
38
-#set -g status-left "#[fg=green]pane #P/#{window_panes}#[default]"
39
-set -g status-left "#[fg=green]#([ #{window_panes} -gt 1 ] && echo pane #P/#{window_panes})#[default]"
38
+set -g status-left "#[fg=green]#{?#{!=:#{window_panes},1},pane #P/#{window_panes},}#[default]"
40 39
 set -g status-justify centre
41 40
 set -g status-right '#[fg=green]%m/%d %H:%M#[default]'
42 41
 setw -g mode-keys vi
... ...
@@ -44,7 +43,7 @@ setw -g automatic-rename off
44 43
 setw -g aggressive-resize
45 44
 set -g allow-rename on
46 45
 #setw -g window-status-current-format '#[fg=yellow]#I:#F:#T:.../#{b:pane_current_path}#[default]'
47
-setw -g window-status-current-format '#([ #{session_windows} -gt 1 ] && echo #I:#W:)#[fg=yellow]#{?window_zoomed_flag,Z:,}#{s\/home/dblume\~\:pane_current_path}#[default]'
46
+setw -g window-status-current-format '#{?#{!=:#{session_windows},1},#I:#W:,}#[fg=yellow]#{?window_zoomed_flag,Z:,}#{s\/home/dblume\~\:pane_current_path}#[default]'
48 47
 setw -g window-status-format '#[fg=colour241]#I:#W#[default]'
49 48
 
50 49
 # prefix, C-Arrow doesn't work from PuTTY. Needs TERM to be xterm
51 50