diff options
| author | 2026-04-17 10:53:49 +0100 | |
|---|---|---|
| committer | 2026-04-17 10:53:49 +0100 | |
| commit | 669e53e05638c493e299ec20e99214165897abae (patch) | |
| tree | d7433d3cd6e7f9ddb18dc2afd2daf485359b643d | |
| parent | 482c3c5a474d401b352a7d78035b2df5d525f31c (diff) | |
| download | dotfiles-669e53e05638c493e299ec20e99214165897abae.tar.gz dotfiles-669e53e05638c493e299ec20e99214165897abae.tar.bz2 dotfiles-669e53e05638c493e299ec20e99214165897abae.zip | |
fix: drop tab number prefix from zellij tab names
The number prefix was redundant with zellij's compact bar which
already shows tab numbers. Worse, inactive tabs showed stale
numbers after tab closes since each shell can only update its own
tab name on prompt. Now tabs show just dir or dir:cmd.
| -rw-r--r-- | home/.config/zsh/.zshrc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc index 22f70d6..bc82f3d 100644 --- a/home/.config/zsh/.zshrc +++ b/home/.config/zsh/.zshrc @@ -146,9 +146,8 @@ fi # ── Zellij tab naming (dir:cmd like tmux) ──────────────────────────────────── if [[ -n "$ZELLIJ" ]]; then _zellij_dir() { [[ "$PWD" == "$HOME" ]] && echo '~' || echo "${PWD##*/}"; } - _zellij_tab_idx() { echo $(( $(zellij action current-tab-info 2>/dev/null | grep -oP 'position: \K\d+') + 1 )); } - _zellij_tab_precmd() { zellij action rename-tab "$(_zellij_tab_idx):$(_zellij_dir)" 2>/dev/null; } - _zellij_tab_preexec() { zellij action rename-tab "$(_zellij_tab_idx):$(_zellij_dir):${1%% *}" 2>/dev/null; } + _zellij_tab_precmd() { zellij action rename-tab "$(_zellij_dir)" 2>/dev/null; } + _zellij_tab_preexec() { zellij action rename-tab "$(_zellij_dir):${1%% *}" 2>/dev/null; } add-zsh-hook precmd _zellij_tab_precmd add-zsh-hook preexec _zellij_tab_preexec fi |
