-
Notifications
You must be signed in to change notification settings - Fork 22
termio: add zmx backend for persistent terminal sessions #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
72dc627
4eb974f
8b34709
9b5d9d0
e0ebec4
f7405f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1534,6 +1534,16 @@ class: ?[:0]const u8 = null, | |||||||||||||||||||||||||||
| /// * `inherit` - The working directory of the launching process. | ||||||||||||||||||||||||||||
| @"working-directory": ?[]const u8 = null, | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| /// Connect to a zmx daemon session instead of spawning a new shell process. | ||||||||||||||||||||||||||||
| /// When set, the surface connects to the named zmx session over a Unix | ||||||||||||||||||||||||||||
| /// domain socket. The zmx daemon owns the PTY and persists independently | ||||||||||||||||||||||||||||
| /// of the surface, enabling session persistence across restarts. | ||||||||||||||||||||||||||||
| @"zmx-session": ?[]const u8 = null, | ||||||||||||||||||||||||||||
|
Comment on lines
+1537
to
+1541
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document the
Suggested wording-/// Connect to a zmx daemon session instead of spawning a new shell process.
-/// When set, the surface connects to the named zmx session over a Unix
+/// Prefer connecting to a zmx daemon session instead of spawning a new shell
+/// process.
+/// When set, the surface connects to the named zmx session over a Unix
/// domain socket. The zmx daemon owns the PTY and persists independently
/// of the surface, enabling session persistence across restarts.
+/// If zmx is unavailable, Ghostty falls back to the exec backend and logs
+/// a warning.
@"zmx-session": ?[]const u8 = null,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| /// Whether to create the zmx session if it doesn't already exist. | ||||||||||||||||||||||||||||
| /// Only applies when `zmx-session` is set. Default: true. | ||||||||||||||||||||||||||||
| @"zmx-create": bool = true, | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| /// Key bindings. The format is `trigger=action`. Duplicate triggers will | ||||||||||||||||||||||||||||
| /// overwrite previously set values. The list of actions is available in | ||||||||||||||||||||||||||||
| /// the documentation or using the `ghostty +list-actions` command. | ||||||||||||||||||||||||||||
|
|
@@ -10597,6 +10607,40 @@ test "compatibility: gtk-single-instance desktop" { | |||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| test "parse zmx config defaults and override" { | ||||||||||||||||||||||||||||
| const testing = std.testing; | ||||||||||||||||||||||||||||
| const alloc = testing.allocator; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| var cfg = try Config.default(alloc); | ||||||||||||||||||||||||||||
| defer cfg.deinit(); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| var it: TestIterator = .{ .data = &.{ | ||||||||||||||||||||||||||||
| "--zmx-session=session-1", | ||||||||||||||||||||||||||||
| } }; | ||||||||||||||||||||||||||||
| try cfg.loadIter(alloc, &it); | ||||||||||||||||||||||||||||
| try cfg.finalize(); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| try testing.expectEqualStrings("session-1", cfg.@"zmx-session".?); | ||||||||||||||||||||||||||||
| try testing.expect(cfg.@"zmx-create"); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| var cfg = try Config.default(alloc); | ||||||||||||||||||||||||||||
| defer cfg.deinit(); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| var it: TestIterator = .{ .data = &.{ | ||||||||||||||||||||||||||||
| "--zmx-session=session-1", | ||||||||||||||||||||||||||||
| "--zmx-create=false", | ||||||||||||||||||||||||||||
| } }; | ||||||||||||||||||||||||||||
| try cfg.loadIter(alloc, &it); | ||||||||||||||||||||||||||||
| try cfg.finalize(); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| try testing.expectEqualStrings("session-1", cfg.@"zmx-session".?); | ||||||||||||||||||||||||||||
| try testing.expect(!cfg.@"zmx-create"); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| test "compatibility: removed cursor-invert-fg-bg" { | ||||||||||||||||||||||||||||
| const testing = std.testing; | ||||||||||||||||||||||||||||
| const alloc = testing.allocator; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify the empty-string contract in
Surface.Options.inittreatszmx_session=""as "clear/unset", andzmx_mode=truewill still auto-generate a session from that state. The field docs still describe any non-nullzmx_sessionas a direct attach and only mention auto-generation fornull, so the public API contract is now a little misleading.📝 Suggested doc update
📝 Committable suggestion
🤖 Prompt for AI Agents