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

Option to not clear selection on copy #3884

Open
owenneil opened this issue Dec 8, 2019 · 5 comments
Open

Option to not clear selection on copy #3884

owenneil opened this issue Dec 8, 2019 · 5 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@owenneil
Copy link

owenneil commented Dec 8, 2019

Description of the new feature/enhancement

Currently when you copy text it clears your selection. While this is current behavior for some terminals, this is different than standard Windows behavior. Most Windows programs simply leave the text selected and require some other action to deselect the text. This is particularly bad if you have remapped Copy to Ctrl-C, then accidentally hitting it twice can result in killing your running process accidentally. Additionally, I frequently will copy text, then need to come back to it later to recopy, but due to this issue I have to re-select the text frequently.

I just want copy/paste to work the same here that it does in every other program.

@owenneil owenneil added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Dec 8, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 8, 2019
@DHowett-MSFT
Copy link
Contributor

This is particularly bad if you have remapped Copy to Ctrl-C,

Incidentally, the collision between copy and cancel (one of which is handled by the terminal emulator, and the other of which is handled by the remote application) is why we haven't bound Ctrl+C by default.

There's a lot of different feature requests around copying, and people have a lot of different requirements here. We should converge them, if possible.

@DHowett-MSFT DHowett-MSFT added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 9, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 9, 2019
@DHowett-MSFT DHowett-MSFT added this to the Terminal Backlog milestone Dec 9, 2019
@carlos-zamora carlos-zamora self-assigned this May 12, 2020
@carlos-zamora
Copy link
Member

carlos-zamora commented Jun 5, 2020

Just thinking out loud. Here's a few thoughts:

  • what kinds of setting should this be? Keybinding arg? Global? Profile?
    • Like copyOnSelect, I feel that this should be a global setting
  • type should definitely be bool
  • we should keep ESC as a way to clear the selection
  • passing key events to the Terminal should also clear the selection as they do now
  • what's a nice name for this?
    • persistSelectionOnCopy (default is false)

Originally thought of naming it clearSelectionOnCopy (default is true), but I've been told before that we should try and make the default false. So any thoughts as to what this setting could be called is much appreciated :) (for now I'm just going with the plan above).

EDIT: alternatively, persistentSelection or persistSelection? slightly shorter

@carlos-zamora
Copy link
Member

Here's a question:

if persistSelection is enabled, and a selection is active, what should we expect right-click to do?

  1. copy the selected text?
  2. paste what is on the clipboard?
  3. copy the selected text and paste what is on the clipboard? --> copyOnSelect

This makes me wonder if maybe a global setting isn't the right approach, and instead there should be a keybinding arg on 'copy'. Then, this could work more like a text editor, where...

  • you make a selection
  • you copy with your keybinding (selection persists)
  • you paste (selection gets cleared because text got sent to the terminal)

The only thing I dislike is that a user would have to add this keybinding arg to all of their copy keybindings. But, I think that's a small case with a minor annoyance.

@YAMLcase
Copy link

I feel like #9787 is related

@carlos-zamora carlos-zamora removed their assignment Sep 23, 2021
@zadjii-msft zadjii-msft added the Priority-2 A description (P2) label Jan 4, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, Backlog Jan 4, 2022
@zadjii-msft
Copy link
Member

From #13438

Should be fairly trivial to add a dismissSelection property to the copy action, defaults to true, and does what you'd expect. We should then change the enter keybinding to

        { "command": { "action": "copy", "singleLine": false, "dismissSelection": false }, "keys": "enter" },

er... maybe we don't change the defaults. Those would be the opposite of ConEmu

@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. good first issue This is a fix that might be easier for someone to do as a first contribution labels Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants