Skip to content
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

Merged
merged 1 commit into from
Dec 15, 2017

Conversation

martellaj
Copy link
Member

  • Addresses issue Add a copy on select option for the terminal #36271
  • Adds "copy on select" feature (with setting)
  • Chose to implement by adding an event listener for 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

@@ -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."),
Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that's it 😃

Copy link
Member

@Tyriar Tyriar left a 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."),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that's it 😃

@Tyriar
Copy link
Member

Tyriar commented Dec 15, 2017

Looks like the test failures are unrelated

@Tyriar Tyriar merged commit 08ec160 into microsoft:master Dec 15, 2017
@Tyriar Tyriar added this to the December 2017/January 2018 milestone Dec 15, 2017
@Tyriar
Copy link
Member

Tyriar commented Dec 15, 2017

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.

@Phunky
Copy link

Phunky commented Jan 19, 2018

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).

@Tyriar
Copy link
Member

Tyriar commented Jan 19, 2018

@Phunky hm, that works fine for me on my mac. 😕

@likesalmon
Copy link

@Tyriar 21821 is the top search result for this issue, and it says:

No plans to implement this, there are already many ways to configure copy/paste in the terminal.

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?

@Tyriar
Copy link
Member

Tyriar commented Jun 15, 2018

@likesalmon good call, done 😃

@richard-scott
Copy link

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).

I have to double right click to paste something I've selected... Windows 10 BTW.

@Tyriar
Copy link
Member

Tyriar commented Aug 7, 2019

@richard-scott right click behaves differently on each platform but can be configured, see the terminal.integrated.rightClickBehavior setting.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants