Message-Id: <199611192354.AAA14354@ion.lpr.e-technik.tu-muenchen.de>
Subject: Re: less 2>/dev/null doesn't set raw mode (solution)
To: 5512@bugs.debian.org
Date: Wed, 20 Nov 1996 00:54:36 +0100 (MET)
In-Reply-To: <199611192014.VAA02703@ion.lpr.e-technik.tu-muenchen.de>
X-Mailer: ELM [version 2.4 PL24 ME7a]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
My mail:
>
> Package: less
> Version: 321-1
>
> When redirecting stderr, less can't set the tty in raw mode: command
> characters typed will be echoed and the commands will not executed until
> typing CR.
>
> Example:
>
> less /usr/doc/debian/bug-reporting.txt 2>/dev/null
>
> This is particularly nasty if less is exec'd from a command whose stderr
> is redirected.
I took a look to the sources and found that _all_ ioctl's and
tc[gs]ettatr's in screen.c are made on stderr. Don't know if there's any
reason.
The solution to my problem above was the following patch. To get it
linked I had to remove -ltermcap in Makefile.
Regards
Herbert.
P.S.: I changed _only_ the two tc[gs]ettatr's in raw_mode() that are
used for i386. Perhaps there are other places to patch for the other
architectures.
--- less-321/screen.c.orig Tue Jul 23 13:50:31 1996
+++ less-321/screen.c Tue Nov 19 21:25:31 1996
@@ -258,7 +258,7 @@
/*
* Get terminal modes.
*/
- tcgetattr(2, &s);
+ tcgetattr(1, &s);
/*
* Save modes and set certain variables dependent on modes.
@@ -409,7 +409,7 @@
*/
s = save_term;
}
- tcsetattr(2, TCSADRAIN, &s);
+ tcsetattr(1, TCSADRAIN, &s);
#if MUST_SET_LINE_DISCIPLINE
if (!on)
{
--- less-321/Makefile.orig Tue Jul 23 14:02:25 1996
+++ less-321/Makefile Tue Nov 19 21:26:49 1996
@@ -15,7 +15,7 @@
LDFLAGS =
O=o
-LIBS = -lncurses -lcurses -ltermcap
+LIBS = -lncurses -lcurses
prefix = /usr
exec_prefix = ${prefix}
Reply sent to "Darren/Torin/Who Ever..." <torin@daft.com>:
You have taken responsibility.
"Darren/Torin/Who Ever..." <torin@daft.com>
Sorry, this message was lost when this bug report was restored from a backup.
Done: "Darren/Torin/Who Ever..." <torin@daft.com>;
Maintainer for less is
Darren Stalder <torin@daft.com>.
Message received at 5512-done@bugs.debian.org:
Received: (at 5512-done) by bugs.debian.org; 23 Jun 1997 10:56:46 +0000
Received: (qmail 11333 invoked from network); 23 Jun 1997 10:56:46 -0000
Received: from perv.daft.com (204.122.30.2)
by master.debian.org with SMTP; 23 Jun 1997 10:56:44 -0000
Received: (from torin@localhost) by perv.daft.com (8.7.6/8.6.12) id DAA08076; Mon, 23 Jun 1997 03:55:31 -0700
To: 5512-done@bugs.debian.org
Subject: applied supplied patch to less, bug fixed
Organization: Discordian Alliance For Teaching
X-Web: http://www.daft.com/~torin/
X-Discordia: Hail Eris - keep up OM
X-Address: 2608 Second Avenue, #282
Seattle, WA 98121-1212
USA
X-Phone-Fax: +1-800-921-4996/+1-206-727-5084
X-Face: @E5e"O[(T!v&8{hyJLrPQnww-"r;+642m"aAJi~H2t#QCQj)UkGNh4FL,;\sc{e[]|MXbF|
*A+F|~XOY2JP'Bvk_.Gd{W0$/y5i<"X0y4%0S5GA6S\&/$P@Dgcr~cT1p6,op6N}#{A\0>9CaWy]a)
].L1j39flY?{z;KeP
From: "Darren/Torin/Who Ever..." <torin@daft.com>
Date: 23 Jun 1997 03:55:29 -0700
Message-ID: <87bu4xoafe.fsf@perv.daft.com>
Lines: 24
X-Mailer: Gnus v5.4.59/XEmacs 19.15
-----BEGIN PGP SIGNED MESSAGE-----
* Applied patch to screen.c from Herbert Thielen so that less properly
sets raw mode if stderr is redirected to /dev/null. This closes
#5512.
Darren
- --
<torin@daft.com> <http://www.daft.com/~torin> <torin@debian.org> <torin@io.com>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Do you have your clothes on? I probably don't. Take yours off. Feel better. @
@ Sysadmin, webweaver, postmaster for hire. C/Perl/CGI programmer and tutor. @
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQCVAwUBM65WMI4wrq++1Ls5AQE6AwP+LYTLE0vboZu6k9yNsEwWnuD1Kcsm2c9k
V35y8VHqz+3cdrYgzxLk+DanNUldxm5saGtyYmnbQ27Ryznm+OQF0LLmia/AdB/t
NKlpAEM2f2uEQXpxwP53Hj2pAk1umC7rMIuAAJN9Gha18OhU+JB5d5wI2P8xw0Qz
PJ9ADuQOM10=
=pGJr
-----END PGP SIGNATURE-----
Message received at 5512-close@bugs.debian.org:
Received: (at 5512-close) by bugs.debian.org; 23 Jun 1997 09:57:49 +0000
Received: (qmail 10799 invoked from network); 23 Jun 1997 09:57:46 -0000
Received: from perv.daft.com (204.122.30.2)
by master.debian.org with SMTP; 23 Jun 1997 09:57:44 -0000
Received: (from torin@localhost) by perv.daft.com (8.7.6/8.6.12) id CAA07890; Mon, 23 Jun 1997 02:57:19 -0700
To: 5512-close@bugs.debian.org
Subject: applied supplied patch to less, bug fixed
Organization: Discordian Alliance For Teaching
X-Web: http://www.daft.com/~torin/
X-Discordia: Hail Eris - keep up OM
X-Address: 2608 Second Avenue, #282
Seattle, WA 98121-1212
USA
X-Phone-Fax: +1-800-921-4996/+1-206-727-5084
X-Face: @E5e"O[(T!v&8{hyJLrPQnww-"r;+642m"aAJi~H2t#QCQj)UkGNh4FL,;\sc{e[]|MXbF|
*A+F|~XOY2JP'Bvk_.Gd{W0$/y5i<"X0y4%0S5GA6S\&/$P@Dgcr~cT1p6,op6N}#{A\0>9CaWy]a)
].L1j39flY?{z;KeP
From: "Darren/Torin/Who Ever..." <torin@daft.com>
Date: 23 Jun 1997 02:57:18 -0700
Message-ID: <87vi35od4d.fsf@perv.daft.com>
Lines: 22
X-Mailer: Gnus v5.4.59/XEmacs 19.15
-----BEGIN PGP SIGNED MESSAGE-----
* Applied patch to screen.c from Herbert Thielen so that less properly
sets raw mode if stderr is redirected to /dev/null. This closes
#5512.
- --
<torin@daft.com> <http://www.daft.com/~torin> <torin@debian.org> <torin@io.com>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Do you have your clothes on? I probably don't. Take yours off. Feel better. @
@ Sysadmin, webweaver, postmaster for hire. C/Perl/CGI programmer and tutor. @
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQCVAwUBM65Ij44wrq++1Ls5AQFg8wP9GUYtl8qbXfPcfqNVrR/lBFoPAOyNkirM
gPFAfh5Om5US1tV6tE8vi5XoLB4QXYet7+b6//rrC/xEbD1luYSPdN8CWvtoTTrw
u2KM8nyUlHg2vJ+NCmbz5nQ/Xfa1Od8RcXtWOyl5ToH0mrQaPTM3KjDR/YgTQ8ZJ
swY/I8Dwbss=
=ossW
-----END PGP SIGNATURE-----
Notification sent to Herbert Thielen <Herbert.Thielen@lpr.e-technik.tu-muenchen.de>:
Bug acknowledged by developer.
Herbert Thielen <Herbert.Thielen@lpr.e-technik.tu-muenchen.de>
Sorry, this message was lost when this bug report was restored from a backup.