-
Notifications
You must be signed in to change notification settings - Fork 356
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
--no-strip-ansi prints ANSI codes and garbles output #785
Comments
oh, I see, lemme fix that! |
to resolve this properly I think we need 2 things:
|
Hey, when using my sesh, my session manager I've added the I'm guessing it's related to this feature, any ideas what's causing it? When the icons are remove from the script the matching result works as expected. |
@joshmedeski Hey! And chance you can provide a one-liner we can use to reproduce the bug you're seeing? |
Once you install sesh you can run this command:
The |
Here's a reproducible example of the problem which doesn't require installing sesh.
printf '\033[%dm%s\033[39m %s' 90 Downloads | gum filter --no-strip-ansi |
oh, yeah, emoji grapheme, will fix! thanks for the reproducible btw! |
this should do the trick: #799 |
This flag was introduced in PR #784, after a commit in PR #739 unconditionally stripped ANSI codes from stdin. PR #739 was made in response to issue #689; in order to prevent the display from being garbled by incorrect ANSI code handling, we opted to simply strip ANSI codes from the input entirely. The implementation in PR #784 (and my own draft implementation in PR #782) simply undo that stripping behavior without addressing the underlying issues from #689, resulting in strange outputs in certain cases. Below is a minimal example which results in garbled output on my machine in Kitty, Alacritty and st.
Here are recordings for each tested terminal. Note that Kitty was a lot worse than the others; interestingly, when I tried using
asciinema
to record Kitty's output, the recording showed the same2m
result as the other terminals; to show what it actually looked like on-screen I had to use a screen recording.The text was updated successfully, but these errors were encountered: