Opened 15 years ago

Closed 15 years ago

#22142 closed defect (fixed)

"port variants" line-wrapping breaks if terminal columns 0

Reported by: jxh@… Owned by: macports-tickets@…
Priority: Low Milestone:
Component: base Version: 1.8.1
Keywords: columns wrap variants xterm stty Cc:
Port:

Description

My xterms always start out with:

$ stty -a
speed 38400 baud; 0 rows; 0 columns;

and this makes "ports variants dbus" (for instance) wrap its text as though one had actually set COLUMNS=0 in the environment:

$ /opt/local/bin/port variants dbus
dbus has the variants:
   no_root: Run
            the
            DBUS
            daemon
            as
            MacPorts
            install
            user.
  [...]

There is some code that reads this through Pextlib and term_get_size, but it arguably shouldn't take a 0 result as quite real. If it leaves env(COLUMNS) alone, wraplabel, called from action_variants, will do the right thing.

The attached diff shows a suggested fix.

This is Snow Leopard, Mac OS 10.6.

Attachments (2)

port.diff (887 bytes) - added by jxh@… 15 years ago.
Suggested fix.
port-diffu.txt (642 bytes) - added by jxh@… 15 years ago.
Suggested fix, with diff -u

Download all attachments as: .zip

Change History (5)

Changed 15 years ago by jxh@…

Attachment: port.diff added

Suggested fix.

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Just for future reference, we prefer unified diffs (diff -u).

comment:2 in reply to:  1 Changed 15 years ago by jxh@…

Replying to jmr@…:

Just for future reference, we prefer unified diffs (diff -u).

Sorry about that. I'm new here. Will attach that as well.

Changed 15 years ago by jxh@…

Attachment: port-diffu.txt added

Suggested fix, with diff -u

comment:3 Changed 15 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

Thanks for the report, fixed in r59839.

Note: See TracTickets for help on using tickets.