Add an automatic tmux session when using ssh

This commit is contained in:
2026-06-02 08:22:22 -05:00
parent ac57cfa319
commit 11202d06d9
+5 -1
View File
@@ -21,7 +21,6 @@ export PATH="$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:
# Nvm # Nvm
source /etc/profile.d/nvm.sh source /etc/profile.d/nvm.sh
# Auto-switch Node version when entering a directory with .nvmrc # Auto-switch Node version when entering a directory with .nvmrc
_nvm_auto_use() { _nvm_auto_use() {
if [[ -f .nvmrc ]]; then if [[ -f .nvmrc ]]; then
@@ -30,6 +29,11 @@ _nvm_auto_use() {
} }
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_nvm_auto_use" export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_nvm_auto_use"
# Auto-start or attach tmux for SSH interactive shells
if [[ -n "$SSH_CONNECTION" && -z "$TMUX" && $- == *i* ]]; then
exec tmux new-session -A -s main
fi
# Zoxide # Zoxide
eval "$(zoxide init bash)" eval "$(zoxide init bash)"