Skip to content

Commit 912f5a7

Browse files
DonJayamannekimadeline
authored andcommitted
Run fish activation scripts with source instead of `. (#7541)
* Revert "Fixes to sourcing of fish scripts in terminal (#7387)" This reverts commit 40a1d04. * News entry * Remove news entry
1 parent 9dec031 commit 912f5a7

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

news/2 Fixes/7343.md

-1
This file was deleted.

src/client/common/terminal/environmentActivationProviders/bash.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ export class Bash extends BaseActivationCommandProvider {
2727
if (!scriptFile) {
2828
return;
2929
}
30-
if (targetShell === TerminalShellType.fish) {
31-
return [`. ${scriptFile.fileToCommandArgument()}`];
32-
} else {
33-
return [`source ${scriptFile.fileToCommandArgument()}`];
34-
}
30+
return [`source ${scriptFile.fileToCommandArgument()}`];
3531
}
3632

3733
private getScriptsInOrderOfPreference(targetShell: TerminalShellType): string[] {

src/test/common/terminals/activation.bash.unit.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ suite('Terminal Environment Activation (bash)', () => {
8989
const command = await bash.getActivationCommands(undefined, shellType.value);
9090

9191
if (isScriptFileSupported) {
92-
const sourceCmd = shellType.value === TerminalShellType.fish ? '.' : 'source';
9392
// Ensure the script file is of the following form:
9493
// source "<path to script file>" <environment name>
9594
// Ensure the path is quoted if it contains any spaces.
9695
// Ensure it contains the name of the environment as an argument to the script file.
9796

98-
expect(command).to.be.deep.equal([`${sourceCmd} ${pathToScriptFile.fileToCommandArgument()}`.trim()], 'Invalid command');
97+
expect(command).to.be.deep.equal([`source ${pathToScriptFile.fileToCommandArgument()}`.trim()], 'Invalid command');
9998
} else {
10099
expect(command).to.be.equal(undefined, 'Command should be undefined');
101100
}

0 commit comments

Comments
 (0)