-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add auto
modifier to hyperlink
argument to match both ls
behavior and color argument behavior
#746
base: main
Are you sure you want to change the base?
Add auto
modifier to hyperlink
argument to match both ls
behavior and color argument behavior
#746
Conversation
9b6fe20
to
f149767
Compare
auto
modifier to hyperlink
argument to match both ls
behavior and color argument behavior
34bc0b1
to
7bb01a2
Compare
I just noticed that there is a bug in the logic of calculating items lengths with shows when combined with The Argument sets used: eza --color=auto --hyperlink -GlhFa
eza --color=auto --hyperlink=always -GlhFa
eza --color=auto --hyperlink=never -GlhFa |
This probably came leftover from #742, which I tested but apparently not the particular combination of with
|
Do you know why it would trigger only when hyperlinks are enabled ? |
As hyperlinks are not calculated and taken into account when not enabled they are not count for when taking the width |
7bb01a2
to
8665318
Compare
#1059 Is not duplicate. The changes are different. On top of the same functionality I did refactoring and shell completions |
255e17f
to
5e31b92
Compare
Right, I had forgotten to update the help text. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! We don't use merge updates, please remove the merge update commit and use rebase instead to update the branch
5e31b92
to
fa8aab1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…and color option behaviour
fa8aab1
to
c400597
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the behavior change, this is breaking.
Also, I've found that some terminal emulators do in fact parse hyperlinks that are piped perfectly fine (e.g. kitty) while others (iterm2) doesn't, making the decision as to whether or not to default to auto more important.
I'm wondering what others thing re: defaulting to auto, I'm leaning defaulting to always, since to me, not supporting piped hyperlinks is worse compliance with hyperlinks, and we should support the case where a terminal emulator is doing it's best.
See also:
My initial argument for making When piping into One way out to make this less breaking is just having |
Description
Add a
WHEN
modifier to the--hyperlink
argument. This matches bothls
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 toauto
and doesn't break. However, it changes the behavior, with no value the option worked likealways
but it now defaults toauto
. Even though I considerauto
to be the right default, maybe it could be changed toalways
to keep old meaning.Closes #1059 (duplicate)