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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=iMyucAuw+ATV5I/QYUDkV9hMJ8dhhWucA5zOwerg2X5nsTvNfoxEB PvqwMHConHyoCdhSfE6FniwStVTXIJfthnePtNTfdkvND3NJVCUBnSnyYr/zoT64 mxSrobvu/sm+Uyqewsxx8MYQLA2v4Mz7Hhaz94RD1oSSX+zNH/XYXw= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=LXEApp2uTmkp0SXib9rAFBncOpw=; b=VD18Z+Mh84fOrdWrx1pWRaXAI+lF vRmxhFvspZ7GheHAUy6V0EC/w1DYoi/R7g4OuQtUAQfiYmWM0aeprV+jN9Fj+se1 aeg21jMyhz54PnGRcxGaazUvIIfUijjSR82VDPpUALZPJbdfiBupLylBIGEltn6k 0EUcJ6lE5vFEcAA= 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=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Wed, 25 Mar 2015 17:05:04 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: X server sets VMIN? (was Re: Under /bin/script, characters get printed in four-character chunks) Message-ID: <20150325160504.GE3017@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <0B1779D1-F99A-4B3A-87FB-50AE581FD1B7 AT Denis-Excoffier DOT org> <20150228121357 DOT GS11124 AT calimero DOT vinschen DOT de> <20150228153035 DOT GD11124 AT calimero DOT vinschen DOT de> <20150324195339 DOT GA32703 AT calimero DOT vinschen DOT de> <641C04A3-5059-48A5-830D-4B095935366B AT Denis-Excoffier DOT org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vDpQvD79HZx/5O2q" Content-Disposition: inline In-Reply-To: <641C04A3-5059-48A5-830D-4B095935366B@Denis-Excoffier.org> User-Agent: Mutt/1.5.23 (2014-03-12) --vDpQvD79HZx/5O2q Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mar 25 16:26, Denis Excoffier wrote: > On 2015-03-24 20:53, Corinna Vinschen wrote: > > - However, if you start xterm from the X server tray icon and then > > call `stty -a' in it, min is set to 4 and script will misbehave. > > If you call `stty min 1' before calling script, script will work > > as expected again. > >=20 > > So, why does the X server (or whatever controls starting applications > > from the X server tray icon) set VMIN to 4? > >=20 >=20 > It seems that this has something to do with tcsh (and not with XWin). > If you arrange your environment in order that the xterm launches /bin/bash > (instead of tcsh), you get min=3D0 under 'stty -a' and /bin/script behaves > as expected. If afterwards, in such an xterm, you run '/bin/csh -f', you = get > min=3D4. >=20 > Consider the following: >=20 > diff -uNr tcsh-6.18.01-original/ed.init.c tcsh-6.18.01-patched/ed.init.c > --- tcsh-6.18.01-original/ed.init.c 2006-08-24 22:56:08.000000000 +0200 > +++ tcsh-6.18.01-patched/ed.init.c 2015-03-25 15:56:33.000000000 +0100 > @@ -65,7 +65,7 @@ > (uc)CDSWTCH, (uc)CERASE2, (uc)CSTART, (uc)CSTOP, > (uc)CWERASE, (uc)CSUSP, (uc)CDSUSP, (uc)CREPRINT, > (uc)CDISCARD, (uc)CLNEXT, (uc)CSTATUS, (uc)CPAGE, > - (uc)CPGOFF, (uc)CKILL2, (uc)CBRK, (uc)CMIN, > + (uc)CPGOFF, (uc)CKILL2, (uc)CBRK, (uc)1, > (uc)CTIME > }, > { >=20 > In the original code, CMIN is set to CEOF and CEOF is set to Control-D, h= ence > min=3D4. With the patch above, all seems to go well. But this does not > explain why the min=3D4 is not permanent. Thanks for looking into that. I'm not sure either why this doesn't occur all the time, but the culprit seems to be this snippet in ed.term.h: #ifndef CMIN # define CMIN CEOF #endif /* CMIN */ The default value for CEOF is '\4'. And no header on Cygwin defines CMIN, so this looks like two bugs in one (buy one, get one free). Per `git blame' this code in tcsh is from 1991, so maybe we have two 20th century bugs here. I'll ask the tcsh maintainer and add a definition for CMIN to 1 (as on Linux) to the headers for the next Cygwin version. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --vDpQvD79HZx/5O2q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVEtywAAoJEPU2Bp2uRE+gpL4QAJKAaHHmtBYqiRmHCfgW1K+L +GvnXMc4pWW0oY4oA5hHFHXv9MKY+nA2+EVoWsI3pq/zaJ6WzT2rpjZVWtYcqd7U VHeX36MtbvrFl8GU2G+d0lUyHr/kjDfDD1uIMFDJ7rOL4hhMpegfpBVEzoOa8BFf Fdytumb82ovDN8XXDGudcdU9WktKkeVfSuqrRvA1lmzJFi0qCXOa3VUHc/goWQZr En654PvbhawPk59VXXzpX7iGeOddjb3me1UiIvvt8MuAyOfl5Cb9588qrtesSpnS s2KVPXHno7pxUGuAP9iQqrF+feCg/l567RaoE2bAqTDAlFTx8TiP1rCWFW6NId5j q/i9FwQDWnUsbkbUv3evpknHmhWrYLfbe2hioSRFjrJDSzF1gH/JpFQ+A5lQzOmc tGxBlIRWd+jyJIR4gRPznECP3+xHBk0yc/SUzbBSA0GD6ig2Z1mH3astzI0XCXeE Hi0QPhedmF+tvVIvL1tbQDIoZ65agPBPBH7x0Az5hOaWF1tz0wcd6fDVkbtpMn6m /j5czgUFfotQbqsU7JA1zJSkml/QhVauv01Bh5aZR4F21XvskkyNhdMbMEhtjO2b IVfP6Xjma9Vfg136q4XkhK6oh3PDNJ1scVaJ1XgVuW+AX+VBcSnGWP2BxbaAw7Tf qpeqbpOKomZKT7zxQNsL =iNpi -----END PGP SIGNATURE----- --vDpQvD79HZx/5O2q--