Skip to content

Commit 937fc8b

Browse files
committed
clean code
1 parent 9277ec8 commit 937fc8b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/features/terminal/terminalManager.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,11 @@ export class TerminalManagerImpl implements TerminalManager {
147147
const shellsToSetup: ShellStartupScriptProvider[] = [];
148148
await Promise.all(
149149
providers.map(async (p) => {
150+
const state = await p.isSetup();
150151
if (this.shellSetup.has(p.shellType)) {
151152
// This ensures modified scripts are detected even after initial setup
152-
const currentState = await p.isSetup();
153153
const cachedSetup = this.shellSetup.get(p.shellType);
154-
155-
if ((currentState === ShellSetupState.Setup) !== cachedSetup) {
154+
if ((state === ShellSetupState.Setup) !== cachedSetup) {
156155
traceVerbose(`Shell profile for ${p.shellType} state changed, updating cache.`);
157156
// State changed - clear cache and re-evaluate
158157
this.shellSetup.delete(p.shellType);
@@ -162,7 +161,6 @@ export class TerminalManagerImpl implements TerminalManager {
162161
}
163162
}
164163
traceVerbose(`Checking shell profile for ${p.shellType}.`);
165-
const state = await p.isSetup();
166164
if (state === ShellSetupState.NotSetup) {
167165
if (shellIntegrationForActiveTerminal(p.name)) {
168166
await p.teardownScripts();

0 commit comments

Comments
 (0)