@@ -142,20 +142,6 @@ export class TerminalManagerImpl implements TerminalManager {
142142 this . shellSetup . clear ( ) ;
143143 }
144144 }
145- if ( e . affectsConfiguration ( 'terminal.integrated.shellIntegration.enabled' ) ) {
146- traceInfo ( 'Shell integration setting changed, invalidating cache' ) ;
147- const updatedShellIntegrationSetting = await getShellIntegrationEnabledCache ( ) ;
148- if ( ! updatedShellIntegrationSetting ) {
149- const shells = new Set (
150- terminals ( )
151- . map ( ( t ) => identifyTerminalShell ( t ) )
152- . filter ( ( t ) => t !== 'unknown' ) ,
153- ) ;
154- if ( shells . size > 0 ) {
155- await this . handleSetupCheck ( shells ) ;
156- }
157- }
158- }
159145 } ) ,
160146 onDidChangeWindowState ( ( e ) => {
161147 this . hasFocus = e . focused ;
@@ -185,27 +171,22 @@ export class TerminalManagerImpl implements TerminalManager {
185171 ) ;
186172
187173 if ( shellIntegrationLikelyAvailable && ! shouldUseProfileActivation ( p . shellType ) ) {
188- // Shell integration available and NOT in WSL - skip setup
189- await p . teardownScripts ( ) ;
174+ // Shell integration available and NOT in WSL - skip setup.
175+ // NOTE: We intentionally do NOT teardown scripts here. If the user stays in
176+ // shellStartup mode, be less aggressive about clearing profile modifications.
190177 this . shellSetup . set ( p . shellType , true ) ;
191178 traceVerbose (
192- `Shell integration available for ${ p . shellType } (not WSL), skipping prompt, and profile modification .` ,
179+ `Shell integration likely available. Skipping setup of shell profile for ${ p . shellType } .` ,
193180 ) ;
194181 } else {
195- // WSL (regardless of integration) OR no shell integration - needs setup
182+ // WSL (regardless of integration) OR no/disabled shell integration - needs setup
196183 this . shellSetup . set ( p . shellType , false ) ;
197184 shellsToSetup . push ( p ) ;
198185 traceVerbose (
199- `Shell integration is NOT available. Shell profile for ${ p . shellType } is not setup.` ,
186+ `Shell integration is NOT available or disabled . Shell profile for ${ p . shellType } is not setup.` ,
200187 ) ;
201188 }
202189 } else if ( state === ShellSetupState . Setup ) {
203- if ( shellIntegrationLikelyAvailable && ! shouldUseProfileActivation ( p . shellType ) ) {
204- await p . teardownScripts ( ) ;
205- traceVerbose (
206- `Shell integration available for ${ p . shellType } , removed profile script in favor of shell integration.` ,
207- ) ;
208- }
209190 this . shellSetup . set ( p . shellType , true ) ;
210191 traceVerbose ( `Shell profile for ${ p . shellType } is setup.` ) ;
211192 } else if ( state === ShellSetupState . NotInstalled ) {
0 commit comments