Skip Menu |

This queue is for tickets about the Term-ProgressSpinner CPAN distribution.

Report information
The Basics
Id: 133522
Status: open
Priority: 0/
Queue: Term-ProgressSpinner

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



Subject: patch for hanging on Windows
Version 0.02 hangs on Windows as stty is not available. Also ANSI sequences are not available on Windows, so use emulation module. -- Alexandr Ciornii, http://chorny.net
Subject: Makefile.PL.patch
--- Makefile.PL.dist 2020-10-11 17:41:12.000000000 +0300 +++ Makefile.PL 2020-10-13 00:54:56.437500000 +0300 @@ -15,17 +15,20 @@ }, TEST_REQUIRES => { 'Test::More' => '0', - 'IO::Handle' => '0', - 'Term::ANSIColor' => '0', }, PREREQ_PM => { - #'ABC' => '1.6', - #'Foo::Bar::Module' => '5.0401', + 'Term::ANSIColor' => '0', + 'IO::Handle' => '0', }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Term-ProgressSpinner-*' }, ); +if ($^O eq 'MSWin32') { + $WriteMakefileArgs{PREREQ_PM}{'Win32::Console'} = 0; + $WriteMakefileArgs{PREREQ_PM}{'Win32::Console::ANSI'} = '1.11'; +} + # Compatibility with old versions of ExtUtils::MakeMaker unless (eval { ExtUtils::MakeMaker->VERSION('6.64'); 1 }) { my $test_requires = delete $WriteMakefileArgs{TEST_REQUIRES} || {};
Subject: ProgressSpinner.pm.patch
--- ProgressSpinner.pm.dist 2020-10-12 14:43:23.000000000 +0300 +++ ProgressSpinner.pm 2020-10-12 21:14:11.595605800 +0300 @@ -1,6 +1,9 @@ package Term::ProgressSpinner; our $VERSION = '0.02'; use 5.006; use strict; use warnings; +if ($^O eq 'MSWin32') { + eval "use Win32::Console::ANSI;use Win32::Console;"; +} use IO::Handle; use Term::ANSIColor; use Time::HiRes qw//; our (%SPINNERS, %PROGRESS, %VALIDATE); @@ -470,6 +473,11 @@ #TODO refactor everything to make context aware sub savepos { my $self = shift; + if ($^O eq 'MSWin32') { + my $CONSOLE = Win32::Console->new(Win32::Console::STD_OUTPUT_HANDLE()); + my ($x) = $CONSOLE->Cursor(); + $self->{savepos} = $x; + } else { my $x=''; system "stty cbreak </dev/tty >/dev/tty 2>&1"; $self->output->print("\e[6n"); @@ -479,6 +487,7 @@ $self->clear(); $self->{savepos} = $n; } +} sub loadpos { my $self = shift;
Subject: Re: [rt.cpan.org #133522] patch for hanging on Windows
Date: Tue, 13 Oct 2020 05:46:46 +0100
To: bug-Term-ProgressSpinner [...] rt.cpan.org
From: lnation <email [...] lnation.org>
Thank you for the patch. Show quoted text
> On 12 Oct 2020, at 22:59, Alexandr Ciornii via RT <bug-Term-ProgressSpinner@rt.cpan.org> wrote: > > Mon Oct 12 17:59:55 2020: Request 133522 was acted upon. > Transaction: Ticket created by CHORNY > Queue: Term-ProgressSpinner > Subject: patch for hanging on Windows > Broken in: 0.02 > Severity: Important > Owner: Nobody > Requestors: CHORNY@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=133522 > > > > Version 0.02 hangs on Windows as stty is not available. Also ANSI sequences are not available on Windows, so use emulation module. > > -- > Alexandr Ciornii, http://chorny.net > > --- Makefile.PL.dist 2020-10-11 17:41:12.000000000 +0300 > +++ Makefile.PL 2020-10-13 00:54:56.437500000 +0300 > @@ -15,17 +15,20 @@ > }, > TEST_REQUIRES => { > 'Test::More' => '0', > - 'IO::Handle' => '0', > - 'Term::ANSIColor' => '0', > }, > PREREQ_PM => { > - #'ABC' => '1.6', > - #'Foo::Bar::Module' => '5.0401', > + 'Term::ANSIColor' => '0', > + 'IO::Handle' => '0', > }, > dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, > clean => { FILES => 'Term-ProgressSpinner-*' }, > ); > > +if ($^O eq 'MSWin32') { > + $WriteMakefileArgs{PREREQ_PM}{'Win32::Console'} = 0; > + $WriteMakefileArgs{PREREQ_PM}{'Win32::Console::ANSI'} = '1.11'; > +} > + > # Compatibility with old versions of ExtUtils::MakeMaker > unless (eval { ExtUtils::MakeMaker->VERSION('6.64'); 1 }) { > my $test_requires = delete $WriteMakefileArgs{TEST_REQUIRES} || {}; > --- ProgressSpinner.pm.dist 2020-10-12 14:43:23.000000000 +0300 > +++ ProgressSpinner.pm 2020-10-12 21:14:11.595605800 +0300 > @@ -1,6 +1,9 @@ > package Term::ProgressSpinner; > our $VERSION = '0.02'; > use 5.006; use strict; use warnings; > +if ($^O eq 'MSWin32') { > + eval "use Win32::Console::ANSI;use Win32::Console;"; > +} > use IO::Handle; use Term::ANSIColor; use Time::HiRes qw//; > our (%SPINNERS, %PROGRESS, %VALIDATE); > > @@ -470,6 +473,11 @@ > #TODO refactor everything to make context aware > sub savepos { > my $self = shift; > + if ($^O eq 'MSWin32') { > + my $CONSOLE = Win32::Console->new(Win32::Console::STD_OUTPUT_HANDLE()); > + my ($x) = $CONSOLE->Cursor(); > + $self->{savepos} = $x; > + } else { > my $x=''; > system "stty cbreak </dev/tty >/dev/tty 2>&1"; > $self->output->print("\e[6n"); > @@ -479,6 +487,7 @@ > $self->clear(); > $self->{savepos} = $n; > } > +} > > sub loadpos { > my $self = shift;