Thinking about it more, though, I think I like dpkg's behavior, wherein COLUMNS is honored even when stdout is a process instead of a tty. For example if you run:
COLUMNS=70 dpkg -l ubuntu-desktop | less
The output is properly formatted, whereas if you remove the COLUMNS=, you'll find that it spans nearly 140 columns. Either way, though, it works.
Diffstat on attached patch, which now considers stdout's status as a tty before acting on COLUMNS:
debian/ patches/ 00list | 1 patches/ 01-check- columns- env-var. dpatch | 30 +++++++ +++++++ +++++++ ++++ 1.45/debian/ changelog | 12 ++++++++++ 1.45/debian/ control | 5 ++-- 1.45/debian/ rules | 9 +++++--
debian/
diffstat-
diffstat-
diffstat-
5 files changed, 53 insertions(+), 4 deletions(-)
Thinking about it more, though, I think I like dpkg's behavior, wherein COLUMNS is honored even when stdout is a process instead of a tty. For example if you run:
COLUMNS=70 dpkg -l ubuntu-desktop | less
The output is properly formatted, whereas if you remove the COLUMNS=, you'll find that it spans nearly 140 columns. Either way, though, it works.