File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,17 @@ export class StdioClientTransport implements Transport {
113113 stdio : [ "pipe" , "pipe" , this . _serverParams . stderr ?? "inherit" ] ,
114114 shell : false ,
115115 signal : this . _abortController . signal ,
116- } ,
116+
117+ // NB: The behavior of detached varies based on platform, and also
118+ // is different based on whether the process is a Win32 Subsystem
119+ // process or a Console Subsystem process. Strangely, the behavior
120+ // of detached is almost 1:1 the opposite in Electron+Windows vs
121+ // what is documented on the node.js website, and also is different
122+ // based on whether you launch Electron in a development environment
123+ // (i.e. via `electron-forge start`) vs a production environment
124+ // (i.e. YourApp.exe).
125+ detached : process . platform === "win32" && isElectron ( ) ,
126+ }
117127 ) ;
118128
119129 this . _process . on ( "error" , ( error ) => {
@@ -187,3 +197,7 @@ export class StdioClientTransport implements Transport {
187197 } ) ;
188198 }
189199}
200+
201+ function isElectron ( ) {
202+ return "type" in process ;
203+ }
You can’t perform that action at this time.
0 commit comments