Skip to content

Commit 85d9202

Browse files
authored
Fix env var warning description (#25758)
Resolves: #25733 Now description show when contributing.. but not when deleting? See below <img width="679" height="591" alt="Screenshot 2026-02-02 at 4 26 05 PM" src="https://github.com/user-attachments/assets/f98b91bb-75ae-4c64-9644-34635f389408" />
1 parent f3a6dbe commit 85d9202

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/client/common/utils/localize.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ export namespace Interpreters {
199199
export const terminalEnvVarCollectionPrompt = l10n.t(
200200
'{0} environment was successfully activated, even though {1} indicator may not be present in the terminal prompt. [Learn more](https://aka.ms/vscodePythonTerminalActivation).',
201201
);
202+
export const shellIntegrationEnvVarCollectionDescription = l10n.t(
203+
'Enables `python.terminal.shellIntegration.enabled` by modifying `PYTHONSTARTUP` and `PYTHON_BASIC_REPL`',
204+
);
205+
export const shellIntegrationDisabledEnvVarCollectionDescription = l10n.t(
206+
'Disables `python.terminal.shellIntegration.enabled` by unsetting `PYTHONSTARTUP` and `PYTHON_BASIC_REPL`',
207+
);
202208
export const terminalDeactivateProgress = l10n.t('Editing {0}...');
203209
export const restartingTerminal = l10n.t('Restarting terminal and deactivating...');
204210
export const terminalDeactivatePrompt = l10n.t(

src/client/terminals/pythonStartup.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import { ExtensionContext, Uri } from 'vscode';
4+
import { ExtensionContext, MarkdownString, Uri } from 'vscode';
55
import * as path from 'path';
66
import { copy, createDirectory, getConfiguration, onDidChangeConfiguration } from '../common/vscodeApis/workspaceApis';
77
import { EXTENSION_ROOT_DIR } from '../constants';
8+
import { Interpreters } from '../common/utils/localize';
89

910
async function applyPythonStartupSetting(context: ExtensionContext): Promise<void> {
1011
const config = getConfiguration('python');
@@ -21,11 +22,17 @@ async function applyPythonStartupSetting(context: ExtensionContext): Promise<voi
2122
const sourcePath = path.join(EXTENSION_ROOT_DIR, 'python_files', 'pythonrc.py');
2223
await copy(Uri.file(sourcePath), destPath, { overwrite: true });
2324
context.environmentVariableCollection.replace('PYTHONSTARTUP', destPath.fsPath);
24-
// When shell integration is enabled, we disable PyREPL from cpython.
25+
// When shell integration is enabled, we disable PyREPL from cpython.
2526
context.environmentVariableCollection.replace('PYTHON_BASIC_REPL', '1');
27+
context.environmentVariableCollection.description = new MarkdownString(
28+
Interpreters.shellIntegrationEnvVarCollectionDescription,
29+
);
2630
} else {
2731
context.environmentVariableCollection.delete('PYTHONSTARTUP');
2832
context.environmentVariableCollection.delete('PYTHON_BASIC_REPL');
33+
context.environmentVariableCollection.description = new MarkdownString(
34+
Interpreters.shellIntegrationDisabledEnvVarCollectionDescription,
35+
);
2936
}
3037
}
3138

0 commit comments

Comments
 (0)