#! /bin/sh

echo lsh, test 10

if [ -z "$srcdir" ] ; then
  srcdir=`pwd`
fi

. $srcdir/functions.sh

# Traditional BSD pty:s are currentlynot supported.
[ -c /dev/ptmx ] || test_skip

# There a race condition when signalling EOF on a pty pair.
# Work around it by sleeping a few seconds before sending CHANNEL_EOF.
# Also use lshg rather than lsh, to get more predictable timing.

LSHG_FLAGS="$LSHG_FLAGS -t"

spawn_lshd && spawn_lsh --start-gateway \
  && sleep 10 | exec_lshg "tty" && test_success

test_done
