bug#30430: [column] accounting for ansi color codes
From:
Pádraig Brady
Subject:
bug#30430: [column] accounting for ansi color codes
Date:
Sat, 17 Feb 2018 13:33:48 -0800
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 11/02/18 22:07, Boruch Baum wrote:
> The `column -t' command doesn't align input properly when that input
> includes ansi color codes.
>
> An argument that it should do so, is that `column' serves to make input
> more readable, and easier to find and compare fields of input data - the
> same goal as colorization.
>
> I encountered this when trying to columnate log output that had been fed
> through the colorization program `ccze'.
>
> Example: Compare the output of the following two one-liners:
>
> awk '{sub("install|configure|upgrade|trigproc","& _",$3);print}' \
> /var/log/dpkg.log | column -t
>
> awk '{sub("install|configure|upgrade|trigproc","& _",$3);print}' \
> /var/log/dpkg.log | ccze -m ansi -o noscroll >&1 | column -t
>
Note column(1) is part of the util-linux project.
We've similar considerations though with wc -L
which we've at least mentioned at:
http://www.pixelbeat.org/docs/coreutils-gotchas.html#wc