-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Consider adding smarter double click to select word logic #682
Comments
This can be achieved adding
Already works with the default settings. I guess this issue can be closed? |
@marvinthepa adding
Here is a case I had in mind here: Ideally double clicking would select the same as the link (which is smarter as it's a link provider in VS Code based on monaco's link detection). I won't if we could solve most of these issues by just deferring to the relatively new link providers to select the link if it's a link, otherwise revert to the existing behavior? |
I know. This is the default behavior in iterm2 though (quite annoying), that is why I was asking.
Is there a way to detect if this link provider is present and use it if it is? Sorry for the question, I am unfamiliar with the topic. Maybe I should have a look at how the web-links addon is detecting links and re-use this. It seems to handle your example just fine, and the code is always present in xterm.js.. |
I think you can customize it to require a modifier, just like it works in VS Code.
The double click behavior is built into the core, so it could theoretically depend on files that own the link providers. The only concern here is that link providers provide asynchronously, hopefully that won't affect the responsiveness much, even when providers communicate across processes (it's probably fine). |
Do you want this to try both registered linkmatchers (sync) and registered linkproviders (async)? Linkproviders are not even documented on https://xtermjs.org/docs/api/terminal/classes/terminal/, are they considered a supported API, or just used internally for vs-code? Or are linkmatchers deprecated in favor of linkproviders (I did not find any information about this)? |
@marvinthepa oh wow, our website seems to be locked on v4.4 API 😱 We'll make sure we fix that this upcoming release. For checking the API I normally go straight to the .d.ts file in the repo as it's up to date with master (we haven't had a release in ~3 months). Lines 772 to 778 in 74ea558
Link matchers are deprecated in favor of link providers, let's support only link providers. |
I have a version that is "working" using linkProviders for doubleClick. To make it work for right click as well, I would use this._model.selectionEnd = undefined; @Tyriar do you remember why this is cleared on right click but not on double click? The commit message on 3c6cab1 just describes what it does, but not why. |
Also works with right click select. Fixes xtermjs#682.
Also works with right click select. Fixes xtermjs#682.
@marvinthepa I think it was to align with macOS' default behavior (probably testing on Terminal.app). |
I do not know how the terminal behaves differently when you do not clear |
Also works with right click select. Fixes xtermjs#682.
Also works with right click select. Fixes xtermjs#682.
Also works with right click select. Fixes xtermjs#682.
#670 brings in new double click to select word that allows you to select whole paths/URLs instead of just small fragments of them. This could be improved though for a number of cases, for example:
:
inls -lR
output(
,)
,"
surrounding paths, etc.The text was updated successfully, but these errors were encountered: