diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index 2e57278e..17baef11 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -2672,10 +2672,10 @@ export class InputHandler extends Disposable implements IInputHandler { } else if (p === 55) { // not overline attr.bg &= ~BgFlags.OVERLINE; - } else if (p === 221) { + } else if (p === 221 && (this._optionsService.rawOptions.vtExtensions?.kittySgrBoldFaintControl ?? true)) { // not bold (kitty extension) attr.fg &= ~FgFlags.BOLD; - } else if (p === 222) { + } else if (p === 222 && (this._optionsService.rawOptions.vtExtensions?.kittySgrBoldFaintControl ?? true)) { // not faint (kitty extension) attr.bg &= ~BgFlags.DIM; } else if (p === 59) { diff --git a/src/common/services/Services.ts b/src/common/services/Services.ts index c3f69fb4..70d145e0 100644 --- a/src/common/services/Services.ts +++ b/src/common/services/Services.ts @@ -310,6 +310,7 @@ export interface ITerminalQuirks { export interface IVtExtensions { kittyKeyboard?: boolean; + kittySgrBoldFaintControl?: boolean; } export const IOscLinkService = createDecorator('OscLinkService'); diff --git a/typings/xterm-headless.d.ts b/typings/xterm-headless.d.ts index f4a4f991..9094b09d 100644 --- a/typings/xterm-headless.d.ts +++ b/typings/xterm-headless.d.ts @@ -331,6 +331,15 @@ declare module '@xterm/headless' { * [0]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ */ kittyKeyboard?: boolean; + + /** + * Whether [SGR 221 (not bold) and SGR 222 (not faint) are enabled][0]. + * These are kitty extensions that allow resetting bold and faint + * independently. The default is true. + * + * [0]: https://sw.kovidgoyal.net/kitty/misc-protocol/ + */ + kittySgrBoldFaintControl?: boolean; } /** diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 8001c25e..21239981 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -448,6 +448,15 @@ declare module '@xterm/xterm' { * [0]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ */ kittyKeyboard?: boolean; + + /** + * Whether [SGR 221 (not bold) and SGR 222 (not faint) are enabled][0]. + * These are kitty extensions that allow resetting bold and faint + * independently. The default is true. + * + * [0]: https://sw.kovidgoyal.net/kitty/misc-protocol/ + */ + kittySgrBoldFaintControl?: boolean; } /**