-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: hyperlink support in engine + hyperlink for path segment #307
Conversation
5e00ed6
to
455d5fa
Compare
Work in progress. First draft to see how it works. I have to check how to integrate this cleanly. |
The goal is that you can click the branch/tag/commit and link to the repo? |
Yes it's a first draft to see how it looks like. |
BTW I'm using windows terminal 1.4.3243.0 and the clickable link works for me ¯\_(ツ)_/¯ |
0a41fc7
to
9b65dd3
Compare
I still have an issue for path not rendered correctly when mapped_locations is used and a unicode character is set.
I think it can be related to that windows terminal issue: microsoft/terminal#3546 |
and support for opening uri is coming:microsoft/terminal#7526 to track hyperlink progress: microsoft/terminal#5001 |
And to test hyperlink in the terminal: |
@lnu I was looking for that unicode bug the other day. Sometimes I think this whole repo is "too soon" for MS as we're constantly battling with incomplete features whereas users expect all of this to "just work". Or, we're right on time and will provide appropriate focus 😅 |
25fa84e
to
6b2b315
Compare
@lnu I would then maybe, for the sake of simplicity, only limit to the engine and path segment for 1. Leave git on a separate track. |
78acc70
to
0e77ba2
Compare
c51de38
to
31e4af1
Compare
Still have to change the call in engine.go to generateHyperlink. Calling through color is a bit strange. |
I agree, but |
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.
What I'm missing is an addition to the docs about this like colors. Because I can create a text segment/prefix/postfix, that contains a link which will be rendered when hyperlinks are enabled.
Yes but be careful that right now the engine replaces only hyperlink in segment text, not prefix or postfix. |
True. Which is fine I guess, this needs to be more contextual anyways. It's not because we can that we should. |
e3f9ea1
to
832ba79
Compare
An hyperlink can be added using markdown syntax and will be detected by the engine. Initial implementation for path segments.
@@ -37,6 +37,7 @@ Display the current path. | |||
is set to `true`) | |||
- mapped_locations_enabled: `boolean` - replace known locations in the path with the replacements before applying the | |||
style. defaults to `true` | |||
- enable_hyperlink: `boolean` - displays an hyperlink for the path - defaults to `false` |
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.
Can't believe I missed this, do we want to keep it at this level or higher up at Settings
?
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.
Now, the engine detects url from any segments. Hyperlink can be enabled/disabled for each segment and it takes care of rendering the text or the url markdown.
On the other side, it could be enabled at global level and implying that all segments supporting url will render them.
Both have their pros and cons.
It’s a matter of taste :).
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.
I believe both can be an option, but let's keep it like this for now. Amazing work.
|
||
#### Supported terminals | ||
|
||
- [Terminal list](thttps://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) |
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.
t
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.
fixed, thx.
Prerequisites
CONTRIBUTING
guideDescription
Hyperlink in git and path segment. Supported in windows terminal 1.5(in preview now and available this month for the stable one)