-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 a setting to disable URL detection #10022
Conversation
Note, we do not update the terminal's behaviour upon hot reload of this setting, changes to it will only apply to future terminal instances. If people feel strongly about this we could change that but I don't think a hot reload for this is necessary. EDIT: We update the behaviour with regards to this setting on hot reload now |
I hate to say it, but I think this should be hot reloadable :/. Here's a few reasons:
|
Also, what's the deal with #8293? Specifically thinking about this comment with regards to the future of url detection customization. |
That thread is the entire explanation of why we didn't add this in the first place. We couldn't agree on a simple setting name/design in the first place. Since we couldn't come to a consensus, and no one was asking for the setting, we decided to punt the discussion. I'm tempted to say: let's toss this in as |
I like the experimental idea, made that change. Also, the link detection behaviour gets updated with hot reloads now. |
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.
Just a minor suggestion :)
_terminal->UpdatePatterns(); | ||
auto lock = _terminal->LockForWriting(); | ||
_terminal->UpdatePatternsUnderLock(); |
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.
Just curious, why'd you split this up?
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.
Calling UpdatePatterns
from UpdateSettings
was causing a hang because of the writing lock, and I didn't want to have both an UpdatePatterns
and an UpdatePatternsUnderLock
. And since this is the only other place we ask Terminal to update the pattern locations, I thought it'd be fine to ask it to grab the lock
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.
Blocking to note that we discussed a way to clean up the hot reload logic.
Every time there's a settings reload, we can simply always clear pattern recognizers and re-register the link pattern. We can probably also avoid the detection of the existing pattern recognizer.
Clearing the pattern recognizers: we could reset _currentPatternId to 0 again? I dunno if we need it.
Made the change!
I like that just for neatness |
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.
It's more correct to say that this controls detecting URLs. Hyperlinks are the things we're making out of the URLs, right? Should we reword the JSON key and the settings UI checkbox?
Makes sense! Renamed to detectURLs everywhere for consistency |
Hello @PankajBhojwani! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Summary of the Pull Request
Adds a global setting,
experimental.detectHyperlinks
, that controls whether we automatically detect links and make them clickable. Default is set to true.PR Checklist
Validation Steps Performed
When
detectHyperlinks
is set to false, links do not underline on hover and are not clickable.