Skip Menu |

This queue is for tickets about the Pod-Perldoc CPAN distribution.

Report information
The Basics
Id: 85467
Status: resolved
Priority: 0/
Queue: Pod-Perldoc

People
Owner: Nobody in particular
Requestors: mrallen1 [...] yahoo.com
Cc: explorer [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.20
Fixed in: (no value)



CC: explorer [...] cpan.org
Subject: Pod::Perldoc::ToTerm doesn't respect terminal width settings
Problems: 1.- Now, Pod::Perldoc use Pod::Perldoc::ToTerm formatter: Perldoc.pm: 473 $self->opt_o_with('term') unless $self->is_mswin32 || $self->is_dos and the width of screen is taken from Text.pm: 121 $$self{opt_width} = 76 unless defined $$self{opt_width}; and more later: Text/Termcap.pm: 69 unless (defined $$self{width}) { 70 $$self{opt_width} = $ENV{COLUMNS} || $$term{_co} || 80; 71 $$self{opt_width} -= 2; 72 } a.- What is $$self{width}? It is not used anymore... Maybe 'opt_width'? but... Text.pm initialized $$self{opt_width}, ever b.- $$self{opt_width} is initialized with $ENV{COLUMNS} or $$term{_co}. My screen (tmux, TERM=screen) have $COLUMNS environment variable but is not exported (I will need to write "export COLUMNS" into .bashrc file), so $ENV{COLUMNS} is void. Then, $$self{opt_width} is set with the $$term{_co} value (80 columns, ever, because is a capability (Term::Cap)). Result: the pod is formatted to 80-2 columns, ever. At Perl v5.14, Pod::Perldoc::ToMan used `stty -a` to get width screen. If I change $$self{width} with $$self{opt_width}, this line work: $ perldoc -w width:$[COLUMNS-2] perldata If I leave $$self{width}, this work: $ export COLUMNS $ perldoc perldata Best solution I found: A.- Comment or remove line 121 of Text.pm (don't initialize $$self{opt_width}) B.- Change $$self{width} with $$self{opt_width} at Text/Termcap.pm C.- $ export COLUMNS (or in .bashrc) D.- $ perldoc perldata
On Mon May 20 11:41:12 2013, mallen wrote: Show quoted text
> Problems: > 1.- Now, Pod::Perldoc use Pod::Perldoc::ToTerm formatter: > > Perldoc.pm: > 473 $self->opt_o_with('term') unless $self->is_mswin32 || $self-
> >is_dos
> > and the width of screen is taken from > > Text.pm: > 121 $$self{opt_width} = 76 unless defined $$self{opt_width}; > > and more later: > Text/Termcap.pm: > 69 unless (defined $$self{width}) { > 70 $$self{opt_width} = $ENV{COLUMNS} || $$term{_co} || 80; > 71 $$self{opt_width} -= 2; > 72 } > > a.- What is $$self{width}? It is not used anymore... Maybe > 'opt_width'? but... Text.pm initialized $$self{opt_width}, ever > > b.- $$self{opt_width} is initialized with $ENV{COLUMNS} or > $$term{_co}. My screen (tmux, TERM=screen) have $COLUMNS environment > variable but is not exported (I will need to write "export COLUMNS" > into .bashrc file), so $ENV{COLUMNS} is void. Then, $$self{opt_width} > is set with the $$term{_co} value (80 columns, ever, because is a > capability (Term::Cap)). > > Result: the pod is formatted to 80-2 columns, ever. > > At Perl v5.14, Pod::Perldoc::ToMan used `stty -a` to get width screen. > > If I change $$self{width} with $$self{opt_width}, this line work: > > $ perldoc -w width:$[COLUMNS-2] perldata > > > If I leave $$self{width}, this work: > > $ export COLUMNS > $ perldoc perldata > > Best solution I found: > A.- Comment or remove line 121 of Text.pm (don't initialize > $$self{opt_width}) > B.- Change $$self{width} with $$self{opt_width} at Text/Termcap.pm > C.- $ export COLUMNS (or in .bashrc) > D.- $ perldoc perldata
Thanks for the report. This will be fixed in a future release.
On Mon May 20 11:41:12 2013, mallen wrote: Show quoted text
> Problems with terminal width
The ToTerm formatter passes a width setting to Pod::Text::Termcap using one of the following sources: 1. An explicit width passed from the command line using -w 2. The MANWIDTH environment variable 3. stty output 4. The default width of 76 (same as Pod::Text) Committed as 920241f on github. It should be on CPAN in a day or two as a test release.