chore(config): update terminal, tmux, and starship configurations

This commit is contained in:
Prad Nukala committed 2026-10-08 11:29:07 -04:00
1 parent f2802b3cd8
commit ce9886c2e7
10 files changed
+236 -50

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# ~/.config/tmux/tab-label.sh — the non-editor tab label, kitty tab_bar.py's
# rule: the repo the pane's cwd belongs to (dir name if no repo, ~ at home).
# Editors (the open file) are handled in tmux.conf's automatic-rename-format.
# Args: $1 pane_current_path $2 window_id
path=$1 window=$2
if [[ $path == "$HOME" ]]; then
label='~'
else
dir=$path
while [[ -n $dir && ! -e $dir/.git ]]; do dir=${dir%/*}; done
root=${dir:-$path}
label=${root##*/}
fi
printf '%s' "$label"
# tmux runs #() jobs async and only re-checks a window's name on pane output,
# so after a `cd` the tab would keep the old label until the next keystroke.
# Re-arming automatic-rename makes tmux re-check now and pick up this output.
if [[ -n $window && $(tmux display -p -t "$window" '#W' 2>/dev/null) != *"${label:0:26}"* ]]; then
tmux set -w -t "$window" automatic-rename on >/dev/null 2>&1 &
fi