This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: stty icrnl
- From: Achim Gratz <Stromeko at NexGo dot DE>
- To: cygwin at cygwin dot com
- Date: Tue, 7 Jun 2016 09:31:34 +0000 (UTC)
- Subject: Re: stty icrnl
- Authentication-results: sourceware.org; auth=none
- References: <loom dot 20160606T135902-517 at post dot gmane dot org> <loom dot 20160606T170515-528 at post dot gmane dot org>
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