X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=cmDPKqB/Rxn3iNDWzsvPkHGrTwyScS++8vS9rsorjAfKxi+wYxrOu iUUPLzyjNtibLUHks/gP4qMxyD5z2yn9D4Q2HPog1DHrQ0vVjoVRioYx4sa3jqa1 C6BoqoYq9ahdqx1PWYIr+4QtvsGJMnKsuZ9znA0y//PTAYkn5YjuNM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; s=default; bh=AWV/MT0TloateYPdWcsbBORnfcY=; b=aUmg0aLkTgd8KUAPu8TWOCTPKs16 3HESGIWoZqWaljAvcADmdiAKhq3YkEJgvlwDz35BH/NKGw5qQ3EtsIh57YcFj9W/ pSvquZYd6gcnOnEdqoGufAApXUzJVh+4EF6CX8PjiRdlngQkX25DHMsdF5QVqWMf 0l8vY5JQ7v8ceoA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_50,FSL_HELO_BARE_IP_2,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy=icrnl, stty, tty, cpid X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: Achim Gratz Subject: Re: stty icrnl Date: Tue, 7 Jun 2016 09:31:34 +0000 (UTC) Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes 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##*/} " 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