diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index e7cb48d..d962b0e 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -174,3 +174,10 @@ Branch: feature/rust-toolchain (off develop). rustup official script, both OSes, - [x] bash/bashrc-linux, bash/bashrc-osx, zsh/zshrc-osx: source `~/.cargo/env` when present (PATH, dedup inside) - [x] README (step, packages lines, table), CHANGELOG Unreleased, CLAUDE.md layout line - [x] shellcheck + bash -n + stub harness (fresh HOME: install path, re-run path); commit on the branch, no finish without signal + +## Feature — SSH login enters tmux before dtach-router (2026-10-15) +Branch: feature/tmux-before-router (off develop). User always runs tmux now, so the router +menu at plain-SSH login had to be quit once, then reopened inside tmux. Approved in chat: +shared session `main` (`new-session -A`), VS Code Remote-SSH excluded, all three rc files. +- [x] bash/bashrc-linux, bash/bashrc-osx, zsh/zshrc-osx: interactive + SSH + not in tmux + not vscode → `exec tmux new-session -A -s main`, just before the router line +- [x] shellcheck + bash -n + guard harness (env combos, tmux stubbed); zsh absent here, zsh block untested diff --git a/bash/bashrc-linux b/bash/bashrc-linux index 60c8809..4cdc55a 100644 --- a/bash/bashrc-linux +++ b/bash/bashrc-linux @@ -163,6 +163,17 @@ _repo_complete() { complete -F _repo_complete repo case $- in *i*) command -v repo-sync >/dev/null && (repo-sync refresh --quiet >/dev/null 2>&1 &) ;; esac +# SSH interactif hors tmux (et hors terminal VS Code Remote-SSH) : entrer dans tmux, +# session partagee "main" (rattachee si elle existe). Le shell lance dans tmux relit ce +# fichier et ouvre le menu dtach ci-dessous ; quitter tmux ferme la connexion (exec). +case $- in *i*) + if [ -n "${SSH_CONNECTION:-}" ] && [ -z "${TMUX:-}" ] \ + && [ "${TERM_PROGRAM:-}" != vscode ] && command -v tmux >/dev/null; then + exec tmux new-session -A -s main + fi + ;; +esac + # Au demarrage d'un shell interactif, proposer de reprendre une session dtach existante # (silencieux si aucune). Place ici plutot que dans ~/.profile car les terminaux VS Code # Remote-SSH sont non-login et ne lisent pas ~/.profile ; ~/.bashrc, lui, est toujours lu. diff --git a/bash/bashrc-osx b/bash/bashrc-osx index 6e38d42..3cbf838 100644 --- a/bash/bashrc-osx +++ b/bash/bashrc-osx @@ -173,6 +173,17 @@ _repo_complete() { complete -F _repo_complete repo case $- in *i*) command -v repo-sync >/dev/null && (repo-sync refresh --quiet >/dev/null 2>&1 &) ;; esac +# SSH interactif hors tmux (et hors terminal VS Code Remote-SSH) : entrer dans tmux, +# session partagee "main" (rattachee si elle existe). Le shell lance dans tmux relit ce +# fichier et ouvre le menu dtach ci-dessous ; quitter tmux ferme la connexion (exec). +case $- in *i*) + if [ -n "${SSH_CONNECTION:-}" ] && [ -z "${TMUX:-}" ] \ + && [ "${TERM_PROGRAM:-}" != vscode ] && command -v tmux >/dev/null; then + exec tmux new-session -A -s main + fi + ;; +esac + # Au demarrage d'un shell interactif, proposer de reprendre une session dtach existante # (silencieux si aucune). Place ici plutot que dans ~/.profile car les terminaux VS Code # Remote-SSH sont non-login et ne lisent pas ~/.profile ; ~/.bashrc, lui, est toujours lu. diff --git a/zsh/zshrc-osx b/zsh/zshrc-osx index 177e266..7bb290e 100644 --- a/zsh/zshrc-osx +++ b/zsh/zshrc-osx @@ -94,6 +94,17 @@ compdef _repo repo # Reglages propres a cette machine (non versionnes). [ -f "$HOME/.zshrc.local" ] && source "$HOME/.zshrc.local" +# SSH interactif hors tmux (et hors terminal VS Code Remote-SSH) : entrer dans tmux, +# session partagee "main" (rattachee si elle existe). Le shell lance dans tmux relit ce +# fichier et ouvre le menu dtach ci-dessous ; quitter tmux ferme la connexion (exec). +case $- in *i*) + if [ -n "${SSH_CONNECTION:-}" ] && [ -z "${TMUX:-}" ] \ + && [ "${TERM_PROGRAM:-}" != vscode ] && command -v tmux >/dev/null; then + exec tmux new-session -A -s main + fi + ;; +esac + # Au demarrage d'un shell interactif, proposer de reprendre une session dtach existante # (silencieux si aucune). case $- in *i*) [ -x "$HOME/.local/bin/dtach-router" ] && . "$HOME/.local/bin/dtach-router" ;; esac