New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issued around tput
#6
Comments
Hi gregor, if I am not wrong system returns zero on successful execution. Would id be OK to write it like this? if ( $^O eq 'MSWin32' || $ENV{TC_ANSI_ESCAPES} || ! $ENV{TERM} || system( "tput -V >/dev/null 2>&1" ) != 0 ) { |
Oh, right :/
I think this should work. -- Let's try a few things:
Yeah, looks good :) Thanks, |
If I use |
On Tue, 10 Sep 2019 22:06:38 -0700, kuerbis wrote:
If I use `system( "tput cuu >/dev/null 2>&1" ) != 0` I could skip the `! $ENV{TERM}`.
Right, should work as well.
Would you recommend to use the `! $ENV{TERM} || system( "tput -V
>/dev/null 2>&1" ) != 0` or to use `system( "tput cuu >/dev/null
2>&1" ) != 0`?
To be honest, I have no real preference …
Thinking a bit …
Maybe the latter is indeed slightly better as it avoids a
comment ("what is this $ENV{TERM} about?"), and I only proposed it
because `tput -V' is a bit weird; so yeah, no objections from my side
:)
Cheers,
gregor
…--
.''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
`-
|
|
On Wed, 11 Sep 2019 21:06:32 -0700, kuerbis wrote:
`! qx(tput cuu 2>/dev/null)` is a little shorter and looks a little simpler then `system( "tput cuu >/dev/null 2>&1" ) != 0`.
If there is something wrong with `! qx(tput cuu 2>/dev/null)` please write a comment else I will use `! qx(tput cuu 2>/dev/null)`.
Agreed, and seems to do the job as well.>
…--
.''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
`-
|
… the undef and empty string. Bugix in line_fold: make colored output work with a single prompt line. Set col_width_plus only once.
Thx! |
On Thu, 12 Sep 2019 14:41:39 +0000, kuerbis wrote:
Closed #6.
Thanks for the fix.
I just uploaded 1.701 to Debian and I'm optimistic that all works out
fine :)
Thanks again,
gregor
…--
.''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
`-
|
Besides the problem with the shell redirection, which I already reported at https://rt.cpan.org/Public/Bug/Display.html?id=130463, there are more problems with the use of
tput
.As https://bugs.debian.org/939939 and the linked log at https://ci.debian.net/data/autopkgtest/testing/amd64/libt/libterm-choose-perl/2922560/log.gz show,
tput
fails if TERM is not set. Interestingly there is a difference betweentput -V
and othertput
calls:This means that the failures don't come from the
tpuz -V
in theif()
but from the actual calls later in the code.When looking at the code in
lib/Term/Choose/Screen.pm
I was a bit confused; is the logic of theif()
in line 37 really how it's meant to be? If I'm reading this correctly, what's happening is (in pseudo-code):Shouldn't this be
or we don't have a working tput
? -- Maybe something like the following might work (untested):Cheers,
gregor, Debian Perl Group
The text was updated successfully, but these errors were encountered: