From 86e7005fe27b573e465b484fd6a04ab93855cddb Mon Sep 17 00:00:00 2001 From: afranco Date: Mon, 16 Mar 2026 12:57:23 +0000 Subject: [PATCH] feat(zsh): ssh tmux window name --- .config/zsh/.zshrc | 2 ++ .config/zsh/functions.zsh | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 93a8363..9356d83 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -4,6 +4,8 @@ if [[ -o interactive ]]; then fi fi +bindkey -e + source $ZDOTDIR/setup-history.zsh source $ZDOTDIR/prompts/simple-two-line.zsh source $ZDOTDIR/functions.zsh diff --git a/.config/zsh/functions.zsh b/.config/zsh/functions.zsh index 4291235..54cc0d4 100644 --- a/.config/zsh/functions.zsh +++ b/.config/zsh/functions.zsh @@ -36,9 +36,18 @@ alias nvim_update='nvim --headless "+Lazy! sync" +qa' alias ..="cd .." -function cd() -{ +function cd(){ builtin cd "$@" && ls; } alias bb="brew bundle --file=~/Brewfile" + +function ssh(){ + if [ -n "$TMUX" ]; then + tmux rename-window "$(echo "$@" | awk '{print $NF}' | sed 's/.*@//')" + command ssh "$@" + tmux set-window-option automatic-rename on >/dev/null + else + command ssh "$@" + fi +}