aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--home/.config/zsh/.zshrc9
1 files changed, 3 insertions, 6 deletions
diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc
index 7cb2484..746c5b0 100644
--- a/home/.config/zsh/.zshrc
+++ b/home/.config/zsh/.zshrc
@@ -145,12 +145,9 @@ fi
# ── Zellij tab naming (dir:cmd like tmux) ────────────────────────────────────
if [[ -n "$ZELLIJ" ]]; then
- _zellij_tab_precmd() {
- zellij action rename-tab "${PWD##*/}" 2>/dev/null
- }
- _zellij_tab_preexec() {
- zellij action rename-tab "${PWD##*/}:${1%% *}" 2>/dev/null
- }
+ _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; }
add-zsh-hook precmd _zellij_tab_precmd
add-zsh-hook preexec _zellij_tab_preexec
fi