From 6e2d153f675a1f498fcd06d03749d9a2c1a9bafd Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 17 Apr 2026 10:53:49 +0100 Subject: fix: restore dynamic tab number prefix The compact bar does not show tab numbers on its own, so the prefix is needed. The index is queried dynamically via current-tab-info on each prompt. Inactive tabs may briefly show a stale number after a tab close but correct on focus. --- home/.config/zsh/.zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc index bc82f3d..22f70d6 100644 --- a/home/.config/zsh/.zshrc +++ b/home/.config/zsh/.zshrc @@ -146,8 +146,9 @@ fi # ── Zellij tab naming (dir:cmd like tmux) ──────────────────────────────────── if [[ -n "$ZELLIJ" ]]; then _zellij_dir() { [[ "$PWD" == "$HOME" ]] && echo '~' || echo "${PWD##*/}"; } - _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; } + _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; } add-zsh-hook precmd _zellij_tab_precmd add-zsh-hook preexec _zellij_tab_preexec fi -- cgit v1.2.3-70-g09d2