Skip to content

Various gum table width bugs #285

@hydrargyrum

Description

@hydrargyrum

gum table has various width bugs

Width is calculated on header only

% gum table <<< "a,b" <<< "1111111111111111111111111,222222222222222222222222"                
 a  b 
 …  … 

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 text

% gum table <<< "a,b" <<< "1111111111111111111111111,222222222222222222222222" --cell.width=20
 a  b 
 …                   …                  

why does gum print though there are ~20 empty space characters that could display the 11111… and 22222…?

cell.width does not affect header

% gum table <<< "a,b" <<< "1111111111111111111111111,222222222222222222222222" --cell.width=20
 a  b 
 …                   …                  

resulting in broken alignment between cells and header

Desktop (please complete the following information):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions