zsh/rc/auto_screen.rc

16 lines
391 B
Plaintext

if [ "x$SSH_CLIENT" != "x" ]; then
if [ "$TERM" != "screen" -a "$TERM" != "screen.xterm-256color" ]; then
SOCK="$HOME/.zsh/ssh_auth_sock"
if [ ! -z "$SSH_AUTH_SOCK" -a "$SSH_AUTH_SOCK" != "$SOCK" ]; then
rm -f "$SOCK"
ln -sf "$SSH_AUTH_SOCK" "$SOCK"
export SSH_AUTH_SOCK="$SOCK"
fi
if [ x"$0" = x"-zsh" ];then
screen -xR && logout
else
exec screen -xR
fi
fi
fi