Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy -c option support #23

Open
Sargates opened this issue Feb 3, 2024 · 0 comments
Open

Legacy -c option support #23

Sargates opened this issue Feb 3, 2024 · 0 comments

Comments

@Sargates
Copy link

Sargates commented Feb 3, 2024

The -c option in the linux-utils version of column lets you control the output width of the table -- good for clipping at a certain length or dynamically using tput cols.

From column --help:
-c, --output-width <width> width of output in number of characters

However piping the table to something like cut -c 1-$(tput cols) causes overtrim because the control characters aren't interpreted as 0 width characters (I think), i.e. \e[41m is counted as 6 characters instead of 0 and your line ends up 6 characters short of what it's supposed to be.

I can't really find a good alternative for this clipping behavior with colors and I figure since it existed in the original someone might be willing to implement it here. I would submit a pull request myself but I've never used pearl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant