Skip to content

Commit 0528b75

Browse files
committed
Make the terminal work in linux with gsettings available but no config set
1 parent d852acc commit 0528b75

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ node_js:
55
- '10'
66
- '8'
77
before_install:
8-
- sudo apt-get install p7zip-full
8+
- sudo apt-get install p7zip-full xterm
99
install:
1010
- npm install --global npm@4
1111
- npm install

src/interceptors/fresh-terminal.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ const getTerminalCommand = _.memoize(async (): Promise<SpawnArgs | null> => {
3030
}
3131
} else if (process.platform === 'linux') {
3232
if (GSettings.isAvailable()) {
33-
const defaultTerminal = GSettings.Key.findById(
33+
const gSettingsTerminalKey = GSettings.Key.findById(
3434
'org.gnome.desktop.default-applications.terminal', 'exec'
35-
).getValue();
35+
);
3636

37+
const defaultTerminal = gSettingsTerminalKey && gSettingsTerminalKey.getValue();
3738
if (defaultTerminal) return { command: defaultTerminal };
38-
} else if (await commandExists('xterm').catch(() => false)) {
39+
}
40+
41+
if (await commandExists('xterm').catch(() => false)) {
3942
return { command: 'xterm' };
4043
}
4144
} else if (process.platform === 'darwin') {

0 commit comments

Comments
 (0)