#15488: wrap text to terminal width --------------------------------------+------------------------------------- Reporter: ryandesign@macports.org | Owner: raimue@macports.org Type: defect | Status: assigned Priority: Normal | Milestone: MacPorts base bugs Component: base | Version: 1.7.0 Resolution: | Keywords: --------------------------------------+------------------------------------- Changes (by raimue@macports.org): * status: new => assigned Comment: My main intention to hardcode that to 80 chars was to make it easier readable, even if you are using a wide terminal size. Changed the behavior of port to use the current size of the terminal window (using COLUMNS environment variable, so you can even customize this). If COLUMNS is not available, it calls `stty size` to get the size. If even this is not available, it prints a warning and uses a default of 80x24. COLUMNS should be updated when the terminal is resized, so this also should work fine with longer sessions in interactive mode, where the user could resize the terminal window. I still have to check what happens when port resets the environment to boot_env, which is done on some places. Committed in r37316. I don't know how to determine if stdout is attached to a terminal or a pipe (or at least not with Tcl, I think this would require some work with <termios.h> in C). Also, I think wrapping is even a good idea when using a pipe, for example `port info |less` or similar. -- Ticket URL: <http://trac.macports.org/ticket/15488#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS