| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7d37bce commit 1f10681
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -173,6 +173,10 @@ function getColorDepth(env = process.env) { | |||
| 173 | 173 | return COLORS_256; | |
| 174 | 174 | } | |
| 175 | 175 | ||
| 176 | + if (env.COLORTERM === 'truecolor' || env.COLORTERM === '24bit') { | ||
| 177 | + return COLORS_16m; | ||
| 178 | + } | ||
| 179 | + | ||
| 176 | 180 | if (env.TERM) { | |
| 177 | 181 | if (/^xterm-256/.test(env.TERM)) | |
| 178 | 182 | return COLORS_256; | |
@@ -188,13 +192,10 @@ function getColorDepth(env = process.env) { | |||
| 188 | 192 | } | |
| 189 | 193 | } | |
| 190 | 194 | } | |
| 191 | - | ||
| 195 | + // Move 16 color COLORTERM below 16m and 256 | ||
| 192 | 196 | if (env.COLORTERM) { | |
| 193 | - if (env.COLORTERM === 'truecolor' || env.COLORTERM === '24bit') | ||
| 194 | - return COLORS_16m; | ||
| 195 | 197 | return COLORS_16; | |
| 196 | 198 | } | |
| 197 | - | ||
| 198 | 199 | return COLORS_2; | |
| 199 | 200 | } | |
| 200 | 201 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,6 +71,7 @@ const writeStream = new WriteStream(fd); | |||
| 71 | 71 | [{ NO_COLOR: '', COLORTERM: '24bit' }, 1], | |
| 72 | 72 | [{ TMUX: '1', FORCE_COLOR: 0 }, 1], | |
| 73 | 73 | [{ NO_COLOR: 'true', FORCE_COLOR: 0, COLORTERM: 'truecolor' }, 1], | |
| 74 | + [{ TERM: 'xterm-256color', COLORTERM: 'truecolor' }, 24], | ||
| 74 | 75 | ].forEach(([env, depth], i) => { | |
| 75 | 76 | const actual = writeStream.getColorDepth(env); | |
| 76 | 77 | assert.strictEqual( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments