Add zsh alias / function for ssh + tmux

This commit is contained in:
2018-11-01 14:41:45 +01:00
parent fb8a61d83c
commit 18b7b45f17
+20
View File
@@ -153,6 +153,26 @@ function sortimages () {
esac 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 ### Alias configuration
if [[ $(uname) = "Linux" ]]; then if [[ $(uname) = "Linux" ]]; then