Skip to content

Commit e4491ac

Browse files
committed
Fix gnome-terminal detection
Previously, this didn't wait for the promise, so we always used gnome-terminal on Linux, if GSetting were available, even if it wasn't really available
1 parent 6446916 commit e4491ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/interceptors/fresh-terminal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { reportError } from '../error-tracking';
1515
const checkAccess = util.promisify(fs.access);
1616
const canAccess = (path: string) => checkAccess(path).then(() => true).catch(() => false);
1717

18-
const commandExists = (path: string) => ensureCommandExists(path).then(() => true).catch(() => false);
18+
const commandExists = (path: string): Promise<boolean> => ensureCommandExists(path).then(() => true).catch(() => false);
1919

2020
const DEFAULT_GIT_BASH_PATH = 'C:/Program Files/git/git-bash.exe';
2121

@@ -41,7 +41,7 @@ const getTerminalCommand = _.memoize(async (): Promise<SpawnArgs | null> => {
4141
);
4242

4343
const defaultTerminal = gSettingsTerminalKey && gSettingsTerminalKey.getValue();
44-
if (defaultTerminal && commandExists(defaultTerminal)) {
44+
if (defaultTerminal && await commandExists(defaultTerminal)) {
4545
return { command: defaultTerminal };
4646
}
4747
}

0 commit comments

Comments
 (0)