Use a better SSH screen launcher.

This commit is contained in:
Scott Wallace 2018-07-10 16:03:41 +01:00
parent 431b9e4899
commit e44adbb0b6
3 changed files with 12 additions and 1 deletions

View file

@ -127,7 +127,7 @@ if ! alias ll >/dev/null 2>&1; then function ll() { ls -l ${@}; } && export -f l
[[ -x $(which gsort 2>/dev/null) ]] && function sort() { gsort ${@}; } && export -f sort [[ -x $(which gsort 2>/dev/null) ]] && function sort() { gsort ${@}; } && export -f sort
[[ -x /bin/ps && -x $(which pstree 2>/dev/null) ]] && function ps() { if [[ ${1} =~ 'f' ]]; then pstree; else /bin/ps ${@}; fi } [[ -x /bin/ps && -x $(which pstree 2>/dev/null) ]] && function ps() { if [[ ${1} =~ 'f' ]]; then pstree; else /bin/ps ${@}; fi }
[[ -x $(which tree 2>/dev/null) ]] && alias tree="tree -AQh --du" [[ -x $(which tree 2>/dev/null) ]] && alias tree="tree -AQh --du"
function ssh() { $(which ssh) -axt ${@} "screen -xRRAUO 2>/dev/null || bash"; tput reset; } && export -f ssh alias _ssh="ssh -o RemoteCommand=none"
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------

8
.ssh/config Normal file
View file

@ -0,0 +1,8 @@
Include config.d/*
Host *
ServerAliveInterval 120
ServerAliveCountMax 3
IdentitiesOnly yes
ForwardAgent yes

3
.ssh/config.d/screen Normal file
View file

@ -0,0 +1,3 @@
Match exec "test ${SHLVL} -le 2"
RequestTTY yes
RemoteCommand screen -xRRAUO 2>/dev/null || bash