Make cmd+k clear terminal on Mac

Fixes #12585
This commit is contained in:
Daniel Imms 2016-11-22 17:49:31 -08:00
parent c6566148cf
commit cbc0c0e66c
3 changed files with 9 additions and 5 deletions

View file

@ -97,12 +97,13 @@
"command": "markdown.showPreview",
"key": "shift+ctrl+v",
"mac": "shift+cmd+v",
"when": "!terminalFocus"
"when": "editorFocus"
},
{
"command": "markdown.showPreviewToSide",
"key": "ctrl+k v",
"mac": "cmd+k v"
"mac": "cmd+k v",
"when": "editorFocus"
}
],
"snippets": [

View file

@ -296,7 +296,7 @@ export class KeybindingResolver {
}
public resolve(context: any, currentChord: number, keypress: number): IResolveResult {
// console.log('resolve: ' + Keybinding.toLabel(keypress));
// console.log('resolve: ' + Keybinding.toUserSettingsLabel(keypress));
let lookupMap: ICommandEntry[] = null;
if (currentChord !== 0) {
@ -411,7 +411,7 @@ export class IOSupport {
} else {
out.write(`${quotedSerializeCommand} `);
}
// out.write(String(item.weight));
// out.write(String(item.weight1 + '-' + item.weight2));
out.write('}');
}

View file

@ -22,6 +22,7 @@ import { TerminalService } from 'vs/workbench/parts/terminal/electron-browser/te
import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import debugActions = require('vs/workbench/parts/debug/browser/debugActions');
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
let configurationRegistry = <IConfigurationRegistry>Registry.as(Extensions.Configuration);
configurationRegistry.registerConfiguration({
@ -200,4 +201,6 @@ actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ScrollToTopTermi
primary: KeyMod.CtrlCmd | KeyCode.Home,
linux: { primary: KeyMod.Shift | KeyCode.Home }
}, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Scroll to Top', category);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ClearTerminalAction, ClearTerminalAction.ID, ClearTerminalAction.LABEL), 'Terminal: Clear', category);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ClearTerminalAction, ClearTerminalAction.ID, ClearTerminalAction.LABEL, {
primary: KeyMod.CtrlCmd | KeyCode.KEY_K
}, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KeybindingsRegistry.WEIGHT.workbenchContrib(1)), 'Terminal: Clear', category);