Compare commits

...

9 commits
v5.4.0 ... main

Author SHA1 Message Date
Mohamed Hamed
aa06bb5ac3
Fix typos (#664) 2026-01-27 13:30:36 +07:00
Sindre Sorhus
51557784b8 5.6.2 2025-09-08 21:47:34 +07:00
Sindre Sorhus
5c91505e18 5.6.0 2025-08-17 14:26:22 +07:00
Sindre Sorhus
a8f5bf7a67 Make WezTerm terminal use true color 2025-08-17 14:25:29 +07:00
Sindre Sorhus
67db246ae0 5.5.0 2025-08-04 01:17:43 +02:00
Brice
79ee2d386c
Make Ghostty terminal use true color (#653) 2025-08-04 01:14:54 +02:00
Sindre Sorhus
5dbc1e2633 5.4.1 2024-12-21 18:04:25 +01:00
Edwin Kofler
4ebb62d1ca
Fix navigator not defined ReferenceError (#642) 2024-12-21 18:01:49 +01:00
Sindre Sorhus
fc809b686d Readme tweak 2024-12-18 19:10:23 +01:00
4 changed files with 19 additions and 5 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "chalk", "name": "chalk",
"version": "5.4.0", "version": "5.6.2",
"description": "Terminal string styling done right", "description": "Terminal string styling done right",
"license": "MIT", "license": "MIT",
"repository": "chalk/chalk", "repository": "chalk/chalk",

View file

@ -178,10 +178,10 @@ console.log(foregroundColorNames.includes('pink'));
- `italic` - Make the text italic. *(Not widely supported)* - `italic` - Make the text italic. *(Not widely supported)*
- `underline` - Put a horizontal line below the text. *(Not widely supported)* - `underline` - Put a horizontal line below the text. *(Not widely supported)*
- `overline` - Put a horizontal line above the text. *(Not widely supported)* - `overline` - Put a horizontal line above the text. *(Not widely supported)*
- `inverse`- Invert background and foreground colors. - `inverse` - Invert background and foreground colors.
- `hidden` - Print the text but make it invisible. - `hidden` - Print the text but make it invisible.
- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)* - `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
- `visible`- Print the text only when Chalk has a color level above zero. Can be useful for things that are purely cosmetic. - `visible` - Print the text only when Chalk has a color level above zero. Can be useful for things that are purely cosmetic.
### Colors ### Colors
@ -289,6 +289,8 @@ If absolute package size is important to you, I also maintain [yoctocolors](http
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings - [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal - [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
*(Not accepting additional entries)*
## Maintainers ## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus) - [Sindre Sorhus](https://github.com/sindresorhus)

View file

@ -1,14 +1,18 @@
/* eslint-env browser */ /* eslint-env browser */
const level = (() => { const level = (() => {
if (navigator.userAgentData) { if (!('navigator' in globalThis)) {
return 0;
}
if (globalThis.navigator.userAgentData) {
const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium'); const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');
if (brand && brand.version > 93) { if (brand && brand.version > 93) {
return 3; return 3;
} }
} }
if (/\b(Chrome|Chromium)\//.test(navigator.userAgent)) { if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) {
return 1; return 1;
} }

View file

@ -135,6 +135,14 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
return 3; return 3;
} }
if (env.TERM === 'xterm-ghostty') {
return 3;
}
if (env.TERM === 'wezterm') {
return 3;
}
if ('TERM_PROGRAM' in env) { if ('TERM_PROGRAM' in env) {
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);