From 409ee7a9f7ee8c500e2cd5b55a36aa62a7182ba6 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 18 Sep 2021 11:25:09 +0300 Subject: [PATCH] Autocreate tmux sessions --- zsh/.zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 7284b49..36c6de1 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -90,7 +90,8 @@ f() { alias ssh="TERM=xterm ssh" alias sshnm="ssh -S none" ssht() { - ssh -C -t $1 tmux attach -t0 + local t="-t 0" + TERM=xterm ssh -C -t $1 "tmux has-session $t && tmux attach-session $t || tmux new-session $t" } autoload -U zsh-mime-setup ; zsh-mime-setup -- 2.44.0