add functionality to open more connections

to the same server in split tmux pane with sshs
This commit is contained in:
Jakobus Schürz 2022-09-21 15:51:44 +02:00
parent d1288439f6
commit a41d84d492
3 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,3 @@
[ -e /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
[ -e /usr/share/bash-completion/completions/ssh ] && . /usr/share/bash-completion/completions/ssh
shopt -u hostcomplete && complete -F _ssh sshs
shopt -u hostcomplete && complete -F _ssh sshs setserver

View file

@ -1259,5 +1259,11 @@ gocnfshome() {
cd "${APP_SHARED_HOME}"
}
setserver() {
export sshcon="$@"
if [ -n "${TMUX}" ]; then
tmux set-environment sshcon "$@"
fi
}
#EOF

6
sshs
View file

@ -1,8 +1,10 @@
#!/bin/sh
sshs() {
ENTRY
[ $# -eq 0 ] && { [ "${sshcon:-x}" == "x" ] || set -- "${sshcon}"; }
if [ -n "${TMUX}" ]; then
tmux set-environment sshcon "$@"
fi
local LOGLEVEL="WARN"
# MKTMPCMD='mktemp $(echo ${XDG_RUNTIME_DIR}/bashrc.XXXXXXXX.conf)'
# VIMMKTMPCMD="mktemp ${XDG_RUNTIME_DIR}/vimrc.XXXXXXXX.conf"