mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Add TODOs from jerch's comments
This commit is contained in:
@@ -537,6 +537,9 @@ export class KittyApcHandler {
|
||||
}
|
||||
|
||||
if (format === KittyFormat.PNG) {
|
||||
// TODO: Older Safari versions cannot createImageBitmap from Blob and need a workaround
|
||||
// with new Image() instead. See IIPHandler for the Safari fallback pattern.
|
||||
// ---> Things seem to work for my safari, but still try to see how I can verify.
|
||||
const blob = new Blob([bytes], { type: 'image/png' });
|
||||
return createImageBitmap(blob);
|
||||
}
|
||||
@@ -557,6 +560,7 @@ export class KittyApcHandler {
|
||||
|
||||
// Convert to RGBA ImageData
|
||||
// TODO: Get this checked by Daniel.
|
||||
// TODO: Follow Jerch's feedback!
|
||||
const pixelCount = width * height;
|
||||
const data = new Uint8ClampedArray(pixelCount * BYTES_PER_PIXEL_RGBA);
|
||||
const isRgba = format === KittyFormat.RGBA;
|
||||
|
||||
@@ -44,6 +44,10 @@ export class KittyGraphicsAddon implements ITerminalAddon, IKittyGraphicsApi {
|
||||
|
||||
// Register APC handler for 'G' (0x47) - Kitty graphics protocol
|
||||
// APC sequence format: ESC _ G <data> ESC \
|
||||
// TODO: Follow jerch's feedback: The string-based handler interface is limited to 10MB
|
||||
// and has bad runtime due to string conversion overhead. Implement IApcHandler interface with
|
||||
// start/put/end methods to receive raw Uint32Array codepoints without copying.
|
||||
// See SixelHandler and IIPHandler.
|
||||
this._apcHandler = terminal.parser.registerApcHandler(0x47, (data: string) => {
|
||||
return this._kittyApcHandler?.handle(data) ?? true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user