Skip to content

Commit 7e42297

Browse files
committed
fix(zsh): move homebrew PATH to .zshenv for non-interactive shells
tmux-track-session runs via SSH as a non-interactive command, which only sources .zshenv (not .zshrc). Without /opt/homebrew/bin in PATH, the script silently fails to find tmux and falls through to creating a new auto-numbered session on every reconnect instead of reattaching.
1 parent 02ce62d commit 7e42297

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.zshenv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export LC_ALL="en_US.UTF-8"
2020
# Use terminal ANSI colors so bat inherits WezTerm's Everforest palette
2121
export BAT_THEME="ansi"
2222

23-
export PATH="$HOME/.local/bin:$PATH"
23+
export PATH="/opt/homebrew/bin:$HOME/.local/bin:$PATH"
2424
export FZF_DEFAULT_COMMAND="fzf-files --label"
2525
export FZF_DEFAULT_OPTS="--style=minimal --ansi --tabstop=1 --delimiter=\\t --nth=-1 --accept-nth=-1 --preview='if [ -d {-1} ]; then ls -1 --color=always {-1}; else bat --color=always --style=numbers --line-range=:500 {-1}; fi' --bind=ctrl-d:preview-half-page-down,ctrl-u:preview-half-page-up"
2626

.zshrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ENABLE_CORRECTION="true"
22

33
# Start Tmux
4-
export PATH="/opt/homebrew/bin:$PATH"
4+
# /opt/homebrew/bin is added in .zshenv (needed by non-interactive shells too)
55
# tmuxを自動起動し、tmux終了時にシェルも終了する
66
[[ -z "$TMUX" ]] && tmux -u && exit
77

0 commit comments

Comments
 (0)