Skip to content

Comments

feat: add Kitty Graphics Protocol and Sixel support for diagram rendering#71

Merged
vobu merged 4 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60-3ee1c85f-8828-41c6-b151-aab80e16c426
Feb 18, 2026
Merged

feat: add Kitty Graphics Protocol and Sixel support for diagram rendering#71
vobu merged 4 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60-3ee1c85f-8828-41c6-b151-aab80e16c426

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Diagram rendering (c8ctl get pi --diagram) only implemented iTerm2 Inline Images Protocol (OSC 1337), which Ghostty doesn't support. Ghostty requires Kitty Graphics Protocol. Additionally, added Sixel protocol support for legacy terminals.

Changes

  • Added supports-terminal-graphics dependency for automatic protocol detection
  • Implemented Kitty Graphics Protocol alongside existing iTerm2 protocol:
    • Chunked transmission (4KB) with proper continuation flags (m=0/m=1)
    • PNG format signaling (f=100)
    • Escape sequence: \x1b_Ga=T,f=100,m=X;<base64>\x1b\\
  • Implemented Sixel protocol for legacy terminal support:
    • Uses pngjs for PNG decoding and sixel package for encoding
    • 256 color quantization
    • Supports xterm, mintty, mlterm, and other legacy terminals
  • Protocol selection: Detects terminal capabilities and uses:
    • Kitty for Ghostty/Kitty/WezTerm/Konsole
    • iTerm2 for iTerm2/VS Code/mintty
    • Sixel for xterm/mintty/mlterm and legacy terminals
  • Regenerated package-lock.json from scratch with Node 22 LTS

Example

// Before: only iTerm2 protocol
process.stdout.write(`\x1b]1337;File=${args}:${base64}\x07\n`);

// After: automatic protocol detection and selection
const support = supportsTerminalGraphics.stdout;
if (support.kitty) {
  printKittyImage(pngBuffer);  // Ghostty, Kitty, etc.
} else if (support.iterm2) {
  printIterm2Image(pngBuffer, filename);  // iTerm2, VS Code, etc.
} else if (support.sixel) {
  await printSixelImage(pngBuffer);  // xterm, legacy terminals
} else {
  printIterm2Image(pngBuffer, filename);  // fallback
}

Diagrams now render correctly in iTerm2, Ghostty, and legacy terminals with Sixel support.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…nals

Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feature to render BPMN diagrams as PNG images feat: add Kitty Graphics Protocol support for diagram rendering Feb 18, 2026
Copilot AI requested a review from vobu February 18, 2026 14:22
} else if (support.iterm2) {
// Use iTerm2 Inline Images Protocol
printIterm2Image(pngBuffer, filename);
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include an implementation for support.sixel (from supports-terminal-graphics) as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Sixel graphics protocol support in commit b3bfe40. The diagram rendering now supports three protocols:

  • Kitty Graphics Protocol for Ghostty, Kitty, WezTerm, Konsole
  • iTerm2 Inline Images Protocol for iTerm2, WezTerm, mintty, VS Code
  • Sixel protocol for xterm, mintty, mlterm, and legacy terminals

The implementation uses pngjs to decode PNG data and the sixel package to encode it to Sixel format with 256 colors.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redo an "npm install" for Node 22 LTS and redo package-lock.json from scratch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regenerated package-lock.json from scratch with Node 22 LTS in commit b3bfe40. Also fixed a missing comma in package.json dependencies that was causing parse errors.

… with Node 22

Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Copilot AI changed the title feat: add Kitty Graphics Protocol support for diagram rendering feat: add Kitty Graphics Protocol and Sixel support for diagram rendering Feb 18, 2026
Copilot AI requested a review from vobu February 18, 2026 14:34
@vobu vobu marked this pull request as ready for review February 18, 2026 14:50
@vobu vobu merged commit 27855a9 into feat/process-instance-diagram Feb 18, 2026
1 check passed
@vobu vobu deleted the copilot/sub-pr-60-3ee1c85f-8828-41c6-b151-aab80e16c426 branch February 18, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants