From 0dce2a5d7e661299dc111846a7edd003f1a91dd8 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Mon, 23 Sep 2024 10:27:25 -0700 Subject: [PATCH 1/3] rename to terminal.integrated.shellIntegration.enabled --- package.json | 4 ++-- package.nls.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index dc0887402b8c..02435c3ae2fb 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/package.nls.json b/package.nls.json index f032f3d7c275..801b60dc12aa 100644 --- a/package.nls.json +++ b/package.nls.json @@ -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 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.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.", From f69728dd4e32ca4108869d5f43f2572e0817b264 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Mon, 23 Sep 2024 11:20:54 -0700 Subject: [PATCH 2/3] switch setting name to terminal.shellIntegration.enabled --- src/client/common/configSettings.ts | 1 + src/client/common/types.ts | 2 +- src/client/terminals/pythonStartup.ts | 2 +- src/test/terminals/codeExecution/helper.test.ts | 1 - src/test/terminals/codeExecution/smartSend.test.ts | 1 - 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/common/configSettings.ts b/src/client/common/configSettings.ts index 6cae60c9fb97..1b637e7aac2d 100644 --- a/src/client/common/configSettings.ts +++ b/src/client/common/configSettings.ts @@ -368,6 +368,7 @@ export class PythonSettings implements IPythonSettings { launchArgs: [], activateEnvironment: true, activateEnvInCurrentTerminal: false, + enableShellIntegration: false, }; this.REPL = pythonSettings.get('REPL')!; diff --git a/src/client/common/types.ts b/src/client/common/types.ts index 283319fd6cec..035e6ec4638b 100644 --- a/src/client/common/types.ts +++ b/src/client/common/types.ts @@ -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 { diff --git a/src/client/terminals/pythonStartup.ts b/src/client/terminals/pythonStartup.ts index 9a6b956d7f6e..542a2e6a6355 100644 --- a/src/client/terminals/pythonStartup.ts +++ b/src/client/terminals/pythonStartup.ts @@ -8,7 +8,7 @@ import { EXTENSION_ROOT_DIR } from '../constants'; export async function registerPythonStartup(context: ExtensionContext): Promise { const config = getConfiguration('python'); - const pythonrcSetting = config.get('REPL.enableShellIntegration'); + const pythonrcSetting = config.get('terminal.shellIntegration.enabled'); if (pythonrcSetting) { const storageUri = context.storageUri || context.globalStorageUri; diff --git a/src/test/terminals/codeExecution/helper.test.ts b/src/test/terminals/codeExecution/helper.test.ts index e15c41957726..ebadd153705e 100644 --- a/src/test/terminals/codeExecution/helper.test.ts +++ b/src/test/terminals/codeExecution/helper.test.ts @@ -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 diff --git a/src/test/terminals/codeExecution/smartSend.test.ts b/src/test/terminals/codeExecution/smartSend.test.ts index 594db361f51e..f315bc004d4e 100644 --- a/src/test/terminals/codeExecution/smartSend.test.ts +++ b/src/test/terminals/codeExecution/smartSend.test.ts @@ -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); From c96fb3d03675ef51a4ceba5f2f28f8157e1a058c Mon Sep 17 00:00:00 2001 From: Anthony Kim <62267334+anthonykim1@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:38:27 -0400 Subject: [PATCH 3/3] Update package.nls.json Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.nls.json b/package.nls.json index 801b60dc12aa..c92e21be5b61 100644 --- a/package.nls.json +++ b/package.nls.json @@ -68,7 +68,7 @@ "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 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.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.",