提交 5d46df9c 编写于 作者: P pflannery

Response to configuration property name change

上级 ef72b65a
......@@ -29,24 +29,18 @@ configurationRegistry.registerConfiguration({
'title': nls.localize('terminalConfigurationTitle', "Terminal configuration"),
'type': 'object',
'properties': {
'terminal.windows': {
'description': nls.localize('terminal.windows', "Windows specific settings."),
'terminal.external': {
'description': nls.localize('terminal.external', "External terminal settings."),
'type': 'object',
'properties': {
'exec': {
'windowsExec': {
'type': 'string',
'description': nls.localize('terminal.windows.exec', "Customizes which terminal to run."),
'description': nls.localize('terminal.external.windowsExec', "Customizes which terminal to run on Windows."),
'default': DEFAULT_WINDOWS_TERM
}
}
},
'terminal.linux': {
'description': nls.localize('terminal.linux', "Linux specific settings."),
'type': 'object',
'properties': {
'exec': {
},
'linuxExec': {
'type': 'string',
'description': nls.localize('terminal.linux.exec', "Customizes which terminal to run."),
'description': nls.localize('terminal.external.linuxExec', "Customizes which terminal to on Linux."),
'default': DEFAULT_LINUX_TERM
}
}
......
......@@ -41,8 +41,8 @@ export class WinTerminalService implements ITerminalService {
}
private spawnTerminal(spawner, configuration, command: string, path: string, onExit, onError) {
let terminalConfig = configuration.terminal;
let exec = terminalConfig.windows.exec || DEFAULT_WINDOWS_TERM;
let terminalConfig = configuration.terminal.external;
let exec = terminalConfig.windowsExec || DEFAULT_WINDOWS_TERM;
let cmdArgs = ['/c', 'start', '/wait', exec];
let child = spawner.spawn(command, cmdArgs, { cwd: path });
......@@ -102,8 +102,8 @@ export class LinuxTerminalService implements ITerminalService {
}
private spawnTerminal(spawner, configuration, path: string, onExit, onError) {
let terminalConfig = configuration.terminal;
let exec = terminalConfig.linux.exec || DEFAULT_LINUX_TERM;
let terminalConfig = configuration.terminal.external;
let exec = terminalConfig.linuxExec || DEFAULT_LINUX_TERM;
const child = spawner.spawn(exec, [], { cwd: path });
child.on('error', onError);
child.on('exit', onExit);
......
......@@ -17,11 +17,9 @@ suite('Execution - TerminalService', () => {
setup(() => {
mockConfig = {
terminal: {
windows: {
exec: 'testWindowsShell'
},
linux: {
exec: 'testLinuxShell'
external: {
windowsExec: 'testWindowsShell',
linuxExec: 'testLinuxShell'
}
}
};
......@@ -36,7 +34,7 @@ suite('Execution - TerminalService', () => {
spawn: (command, args, opts) => {
// assert
equal(command, testShell, 'shell should equal expected');
equal(args[args.length - 1], mockConfig.terminal.windows.exec, 'terminal should equal expected')
equal(args[args.length - 1], mockConfig.terminal.external.windowsExec, 'terminal should equal expected')
equal(opts.cwd, testCwd, 'opts.cwd should equal expected');
done();
return {
......@@ -55,7 +53,7 @@ suite('Execution - TerminalService', () => {
);
});
test("WinTerminalService - uses default terminal when configuration.terminal.windows.exec is undefined", done => {
test("WinTerminalService - uses default terminal when configuration.terminal.external.windowsExec is undefined", done => {
let testShell = 'cmd';
let testCwd = 'path/to/workspace';
let mockSpawner = {
......@@ -68,7 +66,7 @@ suite('Execution - TerminalService', () => {
}
}
};
mockConfig.terminal.windows.exec = undefined;
mockConfig.terminal.external.windowsExec = undefined;
let testService = new WinTerminalService(mockConfig);
(<any>testService).spawnTerminal(
mockSpawner,
......@@ -85,7 +83,7 @@ suite('Execution - TerminalService', () => {
let mockSpawner = {
spawn: (command, args, opts) => {
// assert
equal(command, mockConfig.terminal.linux.exec, 'terminal should equal expected');
equal(command, mockConfig.terminal.external.linuxExec, 'terminal should equal expected');
equal(opts.cwd, testCwd, 'opts.cwd should equal expected');
done();
return {
......@@ -103,7 +101,7 @@ suite('Execution - TerminalService', () => {
);
});
test("LinuxTerminalService - uses default terminal when configuration.terminal.linux.exec is undefined", done => {
test("LinuxTerminalService - uses default terminal when configuration.terminal.external.linuxExec is undefined", done => {
let testCwd = 'path/to/workspace';
let mockSpawner = {
spawn: (command, args, opts) => {
......@@ -115,7 +113,7 @@ suite('Execution - TerminalService', () => {
}
}
};
mockConfig.terminal.linux.exec = undefined;
mockConfig.terminal.external.linuxExec = undefined;
let testService = new LinuxTerminalService(mockConfig);
(<any>testService).spawnTerminal(
mockSpawner,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册