-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Adds "copy on select" feature (with setting) #38287
Conversation
@@ -120,6 +120,11 @@ configurationRegistry.registerConfiguration({ | |||
'type': 'boolean', | |||
'default': TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE | |||
}, | |||
'terminal.integrated.copyOnSelection': { | |||
'description': nls.localize('terminal.integrated.copyOnSelection', "When set, text selected in the terminal will be copied to the clipboard."), |
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.
Not actually sure how localization works in this project. Is anything else needed to properly localize this string?
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.
Nope, that's it 😃
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.
Works perfectly! Thanks for the contribution and sorry about the delay, just got back from leave
@@ -120,6 +120,11 @@ configurationRegistry.registerConfiguration({ | |||
'type': 'boolean', | |||
'default': TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE | |||
}, | |||
'terminal.integrated.copyOnSelection': { | |||
'description': nls.localize('terminal.integrated.copyOnSelection', "When set, text selected in the terminal will be copied to the clipboard."), |
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.
Nope, that's it 😃
Looks like the test failures are unrelated |
I just noticed after further testing that this doesn't work when dragging the selection and releasing the mouse outside of the terminal element. You will probably need to use selection to catch this as I would prefer not add a global listener. |
It also doesn't seem to work if you select a text range by double clicking and your unable to paste the selected text without first right clicking (least not on my mac). |
@Phunky hm, that works fine for me on my mac. 😕 |
@Tyriar 21821 is the top search result for this issue, and it says:
I'm so happy about this feature, but almost gave up when I saw that comment. The conversation is locked, but perhaps there is a way to add a note so others find the correct setting? |
@likesalmon good call, done 😃 |
I have to double right click to paste something I've selected... Windows 10 BTW. |
@richard-scott right click behaves differently on each platform but can be configured, see the |
mouseup
event in the integrated terminal; I think this satisfies the issue, as selecting with the keyboard doesn't copy to clipboard in any terminal AFAIK