-
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
[SelectionManager] Select the word underneath the cursor on contextmenu #778
Comments
I think it would be good to support this for macOS only, a PR would be awesome! One thing to keep in mind is that it generally doesn't seem to select whitespace in the programs I tested, currently |
I was under the assumption that this would be the default behaviour for Windows and Linux too. How about making it platform dependant by default, but configurable through a config flag? |
@mofux sounds good if it's default on macOS only. It would be cool to have opt-in support on other platforms. |
This is currently blocked by #780 |
Is it really blocked? I would have thought you'd check MouseEvent for whether it was a right click and/or listen to |
@Tyriar I thought I would just hook into the mousedown handler of the selection manager (the part that is changed by #780), check if options.rightClickSelectsWord is true, selection is currently empty and evt.button is 2 (right mouse button) and basically trigger the same action that is done for double-click (which should select the word underneath the cursor). Then, term.defaults.rightClickSelectsWord would only be true if Browser.isMac |
Right now the right click logic is contained within Clipboard.ts which is called by listening to contextmenu or mousedown depending on the browser. This should probably go inside rightClickHandler which already has the |
Fixed with #1114 |
If a user right clicks on a word or url in the terminal, the word should be automatically selected, so it can be copied without having to select it first. This would mimic the default behaviour of Terminal.app, Chrome and most other UIs that allow text selection. I can try to create a PR with this feature if desired.
The text was updated successfully, but these errors were encountered: