提交 35e859e9 编写于 作者: D Daniel Imms

Enable integrated terminal on stable

上级 fba0ac8e
......@@ -5,7 +5,6 @@
import 'vs/css!./media/terminal.contribution';
import nls = require('vs/nls');
import product from 'vs/platform/product';
import {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
import {SyncActionDescriptor} from 'vs/platform/actions/common/actions';
import {registerSingleton} from 'vs/platform/instantiation/common/extensions';
......@@ -17,130 +16,127 @@ import * as panel from 'vs/workbench/browser/panel';
import {Registry} from 'vs/platform/platform';
import {Extensions, IConfigurationRegistry} from 'vs/platform/configuration/common/configurationRegistry';
// Only enable in the alpha channel until more stable
if (product.quality === 'alpha' || product.quality === 'insider') {
let configurationRegistry = <IConfigurationRegistry>Registry.as(Extensions.Configuration);
configurationRegistry.registerConfiguration({
'id': 'terminal',
'order': 100,
'title': nls.localize('integratedTerminalConfigurationTitle', "(Experimental) Integrated terminal configuration"),
'type': 'object',
'properties': {
'integratedTerminal.shell.unixLike': {
'description': nls.localize('integratedTerminal.shell.unixLike', "The path of the shell that the terminal uses on Linux and OS X."),
'type': 'string',
'default': TERMINAL_DEFAULT_SHELL_UNIX_LIKE
},
'integratedTerminal.shell.windows': {
'description': nls.localize('integratedTerminal.shell.windows', "The path of the shell that the terminal uses on Windows."),
'type': 'string',
'default': TERMINAL_DEFAULT_SHELL_WINDOWS
},
'integratedTerminal.fontFamily': {
'description': nls.localize('integratedTerminal.fontFamily', "The font family used by the terminal (CSS font-family format)."),
'type': 'string',
'default': 'Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback"'
},
'integratedTerminal.ansiColors.black': {
'description': nls.localize('integratedTerminal.ansiColors.black', "Black color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#000000'
},
'integratedTerminal.ansiColors.red': {
'description': nls.localize('integratedTerminal.ansiColors.red', "Red color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#cd3131'
},
'integratedTerminal.ansiColors.green': {
'description': nls.localize('integratedTerminal.ansiColors.green', "Green color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#09885a'
},
'integratedTerminal.ansiColors.yellow': {
'description': nls.localize('integratedTerminal.ansiColors.yellow', "Yellow color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e510'
},
'integratedTerminal.ansiColors.blue': {
'description': nls.localize('integratedTerminal.ansiColors.blue', "Blue color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0451a5'
},
'integratedTerminal.ansiColors.magenta': {
'description': nls.localize('integratedTerminal.ansiColors.magenta', "Magenta color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#bc05bc'
},
'integratedTerminal.ansiColors.cyan': {
'description': nls.localize('integratedTerminal.ansiColors.cyan', "Cyan color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0598bc'
},
'integratedTerminal.ansiColors.white': {
'description': nls.localize('integratedTerminal.ansiColors.white', "White color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e5e5'
},
'integratedTerminal.ansiColors.brightBlack': {
'description': nls.localize('integratedTerminal.ansiColors.brightBlack', "Bright black color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#000000'
},
'integratedTerminal.ansiColors.brightRed': {
'description': nls.localize('integratedTerminal.ansiColors.brightRed', "Bright red color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#cd3131'
},
'integratedTerminal.ansiColors.brightGreen': {
'description': nls.localize('integratedTerminal.ansiColors.brightGreen', "Bright green color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#09885a'
},
'integratedTerminal.ansiColors.brightYellow': {
'description': nls.localize('integratedTerminal.ansiColors.brightYellow', "Bright yellow color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e510'
},
'integratedTerminal.ansiColors.brightBlue': {
'description': nls.localize('integratedTerminal.ansiColors.brightBlue', "Bright blue color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0451a5'
},
'integratedTerminal.ansiColors.brightMagenta': {
'description': nls.localize('integratedTerminal.ansiColors.brightMagenta', "Bright magenta color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#bc05bc'
},
'integratedTerminal.ansiColors.brightCyan': {
'description': nls.localize('integratedTerminal.ansiColors.brightCyan', "Bright cyan color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0598bc'
},
'integratedTerminal.ansiColors.brightWhite': {
'description': nls.localize('integratedTerminal.ansiColors.brightWhite', "Bright white color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e5e5'
}
let configurationRegistry = <IConfigurationRegistry>Registry.as(Extensions.Configuration);
configurationRegistry.registerConfiguration({
'id': 'terminal',
'order': 100,
'title': nls.localize('integratedTerminalConfigurationTitle', "(Experimental) Integrated terminal configuration"),
'type': 'object',
'properties': {
'integratedTerminal.shell.unixLike': {
'description': nls.localize('integratedTerminal.shell.unixLike', "The path of the shell that the terminal uses on Linux and OS X."),
'type': 'string',
'default': TERMINAL_DEFAULT_SHELL_UNIX_LIKE
},
'integratedTerminal.shell.windows': {
'description': nls.localize('integratedTerminal.shell.windows', "The path of the shell that the terminal uses on Windows."),
'type': 'string',
'default': TERMINAL_DEFAULT_SHELL_WINDOWS
},
'integratedTerminal.fontFamily': {
'description': nls.localize('integratedTerminal.fontFamily', "The font family used by the terminal (CSS font-family format)."),
'type': 'string',
'default': 'Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback"'
},
'integratedTerminal.ansiColors.black': {
'description': nls.localize('integratedTerminal.ansiColors.black', "Black color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#000000'
},
'integratedTerminal.ansiColors.red': {
'description': nls.localize('integratedTerminal.ansiColors.red', "Red color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#cd3131'
},
'integratedTerminal.ansiColors.green': {
'description': nls.localize('integratedTerminal.ansiColors.green', "Green color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#09885a'
},
'integratedTerminal.ansiColors.yellow': {
'description': nls.localize('integratedTerminal.ansiColors.yellow', "Yellow color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e510'
},
'integratedTerminal.ansiColors.blue': {
'description': nls.localize('integratedTerminal.ansiColors.blue', "Blue color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0451a5'
},
'integratedTerminal.ansiColors.magenta': {
'description': nls.localize('integratedTerminal.ansiColors.magenta', "Magenta color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#bc05bc'
},
'integratedTerminal.ansiColors.cyan': {
'description': nls.localize('integratedTerminal.ansiColors.cyan', "Cyan color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0598bc'
},
'integratedTerminal.ansiColors.white': {
'description': nls.localize('integratedTerminal.ansiColors.white', "White color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e5e5'
},
'integratedTerminal.ansiColors.brightBlack': {
'description': nls.localize('integratedTerminal.ansiColors.brightBlack', "Bright black color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#000000'
},
'integratedTerminal.ansiColors.brightRed': {
'description': nls.localize('integratedTerminal.ansiColors.brightRed', "Bright red color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#cd3131'
},
'integratedTerminal.ansiColors.brightGreen': {
'description': nls.localize('integratedTerminal.ansiColors.brightGreen', "Bright green color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#09885a'
},
'integratedTerminal.ansiColors.brightYellow': {
'description': nls.localize('integratedTerminal.ansiColors.brightYellow', "Bright yellow color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e510'
},
'integratedTerminal.ansiColors.brightBlue': {
'description': nls.localize('integratedTerminal.ansiColors.brightBlue', "Bright blue color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0451a5'
},
'integratedTerminal.ansiColors.brightMagenta': {
'description': nls.localize('integratedTerminal.ansiColors.brightMagenta', "Bright magenta color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#bc05bc'
},
'integratedTerminal.ansiColors.brightCyan': {
'description': nls.localize('integratedTerminal.ansiColors.brightCyan', "Bright cyan color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#0598bc'
},
'integratedTerminal.ansiColors.brightWhite': {
'description': nls.localize('integratedTerminal.ansiColors.brightWhite', "Bright white color for terminals that support ANSI escape sequences (format: #rrggbb)"),
'type': 'string',
'default': '#e5e5e5'
}
});
}
});
// Register Service
registerSingleton(ITerminalService, TerminalService);
// Register Service
registerSingleton(ITerminalService, TerminalService);
// Register Output Panel
(<panel.PanelRegistry>Registry.as(panel.Extensions.Panels)).registerPanel(new panel.PanelDescriptor(
'vs/workbench/parts/terminal/electron-browser/terminalPanel',
'TerminalPanel',
TERMINAL_PANEL_ID,
nls.localize('terminal', "Terminal"),
'terminal'
));
// Register Output Panel
(<panel.PanelRegistry>Registry.as(panel.Extensions.Panels)).registerPanel(new panel.PanelDescriptor(
'vs/workbench/parts/terminal/electron-browser/terminalPanel',
'TerminalPanel',
TERMINAL_PANEL_ID,
nls.localize('terminal', "Terminal"),
'terminal'
));
// Register toggle output action globally
let actionRegistry = <IWorkbenchActionRegistry>Registry.as(ActionExtensions.WorkbenchActions);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleTerminalAction, ToggleTerminalAction.ID, ToggleTerminalAction.LABEL, {
primary: KeyMod.CtrlCmd | KeyCode.US_BACKTICK,
// on mac cmd+` is reserved to cycle between windows
mac: { primary: KeyMod.WinCtrl | KeyCode.US_BACKTICK }
}), 'View: ' + ToggleTerminalAction.LABEL, nls.localize('viewCategory', "View"));
}
\ No newline at end of file
// Register toggle output action globally
let actionRegistry = <IWorkbenchActionRegistry>Registry.as(ActionExtensions.WorkbenchActions);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleTerminalAction, ToggleTerminalAction.ID, ToggleTerminalAction.LABEL, {
primary: KeyMod.CtrlCmd | KeyCode.US_BACKTICK,
// on mac cmd+` is reserved to cycle between windows
mac: { primary: KeyMod.WinCtrl | KeyCode.US_BACKTICK }
}), 'View: ' + ToggleTerminalAction.LABEL, nls.localize('viewCategory', "View"));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册