Skip to content

feat: add --color={always,never,auto} flag#58

Closed
hishamhm wants to merge 3 commits intomainfrom
color-flag
Closed

feat: add --color={always,never,auto} flag#58
hishamhm wants to merge 3 commits intomainfrom
color-flag

Conversation

@hishamhm
Copy link
Member

@hishamhm hishamhm commented Mar 8, 2025

No description provided.

hishamhm added 3 commits March 8, 2025 16:50
Using `--color=always` provides color output when piping color
through ANSI-control-sequence aware processes such as `less -R`
and `which -c`. However, these programs are not aware of
ANSI-operating-system-command sequences.

A simple solution here is to filter out the one decor that
uses ANSI-operating-system-command, `linked_uri`.
Copy link
Member

@euclidianAce euclidianAce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor nits. Thanks!

--- create_logger: function(
--- stream: FILE,
--- verbosity_threshold: Verbosity,
--- color_mode: ColorMode,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

color_mode isn't a parameter to create_logger, is it meant to be?

Comment on lines +117 to +119
if decor then
decor.linked_uri = nil
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably fine in practice, but I'm not a huge fan of modifying arguments like this. Not saying that this is a blocker, but maybe render_ansi could take another parameter like dont_render_uris: boolean or something.

@euclidianAce
Copy link
Member

Manually merged via a8fc3f0 and 0a1830b. Thanks!

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