Repository navigation
inspector: add copy and export for terminal IO events - #13519
Conversation
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.
|
I'm gonna fix the build errors 🫡 |
| log.err( | ||
| "failed to export terminal IO events err={s}", | ||
| .{err.f_message orelse "(unknown)"}, | ||
| ); |
There was a problem hiding this comment.
This should probably also be an in app notification
There was a problem hiding this comment.
That probably should be some sort of popup or similar in the inspector, not in Ghostty proper
trag1c
left a comment
There was a problem hiding this comment.
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.
|
|
||
| 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); | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@jcollie I can get behind that. I'll make them always be visible.
jcollie
left a comment
There was a problem hiding this comment.
There are some things that should be addressed in follow-up PRs but otherwise LGTM.

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.