Skip to content

[terminal] (⌘K) was pressed. Waiting for second key of chord... #7240

Closed

Description

  • VSCode Version: 1.2.0-insider
  • OS Version: OS X 10.11.5

Steps to Reproduce:

  1. Press ⌘K to clear the integrated terminal.
  2. The terminal gets cleared.
  3. VS Code is still waiting for the second key of the ⌘K chord.

⌘K is a recognised shortcut for clearing out the terminal on the Mac, but here it also conflicts with Code's other key bindings.

Activity

  1. Tyriar commented on Jun 7, 2016

    @Tyriar
    Contributor

    I don't think ⌘K would be a good default because it would conflict with the chord keybindings. I'm going to close this off as a duplicate of #6603 which will allow you to set your own keybinding for clearing the terminal.

  2. Merott commented on Jun 7, 2016

    @Merott

    Daniel Imms (@Tyriar) I'm so used to the ⌘K shortcut to clear the terminal on Mac, that I do it automatically without thinking. And I do it a lot.

    The ⌘K combination is even recognised in the Chrome DevTools Console for clearing the output - yet another reason that I'm so used to it.

    I realise I may not be alone in this, so I have a suggestion:

    • As per your suggestion, set the default "Clear Terminal" shortcut to something that won't conflict with another shortcut, especially the chord keybindings.
    • If the user decides to override the default shortcut with ⌘K, make sure that VSCode does not consider that as initiation of a chord keybinding.

    This way, there won't be a conflict by default, but the user can opt to lose chord keybindings when in the context of the terminal, in favour of using the well-recognised shortcut.

    Would you mind to reopen the issue to make it easier to find, and to continue the discussion?

  3. prashaantt commented on Jun 7, 2016

    @prashaantt
    Author

    Thanks Merott Movahedi (@Merott) for chiming in. I use ⌘K very heavily too.

    I would love to take this discussion to a point where it might be possible to detach the default bindings whenever the terminal is in focus (except perhaps one shortcut to focus back on the workbench) and only retain the platform-level shortcuts that deal specifically with the terminal. I'm not sure if that's possible, but I suppose that would be most ideal.

  4. Tyriar commented on Jun 7, 2016

    @Tyriar
    Contributor

    I can definitely sympathize, I'm not going to be happy unless I copy and paste in the terminal using ctrl+shift+c and ctrl+shift+v for example.

    I'm not sure how the chord keybindings work exactly and what can override them, but there are conditions you can attach to keybindings, for example:

    { "key": "escape",                "command": "cancelSelection",
                                         "when": "editorHasSelection && editorTextFocus" },
    

    A terminalFocus value seems like an ideal usage of the when property.

    You can also unbind keybindings as of v1.2.0 which is another possible remedy.

    So it's not possible right now to bind anything to ⌘K?

  5. added
    feature-request
    on Jun 7, 2016
  6. added
    terminal
    on Jun 7, 2016
  7. Merott commented on Jun 7, 2016

    @Merott

    Prashant Tiwari (@prashaantt) - I came to Github the log this issue myself, but I found this one 👍 - It shouldn't be necessary to disable all keybindings in terminal. In fact, I wouldn't want that.

    This can really be simplified to changing the behaviour of the ⌘K shortcut, to not initiate chord keybindings if it gets used as a normal shortcut. Then, the user can do this:

    {
        "key": "cmd+k",
        "command": "terminal.action.clear",  // does not exist today
        "when": "terminalFocus"              // does not exist today
      }

    With the updated ⌘K behaviour, the above would work just as you'd expect, and only in the context of the terminal. If you leave out the when property, your ⌘K chord bindings will stop altogether. It's not wise, but it's a choice.

    Thanks Daniel Imms (@Tyriar) for reopening the issue. And to answer your question, it seems that as of right now, ⌘K can't be used as a keyboard shortcut, so the above would not be possible yet.

  8. Tyriar commented on Jul 5, 2016

    @Tyriar
    Contributor

    Upstream issue: xtermjs/xterm.js#118

  9. added
    upstream
    macos
    on Jul 5, 2016
  10. jensvdh commented on Jul 8, 2016

    @jensvdh

    Any of idea of what it would take to implement a "terminalFocus" when condition? Would love to contribute to get this issue solved. I hit cmd+k quite a lot out of habit!

  11. Tyriar commented on Jul 8, 2016

    @Tyriar
    Contributor

    Jens Vanderhaeghe (@jensvdh) xtermjs/xterm.js#118 will probably fix the issue without requiring a terminalFocus event, I'm hoping to get this done for July.

  12. added this to the July 2016 milestone on Jul 8, 2016
  13. Tyriar commented on Sep 6, 2016

    @Tyriar
    Contributor

    Closing in favor of #6603

  14. added
    *duplicate
    on Sep 6, 2016
  15. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicatefeature-requestmacosterminalupstream

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions