From: Sergey Matveev Date: Sat, 18 Sep 2021 08:25:09 +0000 (+0300) Subject: Autocreate tmux sessions X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=409ee7a9f7ee8c500e2cd5b55a36aa62a7182ba6 Autocreate tmux sessions --- 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