Skip to content

Commit

Permalink
Multiple terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
marcsosduma committed Dec 2, 2023
1 parent 0fb2137 commit 3993858
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/mi2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3993858

Please sign in to comment.