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

Better handling for color in terminal #381

Merged
merged 6 commits into from
Mar 25, 2024

Conversation

Its-Just-Nans
Copy link
Contributor

Hi

With this PR

dust | less

will work out of the box

It checks if the output is a terminal (if not, it could be a pipe, so we disable the colors)

This PR also implements the https://no-color.org/ proposal

If you still want the colors you can use

dust -C
# or
dust --force-colors

Thanks !

@bootandy
Copy link
Owner

Yeah this looks sensible, run cargo fmt and I'll accept it - thanks.

@Its-Just-Nans
Copy link
Contributor Author

Forgot it, done :)

@bootandy
Copy link
Owner

Getting there, but still missing a few

@Its-Just-Nans
Copy link
Contributor Author

Maybe this time ? (I hope)

and I added two tests :)

@bootandy bootandy merged commit fbd34ec into bootandy:master Mar 25, 2024
16 of 17 checks passed
@bootandy
Copy link
Owner

I'll clean the windows one

@Its-Just-Nans
Copy link
Contributor Author

I missed it !

Thanks!

@Its-Just-Nans Its-Just-Nans deleted the color-handling branch March 26, 2024 08:40
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.

None yet

2 participants