Steps to Reproduce:
鈱楰 is a recognised shortcut for clearing out the terminal on the Mac, but here it also conflicts with Code's other key bindings.
I don't think 鈱楰 would be a good default because it would conflict with the chord keybindings. I'm going to close this off as a duplicate of https://github.com/Microsoft/vscode/issues/6603 which will allow you to set your own keybinding for clearing the terminal.
@Tyriar I'm so used to the 鈱楰 shortcut to clear the terminal on Mac, that I do it automatically without thinking. And I do it a lot.
The 鈱楰 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:
鈱楰, 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?
Thanks @Merott for chiming in. I use 鈱楰 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.
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 鈱楰?
@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 鈱楰 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 鈱楰 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 鈱楰 chord bindings will stop altogether. It's not wise, but it's a choice.
Thanks @Tyriar for reopening the issue. And to answer your question, it seems that as of right now, 鈱楰 can't be used as a keyboard shortcut, so the above would not be possible yet.
Upstream issue: https://github.com/sourcelair/xterm.js/issues/118
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!
@jensvdh https://github.com/sourcelair/xterm.js/issues/118 will probably fix the issue without requiring a terminalFocus event, I'm hoping to get this done for July.
Closing in favor of #6603
Most helpful comment
@Tyriar I'm so used to the
鈱楰shortcut to clear the terminal on Mac, that I do it automatically without thinking. And I do it a lot.The
鈱楰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:
鈱楰, 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?