# HG changeset patch # User Pascal Bellard # Date 1326538601 -3600 # Node ID bdff68e2cdc7bde5bc538a0d6d32c40c8c1112a3 # Parent 32688e8c97a25ac44d49ef026ade20566155ec1a dropbear/sshx: add screen support diff -r 32688e8c97a2 -r bdff68e2cdc7 dropbear/stuff/sshx --- a/dropbear/stuff/sshx Fri Jan 13 22:30:26 2012 +0100 +++ b/dropbear/stuff/sshx Sat Jan 14 11:56:41 2012 +0100 @@ -4,6 +4,7 @@ { read host type data svr=$(echo $DISPLAY | sed 's/.*:\([0-9]*\).*/\1/') + scr=${DISPLAY/*./.}; [ "$scr" == "$DISPLAY" ] && scr="" n=$((10+($RANDOM % 90))); dpy=localhost:$n remote="" while true; do @@ -17,8 +18,8 @@ done [ -n "$1" ] || set -- "$TERM || xterm" exec dbclient -f -R $((6000+$n)):localhost:$((6000+$svr)) $remote \ - "xauth add $dpy $type $data; export DISPLAY=$dpy; $@" \ - < /dev/null > /dev/null 2>&1 + "xauth add $dpy $type $data; export DISPLAY=$dpy$scr; $@ ; xauth remove $dpy" \ + < /dev/null > /dev/null } case "$DISPLAY" in