You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[terminal] (⌘K) was pressed. Waiting for second key of chord... #7240
*duplicateIssue identified as a duplicate of another issue(s)feature-requestRequest for new features or functionalitymacosIssues with VS Code on MAC/OS XterminalGeneral terminal issues that don't fall under another labelupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
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.
Reacted by Tadayoshi Sato, Jerry W. and Graham Ballantyne
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?
Reacted by Tadayoshi Sato, Yana Agun Siswanto, paramsingh88, Collin Henderson, Ben Babics, Graham Ballantyne and Dan
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.
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.
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!
*duplicateIssue identified as a duplicate of another issue(s)feature-requestRequest for new features or functionalitymacosIssues with VS Code on MAC/OS XterminalGeneral terminal issues that don't fall under another labelupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
Activity
Tyriar commentedon Jun 7, 2016
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.
Merott commentedon Jun 7, 2016
Daniel Imms (@Tyriar) I'm so used to the
⌘Kshortcut to clear the terminal on Mac, that I do it automatically without thinking. And I do it a lot.The
⌘Kcombination 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:
⌘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?
prashaantt commentedon Jun 7, 2016
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.
Tyriar commentedon Jun 7, 2016
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:
A
terminalFocusvalue seems like an ideal usage of thewhenproperty.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?
Merott commentedon Jun 7, 2016
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
⌘Kshortcut, to not initiate chord keybindings if it gets used as a normal shortcut. Then, the user can do this:With the updated
⌘Kbehaviour, the above would work just as you'd expect, and only in the context of the terminal. If you leave out thewhenproperty, your⌘Kchord 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,
⌘Kcan't be used as a keyboard shortcut, so the above would not be possible yet.Tyriar commentedon Jul 5, 2016
Upstream issue: xtermjs/xterm.js#118
jensvdh commentedon Jul 8, 2016
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!
Tyriar commentedon Jul 8, 2016
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.
Tyriar commentedon Sep 6, 2016
Closing in favor of #6603