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

Add hyperlink support #22

Open
gierens opened this issue Sep 6, 2023 · 2 comments
Open

Add hyperlink support #22

gierens opened this issue Sep 6, 2023 · 2 comments

Comments

@gierens
Copy link
Member

gierens commented Sep 6, 2023

We originally merged this feature in #1. Unfortunately it turned out to remove the Copy trait we require in https://github.com/eza-community/eza, therefore we had to revert it again. This issue is just so we don't forget about it, and maybe at some point find a good solution to implement this without breaking eza.

@tertsdiepraam
Copy link

I've just learned about this issue, so I might be totally off here.

If the issue was that Style can no longer be copy, then maybe Style should not contain the hyperlink. Instead it could be ANSIString (with an Option<Cow<str>>) or maybe a HyperlinkedANSIString or something like that. That way, you can keep everything Copy in existing codebases until you actually need hyperlinks.

Alternatively, you could wrap Style in something like HyperlinkStyle, which does not use Copy.

Happy to try to create a PR for something in this direction if you want.

@gierens
Copy link
Member Author

gierens commented Dec 12, 2023

Hey @tertsdiepraam

sorry for the late reply, have been a little too busy for my taste in the last weeks.

I've just learned about this issue, so I might be totally off here.

If the issue was that Style can no longer be copy

Yep, that was the problem ... I only realized after recompiling eza with this that #1 made it incompatible due to the removal of Copy.

then maybe Style should not contain the hyperlink. Instead it could be ANSIString (with an Option<Cow<str>>) or maybe a HyperlinkedANSIString or something like that. That way, you can keep everything Copy in existing codebases until you actually need hyperlinks.

Alternatively, you could wrap Style in something like HyperlinkStyle, which does not use Copy.

Thanks for taking a closer look into this ... So, I think your first suggestion sounds a lot cleaner.

Happy to try to create a PR for something in this direction if you want.

That'd be awesome! 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

No branches or pull requests

2 participants