Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions demo/client/components/window/testWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ function sgrTest(term: Terminal): void {
{ ps: 47, name: 'Background White' },
{ ps: 49, name: 'Background default' },
{ ps: 53, name: 'Overlined' },
{ ps: 55, name: 'Not overlined' }
{ ps: 55, name: 'Not overlined' },
{ ps: 221, name: 'Not bold (kitty)' },
{ ps: 222, name: 'Not faint (kitty)' }
];
const maxNameLength = entries.reduce<number>((p, c) => Math.max(c.name.length, p), 0);
for (const e of entries) {
Expand All @@ -684,7 +686,9 @@ function sgrTest(term: Terminal): void {
const comboEntries: { ps: number[] }[] = [
{ ps: [1, 2, 3, 4, 5, 6, 7, 9] },
{ ps: [2, 41] },
{ ps: [4, 53] }
{ ps: [4, 53] },
{ ps: [1, 2, 221] },
{ ps: [1, 2, 222] }
];
term.write('\n\n\r');
term.writeln(`Combinations`);
Expand Down
16 changes: 16 additions & 0 deletions src/common/InputHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,22 @@ describe('InputHandler', () => {
await inputHandler.parseP('\x1b[22m');
assert.equal(!!inputHandler.curAttrData.isDim(), false);
});
it('SGR 221 resets bold only (kitty)', async () => {
await inputHandler.parseP('\x1b[1;2m');
assert.equal(!!inputHandler.curAttrData.isBold(), true);
assert.equal(!!inputHandler.curAttrData.isDim(), true);
await inputHandler.parseP('\x1b[221m');
assert.equal(!!inputHandler.curAttrData.isBold(), false);
assert.equal(!!inputHandler.curAttrData.isDim(), true);
});
it('SGR 222 resets faint only (kitty)', async () => {
await inputHandler.parseP('\x1b[1;2m');
assert.equal(!!inputHandler.curAttrData.isBold(), true);
assert.equal(!!inputHandler.curAttrData.isDim(), true);
await inputHandler.parseP('\x1b[222m');
assert.equal(!!inputHandler.curAttrData.isBold(), true);
assert.equal(!!inputHandler.curAttrData.isDim(), false);
});
it('italic', async () => {
await inputHandler.parseP('\x1b[3m');
assert.equal(!!inputHandler.curAttrData.isItalic(), true);
Expand Down
8 changes: 8 additions & 0 deletions src/common/InputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,8 @@ export class InputHandler extends Disposable implements IInputHandler {
* | 53 | Overlined. | #Y |
* | 55 | Not Overlined. | #Y |
* | 58 | Underline color: Extended color. | #P[Support for RGB and indexed colors, see below.] |
* | 221 | Not bold (kitty extension). | #Y |
* | 222 | Not faint (kitty extension). | #Y |
* | 90 - 97 | Bright foreground color (analogous to 30 - 37). | #Y |
* | 100 - 107 | Bright background color (analogous to 40 - 47). | #Y |
*
Expand Down Expand Up @@ -2652,6 +2654,12 @@ export class InputHandler extends Disposable implements IInputHandler {
} else if (p === 55) {
// not overline
attr.bg &= ~BgFlags.OVERLINE;
} else if (p === 221) {
// not bold (kitty extension)
attr.fg &= ~FgFlags.BOLD;
} else if (p === 222) {
// not faint (kitty extension)
attr.bg &= ~BgFlags.DIM;
} else if (p === 59) {
attr.extended = attr.extended.clone();
attr.extended.underlineColor = -1;
Expand Down
Loading