public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@NexGo.DE>
To: cygwin@cygwin.com
Subject: Re: stty icrnl
Date: Tue, 07 Jun 2016 09:31:00 -0000	[thread overview]
Message-ID: <loom.20160607T111215-253@post.gmane.org> (raw)
In-Reply-To: <loom.20160606T170515-528@post.gmane.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

  reply	other threads:[~2016-06-07  9:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 12:05 Achim Gratz
2016-06-06 15:09 ` Achim Gratz
2016-06-07  9:31   ` Achim Gratz [this message]
2016-06-08  0:06 ` Brian Inglis
2016-06-08  5:40   ` Achim Gratz
2016-06-09  3:16     ` Andrey Repin
2016-06-09 18:58       ` Warren Young
2016-06-09 22:08         ` Achim Gratz
2016-06-09 22:31           ` Warren Young
2016-06-10  8:29             ` Achim Gratz
2016-06-10 15:38               ` Achim Gratz
2016-06-13 12:18                 ` Achim Gratz
2016-06-10  8:42           ` Corinna Vinschen
2016-06-10  8:57             ` Helmut Karlowski
2016-06-10 10:00               ` Helmut Karlowski
2016-06-10 14:39               ` Corinna Vinschen
2016-06-10 19:45             ` Achim Gratz
2016-06-09 18:34   ` Warren Young
2016-06-09 22:49     ` John Hein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20160607T111215-253@post.gmane.org \
    --to=stromeko@nexgo.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).