@@ -39,12 +39,16 @@ export class TerminalService implements ITerminalService, Disposable {
3939 public async sendCommand ( command : string , args : string [ ] , _ ?: CancellationToken ) : Promise < void > {
4040 await this . ensureTerminal ( ) ;
4141 const text = this . terminalHelper . buildCommandForTerminal ( this . terminalShellType , command , args ) ;
42- this . terminal ! . show ( true ) ;
42+ if ( ! this . options ?. hideFromUser ) {
43+ this . terminal ! . show ( true ) ;
44+ }
4345 this . terminal ! . sendText ( text , true ) ;
4446 }
4547 public async sendText ( text : string ) : Promise < void > {
4648 await this . ensureTerminal ( ) ;
47- this . terminal ! . show ( true ) ;
49+ if ( ! this . options ?. hideFromUser ) {
50+ this . terminal ! . show ( true ) ;
51+ }
4852 this . terminal ! . sendText ( text ) ;
4953 }
5054 public async show ( preserveFocus : boolean = true ) : Promise < void > {
@@ -56,18 +60,21 @@ export class TerminalService implements ITerminalService, Disposable {
5660 return ;
5761 }
5862 this . terminalShellType = this . terminalHelper . identifyTerminalShell ( this . terminal ) ;
59- this . terminal = this . terminalManager . createTerminal ( { name : this . options ?. title || 'Python' , env : this . options ?. env } ) ;
63+ this . terminal = this . terminalManager . createTerminal ( { name : this . options ?. title || 'Python' , env : this . options ?. env , hideFromUser : this . options ?. hideFromUser } ) ;
6064
6165 // Sometimes the terminal takes some time to start up before it can start accepting input.
6266 await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
6367
6468 await this . terminalActivator . activateEnvironmentInTerminal ( this . terminal ! , {
6569 resource : this . options ?. resource ,
6670 preserveFocus,
67- interpreter : this . options ?. interpreter
71+ interpreter : this . options ?. interpreter ,
72+ hideFromUser : this . options ?. hideFromUser
6873 } ) ;
6974
70- this . terminal ! . show ( preserveFocus ) ;
75+ if ( ! this . options ?. hideFromUser ) {
76+ this . terminal ! . show ( preserveFocus ) ;
77+ }
7178
7279 this . sendTelemetry ( ) . ignoreErrors ( ) ;
7380 }
0 commit comments