Merge pull request #62 from modelcontextprotocol/ani/fix-dosbox-more
Use detached: true on Windows
This commit is contained in:
commit
97cac5b65c
1 changed files with 15 additions and 1 deletions
|
|
@ -113,7 +113,17 @@ export class StdioClientTransport implements Transport {
|
|||
stdio: ["pipe", "pipe", this._serverParams.stderr ?? "inherit"],
|
||||
shell: false,
|
||||
signal: this._abortController.signal,
|
||||
},
|
||||
|
||||
// NB: The behavior of detached varies based on platform, and also
|
||||
// is different based on whether the process is a Win32 Subsystem
|
||||
// process or a Console Subsystem process. Strangely, the behavior
|
||||
// of detached is almost 1:1 the opposite in Electron+Windows vs
|
||||
// what is documented on the node.js website, and also is different
|
||||
// based on whether you launch Electron in a development environment
|
||||
// (i.e. via `electron-forge start`) vs a production environment
|
||||
// (i.e. YourApp.exe).
|
||||
detached: process.platform === "win32" && isElectron(),
|
||||
}
|
||||
);
|
||||
|
||||
this._process.on("error", (error) => {
|
||||
|
|
@ -187,3 +197,7 @@ export class StdioClientTransport implements Transport {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function isElectron() {
|
||||
return "type" in process;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue