-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds custom terminal launch settings #3495
Changes from 1 commit
2695f19
abe8d12
aa17b93
aa3f8d7
c84a715
ef72b65
5d46df9
58317c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,14 @@ | |
import fs = require('fs'); | ||
import env = require('vs/base/common/platform'); | ||
|
||
export let defaultLinuxTerm = 'x-terminal-emulator'; | ||
export let DEFAULT_LINUX_TERM = 'x-terminal-emulator'; | ||
|
||
// if we're not on debian and using gnome then | ||
// set default to gnome-terminal | ||
if (env.isLinux | ||
&& fs.existsSync('/etc/debian_version') === false | ||
&& process.env.DESKTOP_SESSION === 'gnome') { | ||
defaultLinuxTerm = 'gnome-terminal'; | ||
DEFAULT_LINUX_TERM = 'gnome-terminal'; | ||
} | ||
|
||
export const defaultWindowsTerm = 'cmd'; | ||
export const DEFAILT_WINDOWS_TERM = 'cmd'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo DEFAULT |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import uri from 'vs/base/common/uri'; | |
import {TPromise} from 'vs/base/common/winjs.base'; | ||
import {ITerminalService} from 'vs/workbench/parts/execution/common/execution'; | ||
import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; | ||
import {defaultWindowsTerm, defaultLinuxTerm} from 'vs/workbench/parts/execution/common/terminal'; | ||
import {DEFAILT_WINDOWS_TERM, DEFAULT_LINUX_TERM} from 'vs/workbench/parts/execution/electron-browser/terminal'; | ||
|
||
import cp = require('child_process'); | ||
import processes = require('vs/base/node/processes'); | ||
|
@@ -42,7 +42,7 @@ export class WinTerminalService implements ITerminalService { | |
|
||
private spawnTerminal(spawner, configuration, command: string, path: string, onExit, onError) { | ||
let terminalConfig = configuration.terminal; | ||
let exec = terminalConfig.windows.exec || defaultWindowsTerm; | ||
let exec = terminalConfig.windows.exec || DEFAILT_WINDOWS_TERM; | ||
let cmdArgs = ['/c', 'start', '/wait', exec]; | ||
|
||
let child = spawner.spawn(command, cmdArgs, { cwd: path }); | ||
|
@@ -103,7 +103,7 @@ export class LinuxTerminalService implements ITerminalService { | |
|
||
private spawnTerminal(spawner, configuration, path: string, onExit, onError) { | ||
let terminalConfig = configuration.terminal; | ||
let exec = terminalConfig.linux.exec || defaultLinuxTerm; | ||
let exec = terminalConfig.linux.exec || DEFAULT_LINUX_TERM; | ||
const child = spawner.spawn(exec, [], { cwd: path }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does just setting the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. node runs |
||
child.on('error', onError); | ||
child.on('exit', onExit); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you thought about how the settings should be named given that the eventual integrated terminal #143 will likely have a set of settings as well? Maybe something like
terminal.external...
andterminal.integrated...
or something?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tyriar This wasn't related to #143. This just solved the hard coded terminal issue for windows and Linux.
Imo I would of thought #143 would be better as extension.
I can change the name if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just forward thinking, I'm currently experimenting with the integrated terminal so I want to make sure the settings have good names to prevent changes/inconsistencies in the future. I'm thinking lets rename them to this for now:
I'll see what @joaomoreno thinks of the naming later