On Thu, Jul 19, 2018 at 03:49:10PM -0400, Cág wrote:
> If you take a look at README (https://git.suckless.org/sbase/tree/README),
> you'll find out completeness of the programs and missing arguments; out
> of all I only wonder why multi-column output of ls(1) is intentionally
> left out. On Plan 9 it is one-column, too, though.
> caóc
>
>
Because ls's job is to list files. Not to columnate output. There's
another tool for that.
Unfortunately, GNU ls is capable of outputting color codes, but BSD
column is not capable of understanding them. I tried to write something
like this myself, once, and I wonder what's the easiest way to find out
the width a string will take up on a terminal. Because that's the info
you need to columnate the output properly, and short of implementing all
possible terminal control strings myself again, I don't know how to do
this. wcwidth() is of limited utility in this quest, as control codes
consist of multiple characters of which most do take up space if on
their own, but don't in this sequence.
Ciao,
Markus
Received on Fri Jul 20 2018 - 09:26:01 CEST