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

column: provide support for terminal capabilities #1011

Closed
jsamr opened this issue Apr 17, 2020 · 2 comments
Closed

column: provide support for terminal capabilities #1011

jsamr opened this issue Apr 17, 2020 · 2 comments

Comments

@jsamr
Copy link

jsamr commented Apr 17, 2020

Currently, there is no way to instruct column utility to adjust width computation with terminal capabilities. Example:

$ echo -e "$(tput smul)A$(tput rmul) B\nC D"
A B
C D
$ echo -e "$(tput smul)A$(tput rmul) B\nC D" | column --table
A  B
C                 D

When provided with --term option, column could use terminfo database to adjust the computation of column width accordingly.

EDIT:

Version tested: 2.35.1-1.1
Related issue #252
Terminal emulator: urxvt, alacritty
Shell: bash 5.0.16

@jsamr
Copy link
Author

jsamr commented Apr 18, 2020

By the way, it would be nice to have the feature consistently implemented across other utils such as fmt.

karelzak added a commit that referenced this issue Apr 22, 2020
…ncoding()

Old:
	$ echo -e "$(tput smul)A$(tput rmul) B\nC D" | column --table
	A  B
	C                 D

Fixed:
	$ echo -e "$(tput smul)A$(tput rmul) B\nC D" | ./column --table
	A  B
	C  D

Addresses: #1011
Signed-off-by: Karel Zak <kzak@redhat.com>
@karelzak
Copy link
Collaborator

It's libsmartcols bug. It uses by default calculation that assumes \x for all unprintable chars -- this feature is disabled for column(1), but libsmartcols still uses it in many places.

The problem should be fixed now.

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

2 participants