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

Parsing ansi color codes #4

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

herzs11
Copy link
Contributor

@herzs11 herzs11 commented Dec 11, 2024

Using tviews TranslateANSI function to parse stdout and stderr for colorizing in jq -C and grep --color="always. Not sure why grep --color on its own doesn't work

JQ colorized

@paololazzari
Copy link
Owner

Hi @herzs11, thank you for opening this PR. This is great!

The implementation for this feature actually requires less changes. In src/ui/ui.go we just change

ui.OutputView.SetText(out)

to:

ui.OutputView.SetText(tview.TranslateANSI(out))

Can you also bump up the version in cmd/core.go to 0.3.4? Thank you.

@herzs11
Copy link
Contributor Author

herzs11 commented Dec 11, 2024

Good call on the simplification, updated the version as well. Love the tool!

@paololazzari paololazzari merged commit 5bb62ff into paololazzari:master Dec 11, 2024
1 check passed
@paololazzari
Copy link
Owner

That's great to hear. Thanks again!

@herzs11 herzs11 deleted the parsing_ansi_color_codes branch December 11, 2024 18:31
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

Successfully merging this pull request may close these issues.

2 participants