From 0f199680c02f7c49e9cac319ee169fc1e537452e Mon Sep 17 00:00:00 2001 From: long-910 <7323488+long-910@users.noreply.github.com> Date: Sun, 1 Mar 2026 21:27:20 +0900 Subject: [PATCH] feat: tmux auto-attach to 'tmux-dev' session on shell start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新しいインタラクティブシェル起動時に tmux セッション 'tmux-dev' へ 自動アタッチする。セッションが存在しない場合は新規作成する。 tmux 未インストール・既に tmux 内・非インタラクティブ環境では無効。 Co-Authored-By: Claude Sonnet 4.6 --- dotfiles/.zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index a906ec2..ee65ce5 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -162,3 +162,8 @@ if [ -d "$HOME/.zshrc.d" ]; then fi # Load machine-specific / secret config (never committed) [ -f "$HOME/.zshrc.local" ] && . "$HOME/.zshrc.local" + +# tmux auto-attach: attach to 'tmux-dev' session (create if missing) +if command -v tmux &>/dev/null && [ -z "$TMUX" ] && [[ $- == *i* ]]; then + tmux new-session -As tmux-dev +fi