askme-cli
Version:
askme-cli MCP server that collects user's next plan or confirmation through terminal window
20 lines • 866 B
JavaScript
import open from "open";
import { getTerminalApp } from "../config/index.js";
import { cleanupSocket } from "./socket.js";
// Launch terminal app (supports multiple terminals)
export const launchTerminal = (scriptFile, socketPath) => {
return new Promise((resolve, reject) => {
const terminalConfig = getTerminalApp();
console.error(`🖥️ Using terminal app: ${terminalConfig.name}`);
// Use open library to open script file
open(scriptFile, { app: { name: terminalConfig.name } })
.then(() => {
resolve();
})
.catch((error) => {
cleanupSocket(socketPath);
reject(new Error(`Cannot open ${terminalConfig.name}: ${error.message}. Please make sure ${terminalConfig.name} terminal app is installed.`));
});
});
};
//# sourceMappingURL=terminal.js.map