Skip to content

Kitty dnd parser#13029

Merged
jcollie merged 4 commits into
ghostty-org:mainfrom
ajr-khll:kitty-dnd-parser
Jul 4, 2026
Merged

Kitty dnd parser#13029
jcollie merged 4 commits into
ghostty-org:mainfrom
ajr-khll:kitty-dnd-parser

Conversation

@ajr-khll

@ajr-khll ajr-khll commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

(#12852)
I opened a discussion to work on the new kitty dnd protocol and implementing it for Ghostty. I was told to work on the parser but not to hook up any actions to it yet. So, that's what I did! Largely based the format on kitty_clipboard_protocol.zig, and used Claude Opus 4.8 (Claude Code) for writing tests and some structural guidance early on. Would love to get started on adding actions as well!

ajr-khll added 2 commits June 15, 2026 17:41
Adds an OSC 72 parser following the kitty drag and drop protocol
specification. Parses metadata and payload into a Command.kitty_dnd_protocol
variant. Reassembly of chunked transfers and any action handling are
intentionally out of scope here; stream.zig logs the command as
unimplemented for now.

Includes a walkthrough document covering the design and each touched file.
Trims over-commented fields and enum variants to match the repo
baseline (kitty_clipboard_protocol style). Adds 11 tests covering
metadata/payload parsing, all EventType values, integer keys,
negative sentinels, case-sensitive key matching, and BEL terminator
recording. Removes the development walkthrough document.
@ajr-khll ajr-khll requested a review from a team as a code owner June 16, 2026 11:31

@jcollie jcollie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Be nice to have some more comments but otherwise this looks good. Didn't look at the spec, only looking at the Zig code here.

Comment thread src/terminal/osc/parsers/kitty_dnd_protocol.zig
Comment thread src/terminal/osc/parsers/kitty_dnd_protocol.zig
@mitchellh mitchellh enabled auto-merge June 18, 2026 20:32
@mitchellh

Copy link
Copy Markdown
Contributor

Looks like a great starting point thank you.

auto-merge was automatically disabled June 22, 2026 13:22

Head branch was pushed to by a user without write access

@ajr-khll ajr-khll requested review from a team as code owners June 22, 2026 13:22
@ajr-khll

Copy link
Copy Markdown
Contributor Author

Just completed drag and drop into the terminal, for GTK. Yet to implement drag and drop out of the terminal. took some help from Claude again.

@bo2themax bo2themax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see any Swift or header file changes, but I'll approve it just in case it blocks the merge in the future.

@jcollie jcollie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm going to have to block this PR. You were asked to submit the protocol parsing only but you've added the whole implementation as well. If you roll back the implementation changes we can get this approved, and then in a separate PR you can submit the GTK implementation.

@ajr-khll ajr-khll force-pushed the kitty-dnd-parser branch from 5fb4a3d to c488ccd Compare July 4, 2026 04:53
@ajr-khll

ajr-khll commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Rolled back to just the parser implementation. I'll make a separate PR for the GTK soon.

@jcollie jcollie enabled auto-merge July 4, 2026 07:03
@jcollie jcollie merged commit 6887509 into ghostty-org:main Jul 4, 2026
180 of 186 checks passed
@github-actions github-actions Bot added this to the 1.4.0 milestone Jul 4, 2026
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.

4 participants