* xterm.js (VS Code, Cursor, code-server, Coder) has supported truecolor * since 2017, but code-server/Coder containers often don't set * COLORTERM=truecolor. chalk's supports-color doesn't recognize * TERM_PROGRAM=vscode (it only knows iTerm.app/Apple_Terminal), so it falls * through to the -25
()
| 18 | * terminal, tmux's passthrough limitation wins and we want level 2. |
| 19 | */ |
| 20 | function boostChalkLevelForXtermJs(): boolean { |
| 21 | if (process.env.TERM_PROGRAM === 'vscode' && chalk.level === 2) { |
| 22 | chalk.level = 3 |
| 23 | return true |
| 24 | } |
| 25 | return false |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * tmux parses truecolor SGR (\e[48;2;r;g;bm) into its cell buffer correctly, |