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

fix: strip ansi sequences from stdin #739

Merged
merged 1 commit into from
Dec 9, 2024
Merged

fix: strip ansi sequences from stdin #739

merged 1 commit into from
Dec 9, 2024

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Dec 4, 2024

most programs should not give output with ansi sequences to a pipe, but as some of them do, this will strip them out.

closes #188

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 added the enhancement New feature or request label Dec 4, 2024
@caarlos0 caarlos0 self-assigned this Dec 4, 2024
@bashbunni
Copy link
Member

bashbunni commented Dec 9, 2024

less ansi-example.txt | go run . pager gives
image

ansi-example.txt has ansi sequences that are stripped with this change 👍

@caarlos0 caarlos0 merged commit fb543c3 into main Dec 9, 2024
14 checks passed
@caarlos0 caarlos0 deleted the sanitize branch December 9, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sanitize input
3 participants