File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -279,11 +279,14 @@ case "$_display_cwd" in
279279 " $HOME " /* ) _display_cwd=" ~${_display_cwd# " $HOME " } " ;;
280280 " $HOME " ) _display_cwd=" ~" ;;
281281esac
282- # Session label: tmux window name if available, otherwise omit .
282+ # Session label: multiplexer window/tab name if available.
283283_session_label=" "
284284if [ -n " ${TMUX:- } " ]; then
285- _w=" $( tmux display-message -p ' #W' 2> /dev/null || true) "
286- [ -n " $_w " ] && _session_label=" $_w "
285+ _session_label=" $( tmux display-message -p ' #W' 2> /dev/null || true) "
286+ elif [ -n " ${KITTY_WINDOW_ID:- } " ]; then
287+ _session_label=" $( kitty @ get-text --match " id:${KITTY_WINDOW_ID} " 2> /dev/null | head -c 0 ; kitty @ ls 2> /dev/null | jq -r --arg id " $KITTY_WINDOW_ID " ' [.[].tabs[].windows[] | select(.id == ($id | tonumber))][0].title // empty' 2> /dev/null || true) "
288+ elif [ -n " ${WEZTERM_PANE:- } " ]; then
289+ _session_label=" $( wezterm cli list --format json 2> /dev/null | jq -r --arg p " $WEZTERM_PANE " ' .[] | select(.pane_id == ($p | tonumber)) | .title // empty' 2> /dev/null || true) "
287290fi
288291
289292_render_header () {
You can’t perform that action at this time.
0 commit comments