Add zsh alias / function for ssh + tmux
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user