Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3049436
Support Kitty graphics protocol
anthonykim1 Jan 22, 2026
6a02d7c
Add some playwright tests that will first fail
anthonykim1 Jan 22, 2026
4477463
npm install to update pckage-lock.json
anthonykim1 Jan 22, 2026
bea1628
Edit ci.yml ?
anthonykim1 Jan 22, 2026
fc0dc3f
Dont mess with og formatting for ci.yml
anthonykim1 Jan 22, 2026
8f0e711
ci.yml
anthonykim1 Jan 22, 2026
ec5b421
Renderer + og formatting for ci.yml
anthonykim1 Jan 22, 2026
a507afb
Add rendering, tweak send-png
anthonykim1 Jan 22, 2026
27825f9
param in kittyGraphicsAddon.ts , ci.yml
anthonykim1 Jan 22, 2026
8b6f8f3
Rename
anthonykim1 Jan 23, 2026
849110d
add query to say OK responses
anthonykim1 Jan 23, 2026
bc1d87d
comments
anthonykim1 Jan 23, 2026
5e95ef6
more comments
anthonykim1 Jan 23, 2026
1442f84
Fix chunking for large data, allow pixels
anthonykim1 Jan 28, 2026
40342ec
remove send-png
anthonykim1 Jan 28, 2026
e2dabc7
Prefer ?? and move disposable location
anthonykim1 Jan 28, 2026
ae171ac
Dont forget about action o for compression
anthonykim1 Jan 28, 2026
17d4395
switch from triggerDataEvnet to this._terminal.input
anthonykim1 Jan 28, 2026
d58e859
Use Terminal.dimensions intead
anthonykim1 Jan 28, 2026
b0b0868
Conste num for keys, describe in jsdoc
anthonykim1 Jan 28, 2026
259cc67
Handle actions, compression first, then parseInt before Switch
anthonykim1 Jan 28, 2026
fd64137
Dont use magic number, use symbol
anthonykim1 Jan 28, 2026
15c71e2
Replace more magic numbers with readable symbols
anthonykim1 Jan 28, 2026
a1c1702
Assemble and use dataArray for ImageData, make hot-loop faster
anthonykim1 Jan 28, 2026
f89524e
Create KittyApchandler.ts
anthonykim1 Jan 28, 2026
8c9afdb
Outsource a bunch to KittyApcHandler. TODO: go over this
anthonykim1 Jan 28, 2026
3e8fc48
Small details
anthonykim1 Jan 28, 2026
5a79b08
stale comments
anthonykim1 Jan 28, 2026
d777119
comments on file system
anthonykim1 Jan 28, 2026
a1b69e5
TODO on wasm stuff
anthonykim1 Jan 28, 2026
492d950
Add TODOs from jerch's comments
anthonykim1 Jan 28, 2026
cb8159c
Start integrating KittyGraphics stuff into imageAddon as suggested
anthonykim1 Jan 29, 2026
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
Binary file added addons/addon-image/fixture/kitty/black-1x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/addon-image/fixture/kitty/rgb-3x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion addons/addon-image/src/ImageAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { ImageAddon as IImageApi } from '@xterm/addon-image';
import { IIPHandler } from './IIPHandler';
import { ImageRenderer } from './ImageRenderer';
import { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';
import { KittyGraphicsHandler } from './kitty/KittyGraphicsHandler';
import { SixelHandler } from './SixelHandler';
import { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';

Expand All @@ -22,7 +23,9 @@ const DEFAULT_OPTIONS: IImageAddonOptions = {
storageLimit: 128,
showPlaceholder: true,
iipSupport: true,
iipSizeLimit: 20000000
iipSizeLimit: 20000000,
kittySupport: true,
kittySizeLimit: 20000000
};

// max palette size supported by the sixel lib (compile time setting)
Expand Down Expand Up @@ -144,6 +147,15 @@ export class ImageAddon implements ITerminalAddon , IImageApi {
terminal._core._inputHandler._parser.registerOscHandler(1337, iipHandler)
);
}

// Kitty graphics handler
if (this._opts.kittySupport) {
const kittyHandler = new KittyGraphicsHandler(this._opts, this._renderer!, this._storage!, terminal);
this._handlers.set('kitty', kittyHandler);
this._disposeLater(
terminal._core._inputHandler._parser.registerApcHandler(0x47, kittyHandler)
);
}
}

// Note: storageLimit is skipped here to not intoduce a surprising side effect.
Expand Down
6 changes: 4 additions & 2 deletions addons/addon-image/src/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IDisposable, IMarker, Terminal } from '@xterm/xterm';
// private imports from base repo we build against
import { Attributes, BgFlags, Content, ExtFlags, UnderlineStyle } from 'common/buffer/Constants';
import type { AttributeData } from 'common/buffer/AttributeData';
import type { IParams, IDcsHandler, IOscHandler, IEscapeSequenceParser } from 'common/parser/Types';
import type { IParams, IDcsHandler, IOscHandler, IApcHandler, IEscapeSequenceParser } from 'common/parser/Types';
import type { IBufferLine, IExtendedAttrs, IInputHandler } from 'common/Types';
import type { ITerminal, ReadonlyColorSet } from 'browser/Types';
import type { IRenderDimensions } from 'browser/renderer/shared/Types';
Expand All @@ -22,7 +22,7 @@ export const enum Cell {
}

// export some privates for local usage
export { AttributeData, IParams, IDcsHandler, IOscHandler, BgFlags, IRenderDimensions, IRenderService, Content, ExtFlags, Attributes, UnderlineStyle, ReadonlyColorSet };
export { AttributeData, IParams, IDcsHandler, IOscHandler, IApcHandler, BgFlags, IRenderDimensions, IRenderService, Content, ExtFlags, Attributes, UnderlineStyle, ReadonlyColorSet };

/**
* Plugin ctor options.
Expand All @@ -38,6 +38,8 @@ export interface IImageAddonOptions {
sixelSizeLimit: number;
iipSupport: boolean;
iipSizeLimit: number;
kittySupport: boolean;
kittySizeLimit: number;
}

export interface IResetHandler {
Expand Down
Loading
Loading