File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import { ChildProcess , IOType , spawn } from "node:child_process" ;
22import process from "node:process" ;
3+ import { Stream } from "node:stream" ;
34import { ReadBuffer , serializeMessage } from "../shared/stdio.js" ;
4- import { JSONRPCMessage } from "../types.js" ;
55import { Transport } from "../shared/transport.js" ;
6- import { Stream } from "node:stream " ;
6+ import { JSONRPCMessage } from "../types.js " ;
77
88export type StdioServerParameters = {
99 /**
@@ -29,6 +29,13 @@ export type StdioServerParameters = {
2929 * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr.
3030 */
3131 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 ;
3239} ;
3340
3441/**
@@ -114,6 +121,7 @@ export class StdioClientTransport implements Transport {
114121 shell : false ,
115122 signal : this . _abortController . signal ,
116123 windowsHide : process . platform === "win32" && isElectron ( ) ,
124+ cwd : this . _serverParams . cwd ,
117125 }
118126 ) ;
119127
You can’t perform that action at this time.
0 commit comments