File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { ChildProcess , IOType , spawn } from "node:child_process" ;
2
2
import process from "node:process" ;
3
+ import { Stream } from "node:stream" ;
3
4
import { ReadBuffer , serializeMessage } from "../shared/stdio.js" ;
4
- import { JSONRPCMessage } from "../types.js" ;
5
5
import { Transport } from "../shared/transport.js" ;
6
- import { Stream } from "node:stream " ;
6
+ import { JSONRPCMessage } from "../types.js " ;
7
7
8
8
export type StdioServerParameters = {
9
9
/**
@@ -29,6 +29,13 @@ export type StdioServerParameters = {
29
29
* The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr.
30
30
*/
31
31
stderr ?: IOType | Stream | number ;
32
+
33
+ /**
34
+ * The working directory to use when spawning the process.
35
+ *
36
+ * If not specified, the current working directory will be inherited.
37
+ */
38
+ cwd ?: string ;
32
39
} ;
33
40
34
41
/**
@@ -114,6 +121,7 @@ export class StdioClientTransport implements Transport {
114
121
shell : false ,
115
122
signal : this . _abortController . signal ,
116
123
windowsHide : process . platform === "win32" && isElectron ( ) ,
124
+ cwd : this . _serverParams . cwd ,
117
125
}
118
126
) ;
119
127
You can’t perform that action at this time.
0 commit comments