Skip to content

Commit

Permalink
Add support for 256 truecolor (#13853)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sgraband committed Jul 3, 2024
1 parent 04de7f8 commit 71a1235
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/terminal/src/node/shell-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@ export class ShellProcess extends TerminalProcess {
@inject(ILogger) @named('terminal') logger: ILogger,
@inject(EnvironmentUtils) environmentUtils: EnvironmentUtils,
) {
const env = { 'COLORTERM': 'truecolor' };
super(<TerminalProcessOptions>{
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);
Expand Down

0 comments on commit 71a1235

Please sign in to comment.