zsh/rc/auto_screen.rc

12 lines
293 B
Plaintext
Raw Normal View History

2018-03-16 12:02:58 +01:00
if [ "x$SSH_CLIENT" != "x" ]; then
if [ "$TERM" != "screen" ]; 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
screen -xR && logout
fi
fi