From 71a1235882c79395d8c3b0773657f2005158fcbe Mon Sep 17 00:00:00 2001 From: Simon Graband Date: Wed, 3 Jul 2024 10:52:30 +0200 Subject: [PATCH] Add support for 256 truecolor (#13853) Beforehand the `terminfo[colors]` and `COLORTERM` were not set properly. The terminal already supports 256 truecolor, but cli tools might not use it, as the env variables were not set correctly. This is fixed with this PR, the color is not set to `256` and `COLORTERM` is set to `truecolor`. Fixes #13523. --- packages/terminal/src/node/shell-process.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/terminal/src/node/shell-process.ts b/packages/terminal/src/node/shell-process.ts index 4bf64080756c5..1efab68ed7c3e 100644 --- a/packages/terminal/src/node/shell-process.ts +++ b/packages/terminal/src/node/shell-process.ts @@ -61,15 +61,16 @@ export class ShellProcess extends TerminalProcess { @inject(ILogger) @named('terminal') logger: ILogger, @inject(EnvironmentUtils) environmentUtils: EnvironmentUtils, ) { + const env = { 'COLORTERM': 'truecolor' }; super({ command: options.shell || ShellProcess.getShellExecutablePath(), args: options.args || ShellProcess.getShellExecutableArgs(), options: { - name: 'xterm-color', + name: 'xterm-256color', cols: options.cols || ShellProcess.defaultCols, rows: options.rows || ShellProcess.defaultRows, cwd: getRootPath(options.rootURI), - env: options.strictEnv !== true ? environmentUtils.mergeProcessEnv(options.env) : options.env, + env: options.strictEnv !== true ? Object.assign(env, environmentUtils.mergeProcessEnv(options.env)) : Object.assign(env, options.env), }, isPseudo: options.isPseudo, }, processManager, ringBuffer, logger);