From 76ae73a46bea7e722bf43e4d5550b3d895066d90 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 12 Oct 2023 21:52:38 -0700 Subject: [PATCH] Skip setting `PYTHONUTF8` when activating terminals (#22213) Closes https://github.com/microsoft/vscode-python/issues/22205 --- .../activation/terminalEnvVarCollectionService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/interpreter/activation/terminalEnvVarCollectionService.ts b/src/client/interpreter/activation/terminalEnvVarCollectionService.ts index c11ec221d4d7..92e97c95e468 100644 --- a/src/client/interpreter/activation/terminalEnvVarCollectionService.ts +++ b/src/client/interpreter/activation/terminalEnvVarCollectionService.ts @@ -394,7 +394,12 @@ function shouldPS1BeSet(type: PythonEnvType | undefined, env: EnvironmentVariabl } function shouldSkip(env: string) { - return ['_', 'SHLVL'].includes(env); + return [ + '_', + 'SHLVL', + // Even though this maybe returned, setting it can result in output encoding errors in terminal. + 'PYTHONUTF8', + ].includes(env); } function getPromptForEnv(interpreter: PythonEnvironment | undefined) {