Commit b6355ef
committed
tty: improve color detection
1) Using `process.env.TERM = 'dumb'` should never return any colors.
2) `process.env.TERM = 'terminator'` supports 24 bit colors.
3) Add support for `process.env.TERM = 'rxvt-unicode-24bit'`
4) `Hyper` does not support true colors anymore. It should fall back
to the xterm settings in regular cases.
5) `process.env.COLORTERM = 'truecolor'` should return 24 bit colors.
PR-URL: #26264
Refs: #26261
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 91b6145 commit b6355efCopy full SHA for b6355ef
File tree
Expand file treeCollapse file tree
2 files changed
+35
-26
lines changedOpen diff view settings
Filter options
- lib/internal
- test/pseudo-tty
Expand file treeCollapse file tree
2 files changed
+35
-26
lines changedOpen diff view settings
Collapse file
+26-23Lines changed: 26 additions & 23 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
55 | 58 | |
56 | 59 | |
57 | 60 | |
| ||
68 | 71 | |
69 | 72 | |
70 | 73 | |
71 | | - |
| 74 | + |
72 | 75 | |
73 | 76 | |
74 | 77 | |
| ||
117 | 120 | |
118 | 121 | |
119 | 122 | |
120 | | - |
121 | 123 | |
122 | 124 | |
123 | 125 | |
| ||
130 | 132 | |
131 | 133 | |
132 | 134 | |
133 | | - |
134 | | - |
135 | | - |
136 | | - |
| 135 | + |
| 136 | + |
137 | 137 | |
138 | 138 | |
139 | 139 | |
| ||
142 | 142 | |
143 | 143 | |
144 | 144 | |
145 | | - |
| 145 | + |
| 146 | + |
| 147 | + |
146 | 148 | |
| 149 | + |
147 | 150 | |
148 | 151 | |
149 | 152 | |
|
Collapse file
test/pseudo-tty/test-tty-get-color-depth.js
Copy file name to clipboardExpand all lines: test/pseudo-tty/test-tty-get-color-depth.js+9-3Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
7 | 8 | |
8 | 9 | |
| ||
16 | 17 | |
17 | 18 | |
18 | 19 | |
| 20 | + |
| 21 | + |
19 | 22 | |
20 | 23 | |
21 | 24 | |
| ||
29 | 32 | |
30 | 33 | |
31 | 34 | |
32 | | - |
| 35 | + |
33 | 36 | |
34 | 37 | |
35 | 38 | |
| ||
40 | 43 | |
41 | 44 | |
42 | 45 | |
43 | | - |
| 46 | + |
| 47 | + |
| 48 | + |
44 | 49 | |
45 | 50 | |
46 | 51 | |
47 | 52 | |
48 | 53 | |
49 | | - |
| 54 | + |
| 55 | + |
50 | 56 | |
51 | 57 | |
52 | 58 | |
|
0 commit comments