diff --git a/zsh/zshrc b/zsh/zshrc index 0a5f742..0891179 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -153,6 +153,26 @@ function sortimages () { esac } + +read -r -d '' REMOTE_CMD << EOF +if [ \$(command -v module 2> /dev/null | wc -l) -gt 0 ]; then + module load tmux +fi + +if [ \$(lsof -U 2> /dev/null | grep ^tmux | wc -l) -gt 0 ]; then + tmux a +else + tmux +fi +EOF + +function st () { + ssh -t $@ ${REMOTE_CMD} +} + +compdef st=ssh + + ### Alias configuration if [[ $(uname) = "Linux" ]]; then