Ghostty hangs when trying to close the window. #4880
-
VersionGhostty 1.0.2-main+12ce9f2e3b19 IssueGhostty hangs when multiple tabs (or windows, if I bisected this to 3e24e96 (#4171). Repro stepsUsing GNOME:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
This diff fixes it for me, but it seems like the motiviation for #4171 was to not write to the pipe. So I guess the question is why does my If we must prevent writes to the poll, we either need to have a timeout on the poll and periodically check for diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig
index d409ccbb0423..ae7a5203c416 100644
--- a/src/termio/Exec.zig
+++ b/src/termio/Exec.zig
@@ -180,6 +180,8 @@ pub fn threadExit(self: *Exec, td: *termio.Termio.ThreadData) void {
// we don't get stuck waiting for data to stop flowing if it is
// a particularly noisy process.
if (exec.read_thread_pipe) |pipe| {
+ _ = posix.write(pipe, "x") catch |err|
+ log.warn("error writing to read thread quit pipe err={}", .{err});
posix.close(pipe);
// Tell deinit that we've already closed the pipe
exec.read_thread_pipe = null;
@@ -1454,8 +1456,10 @@ pub const ReadThread = struct {
return;
};
- // If our quit fd is closed, we're done.
- if (pollfds[1].revents & posix.POLL.HUP != 0) {
+ // If our quit fd is closed or has data available, we're done.
+ if (pollfds[1].revents & posix.POLL.HUP != 0 or
+ pollfds[1].revents & posix.POLL.IN != 0)
+ {
log.info("read thread got quit signal", .{});
return;
} |
Beta Was this translation helpful? Give feedback.
-
I can reproduce using
|
Beta Was this translation helpful? Give feedback.
-
Today I had the similar situation. I had two tabs and run |
Beta Was this translation helpful? Give feedback.
-
#4838 is another example of this |
Beta Was this translation helpful? Give feedback.
-
This was fixed through reverting the problematic commit and I opend an issued to track the original issue we were trying to fix. |
Beta Was this translation helpful? Give feedback.
This was fixed through reverting the problematic commit and I opend an issued to track the original issue we were trying to fix.