Skip to content

Include Ctrl+C, Ctrl+V keybindings by default #3058

Closed

Description

@kzu

I've read the other "copy not working" bugs and the universal suggestion seems to be "just create your own keybinding".

It's quite puzzling for a Windows terminal to not come with the most commonly used Windows shortcuts ever.

I'd suggest these two are added to the product, and people can instead change (or remove them) if they wish. I guess that's a much more intuitive default.

For others wondering why they are missing, just add these two to your keybindings:

{ "command": "copy", "keys": ["ctrl+c"] },
{ "command": "paste", "keys": ["ctrl+v"] },

Just to add to the discussion: the built-in Terminal in VS Code supports this out of the box too, which is awesome.

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Oct 4, 2019
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Oct 4, 2019
  3. KirillOsenkov commented on Oct 4, 2019

    @KirillOsenkov
    Member

    cmd.exe didn't support these for years and finally added them quite recently. Even more puzzling to have these missing in the new one.

  4. ealsur commented on Oct 4, 2019

    @ealsur

    Copy and Paste was added in 0.3, if you installed 0.3 (or later), they were there by default. If you upgraded to 0.3, you needed to add them manually: https://devblogs.microsoft.com/commandline/windows-terminal-preview-v0-3-release/

    image

  5. pedroreys commented on Oct 4, 2019

    @pedroreys

    For the curious, here is the PR where they added the default keybindings for copy and paste and they discuss the challenges of using Ctrl+C by default.

    There is also #2285 that has extensive discussion about using Ctrl+C for copy vs emitting SIGINT.

  6. bradwilson commented on Oct 4, 2019

    @bradwilson

    Please don't do this. Ctrl+C already has meaning inside terminals that long outdates copy/paste.

  7. DHowett-MSFT commented on Oct 4, 2019

    @DHowett-MSFT
    Contributor

    Even more puzzling to have these missing in the new one.

    Please don't do this. Ctrl+C already has meaning inside terminals that long outdates copy/paste.

    This is a delightful vignette about why we have rebindable key actions, and why we don't want to be prescriptive with user experience where "terminal input" is concerned.

  8. DHowett-MSFT commented on Oct 7, 2019

    @DHowett-MSFT
    Contributor

    We can 100% bind Ctrl+C by default, now that we have support for passing through bindings that didn't trigger an action. We can 100% not bind Ctrl+V by default.

  9. KirillOsenkov commented on Oct 8, 2019

    @KirillOsenkov
    Member

    I know Ctrl+C cancels the current execution, but what does Ctrl+V do? Out of curiosity.

  10. sgreenmsft commented on Oct 10, 2019

    @sgreenmsft
    Member

    My (admittedly uneducated) guess is the percentage of users expecting Ctrl+V to result in paste is substantially larger than the percentage of users expecting Ctrl+V to result in "verbatim insert mode."

  11. added
    Area-SettingsIssues related to settings and customizability, for console or terminal
    and removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Oct 24, 2019
  12. 17 remaining items

  13. ghost closed this as completedin #5217on Apr 9, 2020
  14. ghost added a commit that references this issue on Apr 9, 2020
    c65de31
  15. ghost removed
    In-PRThis issue has a related PR
    on Apr 9, 2020
  16. ghost added
    Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.
    on Apr 9, 2020
  17. vadimkantorov commented on Apr 27, 2020

    @vadimkantorov

    Given that "Ctrl+C" is now default copy keybinding on new installations. how will standard "Ctrl+C" for SIGINT work?

    Imagine a long-running console program with some text selected and Ctrl+C typed. What will Windows Terminal do? Copy? Interrupt the program? Both? Carlos Zamora (@carlos-zamora)

  18. zadjii-msft commented on Apr 27, 2020

    @zadjii-msft
    Member
    • If the user is using the new keybindings:
      • If text is selected: Ctrl+c will copy the selected text.
      • If text is NOT selected: Ctrl+c will send a interrupt, the same way Ctrl+c usually behaves.

    If the user doesn't like that behavior, it's pretty trivial to remove the new Ctrl+c binding from their settings.json, and rely on the Ctrl+shift+c binding that's in defaults.json

  19. randomascii commented on Apr 27, 2020

    @randomascii

    Does Enter now copy text by default? I realized when switching from cmd.exe to the new terminal that I use that to copy text a lot. I'm not sure if there is any significant disadvantage to making that the default, and it seems that the new terminal should, where possible, ease the transition from cmd.exe.

  20. zadjii-msft commented on Apr 27, 2020

    @zadjii-msft
    Member

    Bruce Dawson (@randomascii) nope, but that is a lot less common of a scenario for our users then Ctrl+C for copy. There's a balance we need to strike between "keeping the old behavior of conhost" and "making space to create a better experience". For those of our users who actually do want copy on enter, adding it isn't terribly difficult:

            { "command": "copy", "keys": ["enter"] },

    but I'd bet most people weren't even aware that feature existed in the original conhost 😆

  21. rbreaves commented on May 31, 2020

    @rbreaves

    To be honest what I really wish is that I could change the rest of Windows to use ALT-C and ALT-V (or META-C and META-V) for copy/paste, which would not collide with most other uses but keep the control bindings available for terminal windows. I do understand why that's not practical -- given the fact that each application manages it's own key bindings.

    Garrett D'Amore (@gdamore) What you’ve suggested is actually the most practical thing in this thread. Checkout my https://github.com/rbreaves/kinto project.

    Daniel Cazzulino (@kzu)

  22. stewSquared commented on Jun 27, 2020

    @stewSquared

    Okay great. Now how do we disable this?

    -- sad linux user

    Edit: Nevermind. Found it in settings.json and deleted it.

  23. installwindows commented on Aug 5, 2020

    @installwindows

    Coming from Linux, it was confusing to ctrl-v in vim and see my last pasta. Had to google on how to get the standard behavior.

  24. churchid commented on Sep 24, 2020

    @churchid

    The problem with a terminal application commandeering these shortcuts is that when you run applications inside of the terminal and find yourself with a need to enter that key combination inside the terminal, your SOL. Registered voter against the new default, but I guess the change is in, so will go delete it.

  25. stewSquared commented on Sep 24, 2020

    @stewSquared

    the percentage of users expecting Ctrl+V to result in "verbatim insert mode."

    The fact people think this keybinding is obscure demonstrates ignorance. I recommend learning to use the standard keybindings before bashing them. (heh)

    What ctrl+v does depends on what terminal application is running. For people who use terminals on a daily basis, this usually means "page down" for pagers and editors (reading a man page, emacs, vim). alt-v is usually page up. Counter to your intuition, this is quite frequently used.

    At this point, why not steal the keybindings for ctrl-a, ctrl-t, and crtl-w, since windows users expect them to be select all, new tab, and close tab? The fact is, these are also very useful keybindings in terminal applications. We should encourage people to leave their comfort zone and learn the terminal, instead of defaulting to a Frankenstein with inconsistent exceptions.

  26. locked as too heated and limited conversation to collaborators on Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsIssues related to settings and customizability, for console or terminalGathering-DataWe'd like to gather telemetry to influence our decisionIssue-QuestionFor questions or discussionProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions