diff --git a/src/managers/common/utils.ts b/src/managers/common/utils.ts index 6358bf54e..c17e2efc5 100644 --- a/src/managers/common/utils.ts +++ b/src/managers/common/utils.ts @@ -160,6 +160,9 @@ export async function getShellActivationCommands(binDir: string): Promise<{ if (await fs.pathExists(path.join(binDir, 'activate.csh'))) { shellActivation.set(ShellConstants.CSH, [{ executable: 'source', args: [path.join(binDir, `activate.csh`)] }]); shellDeactivation.set(ShellConstants.CSH, [{ executable: 'deactivate' }]); + + shellActivation.set(ShellConstants.TCSH, [{ executable: 'source', args: [path.join(binDir, `activate.csh`)] }]); + shellDeactivation.set(ShellConstants.TCSH, [{ executable: 'deactivate' }]); } if (await fs.pathExists(path.join(binDir, 'activate.fish'))) { diff --git a/src/test/managers/common/utils.getShellActivationCommands.unit.test.ts b/src/test/managers/common/utils.getShellActivationCommands.unit.test.ts index 33d7d0a21..2c1927c7a 100644 --- a/src/test/managers/common/utils.getShellActivationCommands.unit.test.ts +++ b/src/test/managers/common/utils.getShellActivationCommands.unit.test.ts @@ -190,6 +190,8 @@ suite('getShellActivationCommands', () => { ShellConstants.GITBASH, ShellConstants.ZSH, ShellConstants.KSH, + ShellConstants.CSH, + ShellConstants.TCSH, ]) { assert.strictEqual(result.shellActivation.get(shell), undefined, `${shell} should not be activated`); assert.strictEqual( @@ -213,6 +215,7 @@ suite('getShellActivationCommands', () => { test('POSIX shells are activated when the activate script exists', async () => { isWindowsStub.returns(false); await fs.writeFile(path.join(tmpDir, 'activate'), ''); + await fs.writeFile(path.join(tmpDir, 'activate.csh'), ''); const result = await getShellActivationCommands(tmpDir); @@ -221,6 +224,11 @@ suite('getShellActivationCommands', () => { { executable: 'source', args: [path.join(tmpDir, 'activate')] }, ]); } + for (const shell of [ShellConstants.CSH, ShellConstants.TCSH]) { + assert.deepStrictEqual(result.shellActivation.get(shell), [ + { executable: 'source', args: [path.join(tmpDir, 'activate.csh')] }, + ]); + } }); }); });