@@ -3,11 +3,12 @@ import * as path from 'path';
33import * as os from 'os' ;
44import { ShellScriptEditState , ShellSetupState , ShellStartupProvider } from './startupProvider' ;
55import { EnvironmentVariableCollection } from 'vscode' ;
6- import { PythonCommandRunConfiguration , PythonEnvironment , TerminalShellType } from '../../../api' ;
6+ import { PythonCommandRunConfiguration , PythonEnvironment } from '../../../api' ;
77import { getActivationCommandForShell } from '../../common/activation' ;
88import { quoteArgs } from '../../execution/execUtils' ;
99import { traceError , traceInfo , traceVerbose } from '../../../common/logging' ;
1010import which from 'which' ;
11+ import { ShellConstants } from '../../common/shellConstants' ;
1112
1213async function isBashLikeInstalled ( ) : Promise < boolean > {
1314 const result = await Promise . all ( [ which ( 'bash' , { nothrow : true } ) , which ( 'sh' , { nothrow : true } ) ] ) ;
@@ -245,7 +246,7 @@ export class BashStartupProvider implements ShellStartupProvider {
245246
246247 async updateEnvVariables ( collection : EnvironmentVariableCollection , env : PythonEnvironment ) : Promise < void > {
247248 try {
248- const bashActivation = getActivationCommandForShell ( env , TerminalShellType . bash ) ;
249+ const bashActivation = getActivationCommandForShell ( env , ShellConstants . BASH ) ;
249250 if ( bashActivation ) {
250251 const command = getCommandAsString ( bashActivation ) ;
251252 collection . replace ( this . bashActivationEnvVarKey , command ) ;
@@ -268,7 +269,7 @@ export class BashStartupProvider implements ShellStartupProvider {
268269 }
269270
270271 try {
271- const bashActivation = getActivationCommandForShell ( env , TerminalShellType . bash ) ;
272+ const bashActivation = getActivationCommandForShell ( env , ShellConstants . BASH ) ;
272273 return bashActivation
273274 ? new Map ( [ [ this . bashActivationEnvVarKey , getCommandAsString ( bashActivation ) ] ] )
274275 : undefined ;
@@ -338,7 +339,7 @@ export class ZshStartupProvider implements ShellStartupProvider {
338339
339340 async updateEnvVariables ( envVars : EnvironmentVariableCollection , env : PythonEnvironment ) : Promise < void > {
340341 try {
341- const zshActivation = getActivationCommandForShell ( env , TerminalShellType . zsh ) ;
342+ const zshActivation = getActivationCommandForShell ( env , ShellConstants . ZSH ) ;
342343 if ( zshActivation ) {
343344 const command = getCommandAsString ( zshActivation ) ;
344345 envVars . replace ( this . zshActivationEnvVarKey , command ) ;
@@ -361,7 +362,7 @@ export class ZshStartupProvider implements ShellStartupProvider {
361362 }
362363
363364 try {
364- const zshActivation = getActivationCommandForShell ( env , TerminalShellType . zsh ) ;
365+ const zshActivation = getActivationCommandForShell ( env , ShellConstants . ZSH ) ;
365366 return zshActivation
366367 ? new Map ( [ [ this . zshActivationEnvVarKey , getCommandAsString ( zshActivation ) ] ] )
367368 : undefined ;
@@ -429,7 +430,7 @@ export class GitBashStartupProvider implements ShellStartupProvider {
429430 }
430431 async updateEnvVariables ( envVars : EnvironmentVariableCollection , env : PythonEnvironment ) : Promise < void > {
431432 try {
432- const bashActivation = getActivationCommandForShell ( env , TerminalShellType . gitbash ) ;
433+ const bashActivation = getActivationCommandForShell ( env , ShellConstants . GITBASH ) ;
433434 if ( bashActivation ) {
434435 const command = getCommandAsString ( bashActivation ) ;
435436 envVars . replace ( this . gitBashActivationEnvVarKey , command ) ;
@@ -450,7 +451,7 @@ export class GitBashStartupProvider implements ShellStartupProvider {
450451 }
451452
452453 try {
453- const zshActivation = getActivationCommandForShell ( env , TerminalShellType . zsh ) ;
454+ const zshActivation = getActivationCommandForShell ( env , ShellConstants . GITBASH ) ;
454455 return zshActivation
455456 ? new Map ( [ [ this . gitBashActivationEnvVarKey , getCommandAsString ( zshActivation ) ] ] )
456457 : undefined ;
0 commit comments