From cddc0bdae558f10a38a561d9533b769eaf38e5f7 Mon Sep 17 00:00:00 2001 From: Noah Gilson Date: Mon, 28 Jul 2025 11:10:21 -0700 Subject: [PATCH 1/2] No longer include color in output This may mess up our output parsing. Please see https://github.com/dotnet/vscode-dotnet-runtime/issues/2269, One concern is whether TERM=dumb would cause other failures, but in general this is only meant to disable ansi scape codes (for color and formatting) which we dont want, and this is recommended to be set for scripting. https://linux.die.net/man/7/term --- .../src/Utils/CommandExecutor.ts | 8 +++++++- .../src/Utils/TypescriptUtilities.ts | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts b/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts index 4f78fb0176..58fdf3dc13 100644 --- a/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts +++ b/vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts @@ -451,12 +451,18 @@ ${stderr}`)); options.env.DOTNET_CLI_UI_LANGUAGE ??= 'en-US'; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access options.env.DOTNET_NOLOGO ??= 'true'; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + options.env.NO_COLOR ??= '1'; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + options.env.TERM ??= 'dumb'; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + options.env.GREP_OPTIONS = undefined; } else { options = { cwd: path.resolve(__dirname), shell: true, encoding: 'utf8', env: - { ...process.env, DOTNET_CLI_UI_LANGUAGE: 'en-US', DOTNET_NOLOGO: 'true' } + { ...process.env, DOTNET_CLI_UI_LANGUAGE: 'en-US', DOTNET_NOLOGO: 'true', NO_COLOR: '1', TERM: 'dumb', GREP_OPTIONS: undefined } }; } diff --git a/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts b/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts index ce33c41006..b588789165 100644 --- a/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts +++ b/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts @@ -132,6 +132,8 @@ const possiblyUsefulUpperCaseEnvVars = new Set([ // This is a local vari 'PWD', 'BASHOPTS', 'SHELLOPTS', + 'GREP_OPTIONS' + 'NO_COLOR', 'PS1', 'PS2', 'DOTNET_INSTALL_TOOL_UNDER_TEST', From 0c345c7ac144ac5b29e8b14ef64090b9fe4b4d50 Mon Sep 17 00:00:00 2001 From: Noah Gilson Date: Mon, 28 Jul 2025 11:38:55 -0700 Subject: [PATCH 2/2] Add missing , --- vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts b/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts index b588789165..8ea04a232e 100644 --- a/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts +++ b/vscode-dotnet-runtime-library/src/Utils/TypescriptUtilities.ts @@ -132,7 +132,7 @@ const possiblyUsefulUpperCaseEnvVars = new Set([ // This is a local vari 'PWD', 'BASHOPTS', 'SHELLOPTS', - 'GREP_OPTIONS' + 'GREP_OPTIONS', 'NO_COLOR', 'PS1', 'PS2',