Skip to content

inspector: add copy and export for terminal IO events - #13519

Merged
jcollie merged 3 commits into
ghostty-org:mainfrom
Uzaaft:dev/uzaaft/export
Aug 1, 2026
Merged

jcollie merged 3 commits into
ghostty-org:mainfrom
Uzaaft:dev/uzaaft/export

Conversation

@Uzaaft

@Uzaaft Uzaaft commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Adds "Copy" and "Export to file" buttons to the Terminal IO inspector so recorded VT events can be saved outside the app for sharing or analysis.

Found myself needing/wishing for this while I was debugging my tmux fork with libghostty-vt.

Disclaimer: I haven't considered performance at all, so please lmk if there are anything here you would like me to optimize.

Adds "Copy" and "Export to file" buttons to the Terminal IO inspector
so recorded VT events can be saved outside the app for sharing or
analysis.

Export is wired up through a new export_terminal_io apprt action,
handled with a native save dialog on both macOS and GTK.
@Uzaaft
Uzaaft requested review from a team as code owners July 30, 2026 06:10
@ghostty-bot ghostty-bot Bot added the inspector Terminal inspector issue label Jul 30, 2026

@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.

Image

@Uzaaft

Uzaaft commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

I'm gonna fix the build errors 🫡

Comment on lines +2086 to +2089
log.err(
"failed to export terminal IO events err={s}",
.{err.f_message orelse "(unknown)"},
);

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.

This should probably also be an in app notification

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.

That probably should be some sort of popup or similar in the inspector, not in Ghostty proper

@Uzaaft
Uzaaft requested a review from a team as a code owner July 31, 2026 16:40

@trag1c trag1c 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.

The .po changes look fine. Our v1.4 string freeze starts today (not formalized in a document yet) but I think it's fine to squeeze this one in.

Comment on lines +99 to +108

cimgui.c.ImGui_SameLineEx(0, cimgui.c.ImGui_GetStyle().*.ItemInnerSpacing.x);
if (cimgui.c.ImGui_Button("Copy")) {
self.copyEvents(surface);
}

cimgui.c.ImGui_SameLineEx(0, cimgui.c.ImGui_GetStyle().*.ItemInnerSpacing.x);
if (cimgui.c.ImGui_Button("Export to file")) {
self.exportEvents(surface);
}

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 find it a little distracting that these buttons appear/disappear depending on whether there are any events buffered. But that can be a fix for another day.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jcollie I can get behind that. I'll make them always be visible.

@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.

There are some things that should be addressed in follow-up PRs but otherwise LGTM.

@jcollie
jcollie merged commit 631c71e into ghostty-org:main Aug 1, 2026
97 checks passed
@github-actions github-actions Bot added this to the 1.4.0 milestone Aug 1, 2026
@Uzaaft
Uzaaft deleted the dev/uzaaft/export branch September 30, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inspector Terminal inspector issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants