Open hydrargyrum opened 1 year ago
Some of the issues you're having with the widths are easily solved by using -w20,20
instead of --cell.width=20
.
From the man page:
-w, --widths=WIDTHS,...
Hope it helps.
Indeed that fixes the unaligned headers, and the data is not truncated anymore!
But:
--cell.width
produce such inconsistent behavior? What's the use case of doing so? Maybe the option should be removed to avoid confusion?@hydrargyrum That's true. However I'm not in a position to make design choices regarding how a function should work. Maybe @maaslalani can be at help with this? And then depending on the outcome maybe I could propose a fix? 🥳
gum table
has various width bugsWidth is calculated on header only
Since a table has aligned data, gum already needs to read the whole input. Why does gum only use the header text to determine the width of cells by default? It could use the max width of each text column, (perhaps conditionnally to fit the terminal). But the default is not very good.
cell.width
still truncates cell textwhy does gum print
…
though there are ~20 empty space characters that could display the11111…
and22222…
?cell.width
does not affect headerresulting in broken alignment between cells and header
Desktop (please complete the following information):