@@ -27,7 +27,7 @@ function couldBeOutput(line: string) {
2727const trace = false ;
2828
2929export class MI2 extends EventEmitter implements IBackend {
30- constructor ( public application : string , public preargs : string [ ] , public extraargs : string [ ] ) {
30+ constructor ( public application : string , public preargs : string [ ] , public extraargs : string [ ] , public procEnv : any ) {
3131 super ( ) ;
3232 }
3333
@@ -37,7 +37,7 @@ export class MI2 extends EventEmitter implements IBackend {
3737 return new Promise ( ( resolve , reject ) => {
3838 this . isSSH = false ;
3939 let args = this . preargs . concat ( this . extraargs || [ ] ) ;
40- this . process = ChildProcess . spawn ( this . application , args , { cwd : cwd } ) ;
40+ this . process = ChildProcess . spawn ( this . application , args , { cwd : cwd , env : this . procEnv } ) ;
4141 this . process . stdout . on ( "data" , this . stdout . bind ( this ) ) ;
4242 this . process . stderr . on ( "data" , this . stderr . bind ( this ) ) ;
4343 this . process . on ( "exit" , ( ( ) => { this . emit ( "quit" ) ; } ) . bind ( this ) ) ;
@@ -193,7 +193,7 @@ export class MI2 extends EventEmitter implements IBackend {
193193 args = this . preargs ;
194194 } else
195195 args = args . concat ( [ executable , target ] , this . preargs ) ;
196- this . process = ChildProcess . spawn ( this . application , args , { cwd : cwd } ) ;
196+ this . process = ChildProcess . spawn ( this . application , args , { cwd : cwd , env : this . procEnv } ) ;
197197 this . process . stdout . on ( "data" , this . stdout . bind ( this ) ) ;
198198 this . process . stderr . on ( "data" , this . stderr . bind ( this ) ) ;
199199 this . process . on ( "exit" , ( ( ) => { this . emit ( "quit" ) ; } ) . bind ( this ) ) ;
@@ -222,7 +222,7 @@ export class MI2 extends EventEmitter implements IBackend {
222222 args = args . concat ( [ executable ] , this . preargs ) ;
223223 else
224224 args = this . preargs ;
225- this . process = ChildProcess . spawn ( this . application , args , { cwd : cwd } ) ;
225+ this . process = ChildProcess . spawn ( this . application , args , { cwd : cwd , env : this . procEnv } ) ;
226226 this . process . stdout . on ( "data" , this . stdout . bind ( this ) ) ;
227227 this . process . stderr . on ( "data" , this . stderr . bind ( this ) ) ;
228228 this . process . on ( "exit" , ( ( ) => { this . emit ( "quit" ) ; } ) . bind ( this ) ) ;
0 commit comments