Skip to content

Color mode adds extraneous trailing spaces on every line #769

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

Open
jdanbrown opened this issue Apr 13, 2025 · 0 comments
Open

Color mode adds extraneous trailing spaces on every line #769

jdanbrown opened this issue Apr 13, 2025 · 0 comments

Comments

@jdanbrown
Copy link

Bug: Extraneous trailing spaces on every line, when color enabled

$ procs fish --use-config=default --color=always | cat --show-ends
 PID:▲ User │ TTY  CPU MEM CPU Time │ Command                  $
            │      [%] [%]          │                          $
 7193  danb │ s057 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 17848 danb │ s058 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 18687 danb │ s060 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 21944 danb │ s063 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 24395 danb │ s018 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish   $
 24499 danb │ s020 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish   $
 50665 danb │ s047 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 94874 danb │ s054 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$

Correct: No extraneous trailing spaces, when color disabled

$ procs fish --use-config=default --color=disable | cat --show-ends
 PID:▲ User │ TTY  CPU MEM CPU Time │ Command$
            │      [%] [%]          │$
 7193  danb │ s057 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 17848 danb │ s058 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 18687 danb │ s060 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 21944 danb │ s063 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 24395 danb │ s018 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish$
 24499 danb │ s020 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish$
 50665 danb │ s047 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$
 94874 danb │ s054 0.0 0.0 00:00:00 │ /opt/homebrew/bin/fish -l$

This is problematic when piping colored output (--color=always) to other commands (e.g. head), where some of the input processes that have very very long args (some always do), which results in line wrapping creating a ton of noisy blank lines from the large amount of trailing whitespace on every line:

Image
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