From 1b160aa96a6bfbbb7b150ded360196b940fe8b22 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Sat, 21 Oct 2023 03:22:30 +0000 Subject: [PATCH 1/6] Only show terminal notification for default terminals created without configuration --- .../envCollectionActivation/deactivatePrompt.ts | 2 +- .../terminals/envCollectionActivation/indicatorPrompt.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client/terminals/envCollectionActivation/deactivatePrompt.ts b/src/client/terminals/envCollectionActivation/deactivatePrompt.ts index 5871cbac92c8..a9fd804291a5 100644 --- a/src/client/terminals/envCollectionActivation/deactivatePrompt.ts +++ b/src/client/terminals/envCollectionActivation/deactivatePrompt.ts @@ -65,7 +65,7 @@ export class TerminalDeactivateLimitationPrompt implements IExtensionSingleActiv } if (!isTestExecution()) { // Avoid showing prompt until startup completes. - await sleep(5000); + await sleep(6000); } this.disposableRegistry.push( this.appShell.onDidWriteTerminalData(async (e) => { diff --git a/src/client/terminals/envCollectionActivation/indicatorPrompt.ts b/src/client/terminals/envCollectionActivation/indicatorPrompt.ts index bc4c3cc90fc0..a5338a85ba59 100644 --- a/src/client/terminals/envCollectionActivation/indicatorPrompt.ts +++ b/src/client/terminals/envCollectionActivation/indicatorPrompt.ts @@ -46,10 +46,17 @@ export class TerminalIndicatorPrompt implements IExtensionSingleActivationServic } if (!isTestExecution()) { // Avoid showing prompt until startup completes. - await sleep(5000); + await sleep(6000); } this.disposableRegistry.push( this.terminalManager.onDidOpenTerminal(async (terminal) => { + const hideFromUser = + 'hideFromUser' in terminal.creationOptions && terminal.creationOptions.hideFromUser; + const strictEnv = 'strictEnv' in terminal.creationOptions && terminal.creationOptions.strictEnv; + if (hideFromUser || strictEnv || terminal.creationOptions.name) { + // Only show this notification for basic terminals created using the '+' button. + return; + } const cwd = 'cwd' in terminal.creationOptions && terminal.creationOptions.cwd ? terminal.creationOptions.cwd From 13f1b6192176655e96caa4a089b953c39a2d81b7 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Sat, 21 Oct 2023 03:24:04 +0000 Subject: [PATCH 2/6] Do not show in case of invalid interpreters --- .../terminals/envCollectionActivation/indicatorPrompt.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/terminals/envCollectionActivation/indicatorPrompt.ts b/src/client/terminals/envCollectionActivation/indicatorPrompt.ts index a5338a85ba59..65db4ed3d2b3 100644 --- a/src/client/terminals/envCollectionActivation/indicatorPrompt.ts +++ b/src/client/terminals/envCollectionActivation/indicatorPrompt.ts @@ -85,6 +85,9 @@ export class TerminalIndicatorPrompt implements IExtensionSingleActivationServic } const prompts = [Common.doNotShowAgain]; const interpreter = await this.interpreterService.getActiveInterpreter(resource); + if (!interpreter) { + return; + } const terminalPromptName = getPromptName(interpreter); const selection = await this.appShell.showInformationMessage( Interpreters.terminalEnvVarCollectionPrompt.format(terminalPromptName), From 9bbb25c7d780db8839eac0395aeafd94c3259a6a Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Sat, 21 Oct 2023 03:24:19 +0000 Subject: [PATCH 3/6] hey --- .../terminals/envCollectionActivation/indicatorPrompt.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/client/terminals/envCollectionActivation/indicatorPrompt.ts b/src/client/terminals/envCollectionActivation/indicatorPrompt.ts index 65db4ed3d2b3..090ab54c342a 100644 --- a/src/client/terminals/envCollectionActivation/indicatorPrompt.ts +++ b/src/client/terminals/envCollectionActivation/indicatorPrompt.ts @@ -102,10 +102,7 @@ export class TerminalIndicatorPrompt implements IExtensionSingleActivationServic } } -function getPromptName(interpreter?: PythonEnvironment) { - if (!interpreter) { - return ''; - } +function getPromptName(interpreter: PythonEnvironment) { if (interpreter.envName) { return `, ${l10n.t('i.e')} "(${interpreter.envName})"`; } From 24abc92e10bbc5e1f3454520c16f76fda5de9d34 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Sat, 21 Oct 2023 03:32:03 +0000 Subject: [PATCH 4/6] Rename --- ...CollectionPrompt.unit.test.ts => indicatorPrompt.unit.test.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/test/interpreters/activation/{terminalEnvVarCollectionPrompt.unit.test.ts => indicatorPrompt.unit.test.ts} (100%) diff --git a/src/test/interpreters/activation/terminalEnvVarCollectionPrompt.unit.test.ts b/src/test/interpreters/activation/indicatorPrompt.unit.test.ts similarity index 100% rename from src/test/interpreters/activation/terminalEnvVarCollectionPrompt.unit.test.ts rename to src/test/interpreters/activation/indicatorPrompt.unit.test.ts From 69cefde33b0fc5bf2510946a3d8e33780d474439 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Sat, 21 Oct 2023 03:45:19 +0000 Subject: [PATCH 5/6] Do not run only tensor tests --- src/test/tensorBoard/nbextensionCodeLensProvider.unit.test.ts | 2 +- .../tensorBoard/tensorBoardImportCodeLensProvider.unit.test.ts | 2 +- src/test/tensorBoard/tensorBoardPrompt.unit.test.ts | 2 +- src/test/tensorBoard/tensorBoardUsageTracker.unit.test.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/tensorBoard/nbextensionCodeLensProvider.unit.test.ts b/src/test/tensorBoard/nbextensionCodeLensProvider.unit.test.ts index aef90d14eacf..d4339a4af61b 100644 --- a/src/test/tensorBoard/nbextensionCodeLensProvider.unit.test.ts +++ b/src/test/tensorBoard/nbextensionCodeLensProvider.unit.test.ts @@ -11,7 +11,7 @@ import { TensorboardExperiment } from '../../client/tensorBoard/tensorboarExperi [true, false].forEach((tbExtensionInstalled) => { suite(`Tensorboard Extension is ${tbExtensionInstalled ? 'installed' : 'not installed'}`, () => { - suite.only('TensorBoard nbextension code lens provider', () => { + suite('TensorBoard nbextension code lens provider', () => { let experiment: TensorboardExperiment; let codeLensProvider: TensorBoardNbextensionCodeLensProvider; let cancelTokenSource: CancellationTokenSource; diff --git a/src/test/tensorBoard/tensorBoardImportCodeLensProvider.unit.test.ts b/src/test/tensorBoard/tensorBoardImportCodeLensProvider.unit.test.ts index 07bcce035a7c..8b16301753a6 100644 --- a/src/test/tensorBoard/tensorBoardImportCodeLensProvider.unit.test.ts +++ b/src/test/tensorBoard/tensorBoardImportCodeLensProvider.unit.test.ts @@ -11,7 +11,7 @@ import { TensorboardExperiment } from '../../client/tensorBoard/tensorboarExperi [true, false].forEach((tbExtensionInstalled) => { suite(`Tensorboard Extension is ${tbExtensionInstalled ? 'installed' : 'not installed'}`, () => { - suite.only('TensorBoard import code lens provider', () => { + suite('TensorBoard import code lens provider', () => { let experiment: TensorboardExperiment; let codeLensProvider: TensorBoardImportCodeLensProvider; let cancelTokenSource: CancellationTokenSource; diff --git a/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts b/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts index d94b0d6c5f23..6f096e560d70 100644 --- a/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts +++ b/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts @@ -7,7 +7,7 @@ import { Common } from '../../client/common/utils/localize'; import { TensorBoardEntrypointTrigger } from '../../client/tensorBoard/constants'; import { TensorBoardPrompt } from '../../client/tensorBoard/tensorBoardPrompt'; -suite.only('TensorBoard prompt', () => { +suite('TensorBoard prompt', () => { let applicationShell: ApplicationShell; let commandManager: CommandManager; let persistentState: PersistentState; diff --git a/src/test/tensorBoard/tensorBoardUsageTracker.unit.test.ts b/src/test/tensorBoard/tensorBoardUsageTracker.unit.test.ts index 54771ab4b6b6..7eba1805c8bf 100644 --- a/src/test/tensorBoard/tensorBoardUsageTracker.unit.test.ts +++ b/src/test/tensorBoard/tensorBoardUsageTracker.unit.test.ts @@ -10,7 +10,7 @@ import { TensorboardExperiment } from '../../client/tensorBoard/tensorboarExperi [true, false].forEach((tbExtensionInstalled) => { suite(`Tensorboard Extension is ${tbExtensionInstalled ? 'installed' : 'not installed'}`, () => { - suite.only('TensorBoard usage tracker', () => { + suite('TensorBoard usage tracker', () => { let experiment: TensorboardExperiment; let documentManager: MockDocumentManager; let tensorBoardImportTracker: TensorBoardUsageTracker; From 584747577887597ebbb8eaab1f0bf39a3c150028 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Sat, 21 Oct 2023 05:39:53 +0000 Subject: [PATCH 6/6] Make notification concise --- src/client/common/utils/localize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 56818afa376d..538795e022e5 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -197,7 +197,7 @@ export namespace Interpreters { export const activatingTerminals = l10n.t('Reactivating terminals...'); export const activateTerminalDescription = l10n.t('Activated environment for'); export const terminalEnvVarCollectionPrompt = l10n.t( - 'The Python extension automatically activates all terminals using the selected environment, even when the name of the environment{0} is not present in the terminal prompt. [Learn more](https://aka.ms/vscodePythonTerminalActivation).', + 'The selected Python environment indicator{0} may not be present in the terminal prompt. Rest assured, all terminals are still activated. [Learn more](https://aka.ms/vscodePythonTerminalActivation).', ); export const terminalDeactivateProgress = l10n.t('Editing {0}...'); export const restartingTerminal = l10n.t('Restarting terminal and deactivating...');