Skip to content

Commit

Permalink
Change PYTHONSTARTUP setting name to Python.terminal.shell integratio…
Browse files Browse the repository at this point in the history
…n.enabled (#24153)

Resolves: #24143 
/cc @cwebster-99 @Tyriar

---------

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
  • Loading branch information
anthonykim1 and Tyriar authored Sep 23, 2024
1 parent af2aa6e commit f8b861a
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,9 @@
"scope": "resource",
"type": "array"
},
"python.REPL.enableShellIntegration": {
"python.terminal.shellIntegration.enabled": {
"default": false,
"description": "%python.REPL.enableShellIntegration.description%",
"description": "%python.terminal.shellIntegration.enabled.description%",
"scope": "resource",
"type": "boolean",
"tags": [
Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
"python.pixiToolPath.description": "Path to the pixi executable.",
"python.EnableREPLSmartSend.description": "Toggle Smart Send for the Python REPL. Smart Send enables sending the smallest runnable block of code to the REPL on Shift+Enter and moves the cursor accordingly.",
"python.REPL.sendToNativeREPL.description": "Toggle to send code to Python REPL instead of the terminal on execution. Turning this on will change the behavior for both Smart Send and Run Selection/Line in the Context Menu.",
"python.REPL.enableShellIntegration.description": "Enable Shell Integration for Python Terminal REPL. Shell Integration enhances the terminal experience by allowing command decorations, run recent command, and improving accessibility for Python REPL in the terminal.",
"python.tensorBoard.logDirectory.description": "Set this setting to your preferred TensorBoard log directory to skip log directory prompt when starting TensorBoard.",
"python.tensorBoard.logDirectory.markdownDeprecationMessage": "Tensorboard support has been moved to the extension [Tensorboard extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.tensorboard). Instead use the setting `tensorBoard.logDirectory`.",
"python.tensorBoard.logDirectory.deprecationMessage": "Tensorboard support has been moved to the extension Tensorboard extension. Instead use the setting `tensorBoard.logDirectory`.",
"python.terminal.shellIntegration.enabled.description": "Enable [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) for the terminals running python. Shell integration enhances the terminal experience by enabling command decorations, run recent command, improving accessibility among other things.",
"python.terminal.activateEnvInCurrentTerminal.description": "Activate Python Environment in the current Terminal on load of the Extension.",
"python.terminal.activateEnvironment.description": "Activate Python Environment in all Terminals created.",
"python.terminal.executeInFileDir.description": "When executing a file in the terminal, whether to use execute in the file's directory, instead of the current open folder.",
Expand Down
1 change: 1 addition & 0 deletions src/client/common/configSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ export class PythonSettings implements IPythonSettings {
launchArgs: [],
activateEnvironment: true,
activateEnvInCurrentTerminal: false,
enableShellIntegration: false,
};

this.REPL = pythonSettings.get<IREPLSettings>('REPL')!;
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ export interface ITerminalSettings {
readonly launchArgs: string[];
readonly activateEnvironment: boolean;
readonly activateEnvInCurrentTerminal: boolean;
readonly enableShellIntegration: boolean;
}

export interface IREPLSettings {
readonly enableREPLSmartSend: boolean;
readonly sendToNativeREPL: boolean;
readonly enableShellIntegration: boolean;
}

export interface IExperiments {
Expand Down
2 changes: 1 addition & 1 deletion src/client/terminals/pythonStartup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { EXTENSION_ROOT_DIR } from '../constants';

export async function registerPythonStartup(context: ExtensionContext): Promise<void> {
const config = getConfiguration('python');
const pythonrcSetting = config.get<boolean>('REPL.enableShellIntegration');
const pythonrcSetting = config.get<boolean>('terminal.shellIntegration.enabled');

if (pythonrcSetting) {
const storageUri = context.storageUri || context.globalStorageUri;
Expand Down
1 change: 0 additions & 1 deletion src/test/terminals/codeExecution/helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ suite('Terminal - Code Execution Helper', () => {
enableREPLSmartSend: false,
REPLSmartSend: false,
sendToNativeREPL: false,
enableShellIntegration: true,
}));
configurationService.setup((x) => x.getSettings(TypeMoq.It.isAny())).returns(() => pythonSettings.object);
configurationService
Expand Down
1 change: 0 additions & 1 deletion src/test/terminals/codeExecution/smartSend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ suite('REPL - Smart Send', () => {
enableREPLSmartSend: true,
REPLSmartSend: true,
sendToNativeREPL: false,
enableShellIntegration: true,
}));

configurationService.setup((x) => x.getSettings(TypeMoq.It.isAny())).returns(() => pythonSettings.object);
Expand Down

0 comments on commit f8b861a

Please sign in to comment.