Skip to content

Commit 00d2c0a

Browse files
committed
Remove debris if shell integration is available
1 parent 5ce1f78 commit 00d2c0a

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/features/terminal/shells/bash/bashStartup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ async function isStartupSetup(profile: string, key: string): Promise<ShellSetupS
7171

7272
async function setupStartup(profile: string, key: string, name: string): Promise<boolean> {
7373
if (shellIntegrationForActiveTerminal(name, profile)) {
74+
removeStartup(profile, key);
7475
return true;
7576
}
7677
const activationContent = getActivationContent(key);
77-
7878
try {
7979
if (await fs.pathExists(profile)) {
8080
const content = await fs.readFile(profile, 'utf8');

src/features/terminal/shells/fish/fishStartup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async function isStartupSetup(profilePath: string, key: string): Promise<boolean
5959
async function setupStartup(profilePath: string, key: string): Promise<boolean> {
6060
try {
6161
if (shellIntegrationForActiveTerminal('fish', profilePath)) {
62+
removeFishStartup(profilePath, key);
6263
return true;
6364
}
6465
const activationContent = getActivationContent(key);

src/features/terminal/shells/pwsh/pwshStartup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ async function isPowerShellStartupSetup(shell: string, profile: string): Promise
146146

147147
async function setupPowerShellStartup(shell: string, profile: string): Promise<boolean> {
148148
if (shellIntegrationForActiveTerminal(shell, profile)) {
149+
removePowerShellStartup(shell, profile);
149150
return true;
150151
}
151152
const activationContent = getActivationContent();

0 commit comments

Comments
 (0)