Skip to content

Commit fc1457f

Browse files
committed
[tmux] Use custom icon when in Ghostty
1 parent e2b5a5b commit fc1457f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.config/tmux/tmux.conf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,19 @@ set-option -g @catppuccin_pane_border_status "off"
113113
set-option -g @online_icon "ok"
114114
set-option -g @offline_icon "nok"
115115

116+
# Detect terminal emulator by walking up the process tree
117+
run-shell 'tmux setenv -g TERMINAL_EMULATOR "$(pid=$(pgrep -o -x tmux); while [ $pid -gt 1 ]; do cmd=$(ps -o comm= -p $pid); ppid=$(ps -o ppid= -p $pid | tr -d " "); if echo "$cmd" | grep -q "MacOS/"; then basename "$cmd"; exit 0; fi; pid=$ppid; done)"'
118+
# Use TERMINAL_EMULATOR to set conditional values
119+
%if "#{==:#{TERMINAL_EMULATOR},ghostty}"
120+
set-option -g @terminal_icon "👻"
121+
%else
122+
set-option -g @terminal_icon ""
123+
%endif
124+
116125
# status left look and feel
117126
set-option -g status-left-length 100
118127
set-option -g status-left ""
119-
set-option -ga status-left "#{?client_prefix,#{#[bg=#{@thm_red},fg=#{@thm_bg},bold] #S },#{#[fg=#{@thm_green}] #S }}"
128+
set-option -ga status-left "#{?client_prefix,#{#[bg=#{@thm_red},fg=#{@thm_bg},bold] #{@terminal_icon} #S },#{#[fg=#{@thm_green}] #{@terminal_icon} #S }}"
120129

121130
set-option -g @cpu_low_fg_color "#[fg=#{@thm_green}]"
122131
set-option -g @cpu_medium_fg_color "#[fg=#{@thm_yellow}]"

0 commit comments

Comments
 (0)