[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] Term::ReadKey in test/run
From: |
Jean Delvare |
Subject: |
Re: [Quilt-dev] Term::ReadKey in test/run |
Date: |
Tue, 6 Sep 2005 13:51:55 +0200 (CEST) |
Hi Andreas,
> Maybe there is another Perl module that's generally available.
I searched for such a module but couldn't find one. The only alternative
seems to be direct ioctl (as seen in perlfaq8) but I don't think we
want to go that way.
> $ENV{COLUMNS} isn't set on many systems, at least as fas as I can see.
> Bash here defines it as a variable, but doesn't export it; tcsh doesn't
> define it at all.
I observed the same here. I have an explicit export in .bach_profile
myself, as I use a few other tools (mp3check...) which use the value of
COLUMNS when available. I guess that others can do the same if they
want/need to.
> Instead of the BEGIN hack, if we don't find a better solution, let's
> hardcode this to 80, or use a command-line option.
I don't see what prevents us from still using $ENV{COLUMNS} where
possible and default to 80 where not. This also acts as a quick
replacement to the command line option you were suggesting, as the user
can do:
COLUMNS=120 make some.test
--- quilt.orig/test/run Thu Feb 10 11:59:24 2005
+++ quilt/test/run Tue Sep 6 11:50:53 2005
@@ -13,7 +13,6 @@
use FileHandle;
use Getopt::Std;
use POSIX qw(isatty setuid);
-use Term::ReadKey;
use vars qw($opt_l $opt_v);
no warnings qw(taint);
@@ -33,7 +32,7 @@
my $prog_line;
my ($tests, $failed) = (0,0);
my $lineno;
-my $width=((GetTerminalSize)[0] >> 1);
+my $width=(($ENV{COLUMNS} || 80) >> 1);
for (;;) {
my $line = <>; $lineno++;
Thanks,
--
Jean Delvare
- [Quilt-dev] Term::ReadKey in test/run, John Vandenberg, 2005/09/06
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/06
- Re: [Quilt-dev] Term::ReadKey in test/run, John Vandenberg, 2005/09/06
- Re: [Quilt-dev] Term::ReadKey in test/run, John Vandenberg, 2005/09/23
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/23
- Re: [Quilt-dev] Term::ReadKey in test/run, Andreas Gruenbacher, 2005/09/23
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/23
- Re: [Quilt-dev] Term::ReadKey in test/run, John Vandenberg, 2005/09/06
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/07
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/09
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/12