Mail Archives: cygwin/2015/03/25/12:05:28
--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--
- Raw text -