Skip to content

Commit

Permalink
Do not fire env event if env has not changed
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykim1 committed Jan 8, 2025
1 parent 6b081da commit d555813
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ export class ShellEnvDetectionCapability extends Disposable implements IShellEnv
return;
}

let envChanged = false;
for (const [key, value] of Object.entries(env)) {
if (value !== this._env.get(key)) {
envChanged = true;
break;
}
}

if (!envChanged && this._env.size === Object.keys(env).length) {
return;
}

this._env.clear();
for (const [key, value] of Object.entries(env)) {
if (value !== undefined) {
Expand Down

0 comments on commit d555813

Please sign in to comment.