diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 7b7560c74e05..178e7f263761 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -218,7 +218,7 @@ export namespace Interpreters { '{0} environment was successfully activated, even though {1} indicator may not be present in the terminal prompt. [Learn more](https://aka.ms/vscodePythonTerminalActivation).', ); export const shellIntegrationEnvVarCollectionDescription = l10n.t( - 'Enables `python.terminal.shellIntegration.enabled` by modifying `PYTHONSTARTUP` and `PYTHON_BASIC_REPL`', + 'Enables `python.terminal.shellIntegration.enabled` by modifying `PYTHONSTARTUP`', ); export const shellIntegrationDisabledEnvVarCollectionDescription = l10n.t( 'Disables `python.terminal.shellIntegration.enabled` by unsetting `PYTHONSTARTUP` and `PYTHON_BASIC_REPL`', diff --git a/src/client/terminals/pythonStartup.ts b/src/client/terminals/pythonStartup.ts index b6f68c860b46..46297978938c 100644 --- a/src/client/terminals/pythonStartup.ts +++ b/src/client/terminals/pythonStartup.ts @@ -22,8 +22,6 @@ async function applyPythonStartupSetting(context: ExtensionContext): Promise { globalEnvironmentVariableCollection.verify((c) => c.delete('PYTHONSTARTUP'), TypeMoq.Times.once()); }); - test('PYTHON_BASIC_REPL is set when shell integration is enabled', async () => { + test('PYTHON_BASIC_REPL is not set when shell integration is enabled', async () => { pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => true); + await registerPythonStartup(context.object); + globalEnvironmentVariableCollection.verify( - (c) => c.replace('PYTHON_BASIC_REPL', '1', TypeMoq.It.isAny()), - TypeMoq.Times.once(), + (c) => c.replace('PYTHON_BASIC_REPL', TypeMoq.It.isAny(), TypeMoq.It.isAny()), + TypeMoq.Times.never(), ); }); + test('PYTHON_BASIC_REPL is deleted when shell integration is disabled', async () => { + pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => false); + + await registerPythonStartup(context.object); + + globalEnvironmentVariableCollection.verify((c) => c.delete('PYTHON_BASIC_REPL'), TypeMoq.Times.once()); + }); + test('Ensure registering terminal link calls registerTerminalLinkProvider', async () => { const registerTerminalLinkProviderStub = sinon.stub( pythonStartupLinkProvider,