diff --git a/package.json b/package.json index 3fd5094..c9e0dc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chalk", - "version": "5.4.0", + "version": "5.6.2", "description": "Terminal string styling done right", "license": "MIT", "repository": "chalk/chalk", diff --git a/readme.md b/readme.md index 455efaa..ce1f3f3 100644 --- a/readme.md +++ b/readme.md @@ -178,10 +178,10 @@ console.log(foregroundColorNames.includes('pink')); - `italic` - Make the text italic. *(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)* -- `inverse`- Invert background and foreground colors. +- `inverse` - Invert background and foreground colors. - `hidden` - Print the text but make it invisible. - `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 @@ -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 - [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal +*(Not accepting additional entries)* + ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) diff --git a/source/vendor/supports-color/browser.js b/source/vendor/supports-color/browser.js index 9fa6888..fbb6ce0 100644 --- a/source/vendor/supports-color/browser.js +++ b/source/vendor/supports-color/browser.js @@ -1,14 +1,18 @@ /* eslint-env browser */ const level = (() => { - if (navigator.userAgentData) { + if (!('navigator' in globalThis)) { + return 0; + } + + if (globalThis.navigator.userAgentData) { const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium'); if (brand && brand.version > 93) { return 3; } } - if (/\b(Chrome|Chromium)\//.test(navigator.userAgent)) { + if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) { return 1; } diff --git a/source/vendor/supports-color/index.js b/source/vendor/supports-color/index.js index 1388372..265d7f8 100644 --- a/source/vendor/supports-color/index.js +++ b/source/vendor/supports-color/index.js @@ -135,6 +135,14 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { return 3; } + if (env.TERM === 'xterm-ghostty') { + return 3; + } + + if (env.TERM === 'wezterm') { + return 3; + } + if ('TERM_PROGRAM' in env) { const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);