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

Enable integrated terminal on stable

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