Repository navigation
Conversation
Colored output was decided solely by the isatty and NO_COLOR checks, with --no-fancy able to force it off but nothing able to force it on. Piping the output to another program therefore always stripped the color. Add --color, following the ls convention. auto keeps the existing behaviour and stays the default, always keeps the color across a pipe, and never matches --no-fancy, which now routes through the same tri-state.
|
Hi @nfvelten, Thanks for your contribution! Unfortunately, Hyprland and hypr* no longer To get vouched, please see our contributing guide at wiki.hypr.land/Contributing-and-Debugging This PR has been closed automatically and will not be re-opened. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #121.
Color was decided only by the
isattyandNO_COLORchecks.--no-fancycould force it off, but nothing could force it on, so piping into anything else always stripped it. That is the case in the issue: the output is captured into a variable and reused for a notification border, the terminal, and the clipboard.--colorfollows thelsconvention.autois the default and behaves exactly as before,alwayskeeps the color across a pipe, andneveris what--no-fancyalready did.--no-fancynow routes through the same tri-state rather than setting the flag directly, so the last option on the command line wins instead of the order of the checks deciding.Verified by picking a pixel with the output piped through
cat -v:An unrecognised value exits 1 with a message naming the three accepted ones.
Two notes, both easy to drop if you disagree:
--no-fancyas-n, but-nis--notifyand--no-fancyis-b. I corrected it in the same block I was already editing.NO_COLORentry now says it is overridden by--color=always, matching howlstreats an explicit flag.While looking into this I also noticed #109 is already fixed, by #123 back in May 2025. The preview honours
--formaton currentmain. Might be worth closing.