diff --git a/src/mi2.ts b/src/mi2.ts index e0f509f..4b90fb1 100644 --- a/src/mi2.ts +++ b/src/mi2.ts @@ -1114,17 +1114,12 @@ export class MI2 extends EventEmitter implements IDebugger { return strCode; } - isTerminalInstalled(terminalCommand):boolean { + isTerminalInstalled(terminalCommand: string): boolean { try { - const command = `command -v ${terminalCommand} >/dev/null 2>/dev/null`; - const xterm_process = ChildProcess.spawn(command, { - detached: true, - stdio: 'ignore', - }); - xterm_process.unref(); - return true; + ChildProcess.execSync(`command -v ${terminalCommand}`); + return true; } catch (error) { - return false; + return false; } } @@ -1220,10 +1215,10 @@ export class MI2 extends EventEmitter implements IDebugger { this.createXtermTerminal(sleepVal, target); }else if(this.isTerminalInstalled("gnome-terminal")){ this.createGNOMETerminal(sleepVal, target); - }else if(this.isTerminalInstalled("konsole")){ - this.createKDETerminal(sleepVal, target); }else if(this.isTerminalInstalled("xfce4-terminal")){ this.createXFCETerminal(sleepVal, target); + }else if(this.isTerminalInstalled("konsole")){ + this.createKDETerminal(sleepVal, target); } } } else {