This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stty icrnl


For the record, this is what I ended up with:

-----------8<-----------
#!/bin/dash
cleanup () {
    /bin/kill $cpid
    exec 6<&- 6>&-
    /bin/stty $stty
}
if [ $# -ne 2 ] ; then
    echo "Usage:  ${0##*/} <TTY> <Baud>"
    exit 1
fi
tty=$1; shift
baud=$1; shift
stty=$(/bin/stty -g)
/bin/stty -icanon -echo
/bin/stty -F $tty $baud
exec 6<> $tty
0<&6 stdbuf -i0 -o0 -e0 tr "\r" "\n" &
cpid=$?
trap cleanup HUP KILL INT
1>&6 stdbuf -i0 -o0 -e0 tr "\n\177" "\r\b"
cleanup
----------->8-----------

The only thing missing is to emulate the effect of the "stty echoe" setting,
that is outputting erase as backspace - space - backspace rather than just a
single backspace.


Regards,
Achim


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]