Introduce allowChords setting

Fixes #44764
This commit is contained in:
Daniel Imms
2019-10-08 09:45:22 -07:00
parent 4fe9987925
commit 877ce7ac03
3 changed files with 8 additions and 1 deletions
@@ -251,6 +251,11 @@ configurationRegistry.registerConfiguration({
},
default: []
},
'terminal.integrated.allowChords': {
markdownDescription: nls.localize('terminal.integrated.allowChords', "Whether or not to allow chord keybindings in the terminal. Note that when this is true and the keystroke results in a chord it will bypass `terminal.integrated.commandsToSkipShell`, setting this to false is particularly useful when you want ctrl+k to go to your shell (not VS Code)."),
type: 'boolean',
default: true
},
'terminal.integrated.inheritEnv': {
markdownDescription: nls.localize('terminal.integrated.inheritEnv', "Whether new shells should inherit their environment from VS Code. This is not supported on Windows."),
type: 'boolean',
@@ -576,7 +576,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
// within commandsToSkipShell
const standardKeyboardEvent = new StandardKeyboardEvent(event);
const resolveResult = this._keybindingService.softDispatch(standardKeyboardEvent, standardKeyboardEvent.target);
if (resolveResult && (resolveResult.enterChord || this._skipTerminalCommands.some(k => k === resolveResult.commandId))) {
const allowChords = resolveResult && resolveResult.enterChord && this._configHelper.config.allowChords;
if (allowChords || resolveResult && this._skipTerminalCommands.some(k => k === resolveResult.commandId)) {
event.preventDefault();
return false;
}
@@ -101,6 +101,7 @@ export interface ITerminalConfiguration {
detectLocale: 'auto' | 'off' | 'on';
scrollback: number;
commandsToSkipShell: string[];
allowChords: boolean;
cwd: string;
confirmOnExit: boolean;
enableBell: boolean;