eza icon indicating copy to clipboard operation
eza copied to clipboard

feat: Added `auto`, `always`, `never` modifiers to `--hyperlink` argument (V2)

Open nikelborm opened this issue 7 months ago • 3 comments

This is continuation of @mrnossiom's work in #746 (as I've learned already after I started coding current PR myself) with added shell completions and which doesn't have merge conflicts with the main branch.

Description

Add a WHEN modifier to the --hyperlink argument. This matches both ls behavior and the --color argument behavior.

I think ls is doing it right because you might want to enable --hyperlink in a shell alias but still get plain text when piping into some other program without control chars in the way. Setting --hyperlink in a shell alias is useful for terminal integration (e.g. Kitty).

The public API is compatible since --hyperlink defaults to auto and doesn't break. However, it changes the behavior, with no value the option worked like always but it now defaults to auto. Even though I consider auto to be the right default, maybe it could be changed to always to keep old meaning.

nikelborm avatar Jul 16 '24 11:07 nikelborm