@@ -7,6 +7,7 @@ import { inject, injectable } from 'inversify';
77import  *  as  path  from  'path' ; 
88import  {  parse  }  from  'semver' ; 
99import  *  as  vscode  from  'vscode' ; 
10+ import  {  traceError  }  from  '../logger' ; 
1011import  {  IPlatformService  }  from  '../platform/types' ; 
1112import  {  ICurrentProcess ,  IPathUtils  }  from  '../types' ; 
1213import  {  OSType  }  from  '../utils/platform' ; 
@@ -50,9 +51,22 @@ export class ApplicationEnvironment implements IApplicationEnvironment {
5051 // tslint:disable-next-line:non-literal-require 
5152 return  this . packageJson . displayName ; 
5253 } 
54+  /** 
55+  * At the time of writing this API, the vscode.env.shell isn't officially released in stable version of VS Code. 
56+  * Using this in stable version seems to throw errors in VSC with messages being displayed to the user about use of 
57+  * unstable API. 
58+  * Solution - log and suppress the errors. 
59+  * @readonly  
60+  * @type  {(string | undefined) } 
61+  * @memberof  ApplicationEnvironment 
62+  */ 
5363 public  get  shell ( ) : string  |  undefined  { 
54-  // tslint:disable-next-line:no-any 
55-  return  ( vscode . env  as  any ) . shell ; 
64+  try  { 
65+  // tslint:disable-next-line:no-any 
66+  return  ( vscode . env  as  any ) . shell ; 
67+  }  catch  ( error )  { 
68+  traceError ( 'Unable to determine shell using VS Code API.' ,  error ) ; 
69+  } 
5670 } 
5771 // tslint:disable-next-line:no-any 
5872 public  get  packageJson ( ) : any  { 
0 commit comments