@@ -36,7 +36,10 @@ export class Commands {
3636 /**
3737 * Create and run command in a new shell. Allows you to listen to the output and kill the command.
3838 */
39- async runBackground ( command : string | string [ ] , opts ?: ShellRunOpts ) {
39+ async runBackground (
40+ command : string | string [ ] ,
41+ opts ?: Omit < ShellRunOpts , "name" >
42+ ) {
4043 const disposableStore = new DisposableStore ( ) ;
4144 const onOutput = new Emitter < string > ( ) ;
4245 disposableStore . add ( onOutput ) ;
@@ -64,9 +67,11 @@ export class Commands {
6467 true
6568 ) ;
6669
67- if ( opts ?. name ) {
68- this . pitcherClient . clients . shell . rename ( shell . shellId , opts . name ) ;
69- }
70+ // Only way for us to differentiate between a command and a terminal
71+ this . pitcherClient . clients . shell . rename (
72+ shell . shellId ,
73+ `COMMAND-${ shell . shellId } `
74+ ) ;
7075
7176 const cmd = new Command (
7277 this . pitcherClient ,
@@ -92,7 +97,10 @@ export class Commands {
9297 const shells = this . pitcherClient . clients . shell . getShells ( ) ;
9398
9499 return shells
95- . filter ( ( shell ) => shell . shellType === "COMMAND" )
100+ . filter (
101+ ( shell ) =>
102+ shell . shellType === "TERMINAL" && shell . name . startsWith ( "COMMAND-" )
103+ )
96104 . map ( ( shell ) => new Command ( this . pitcherClient , shell ) ) ;
97105 }
98106}
@@ -120,21 +128,14 @@ export class Command {
120128
121129 private output : string [ ] = [ ] ;
122130
123- /**
124- * The command that was run.
125- */
126- get command ( ) : string {
127- return this . shell . startCommand ;
128- }
129-
130131 /**
131132 * The status of the command.
132133 */
133134 status : CommandStatus = "RUNNING" ;
134135
135136 constructor (
136137 private pitcherClient : IPitcherClient ,
137- private shell : protocol . shell . CommandShellDTO & { buffer ?: string [ ] }
138+ private shell : protocol . shell . ShellDTO & { buffer ?: string [ ] }
138139 ) {
139140 this . disposable . addDisposable (
140141 pitcherClient . clients . shell . onShellExited ( ( { shellId, exitCode } ) => {
0 commit comments