13 Commits

Author SHA1 Message Date
Mitchell Hashimoto
f73cae0738 Ignore SIGPIPE
Fixes #5359

The comments explain what's going on. Longer term we should adjust our
termio/exec to avoid the SIGPIPE but its still possible (i.e. that
thread crashes) to happen so we should be robust to it.
2025-01-24 13:48:30 -08:00
Mitchell Hashimoto
0d6a1d3fdb Prevent fd leaks to the running shell or command
Multiple fixes to prevent file descriptor leaks:

- libxev eventfd now uses CLOEXEC
- linux: cgroup clone now uses CLOEXEC for the cgroup fd
- termio pipe uses pipe2 with CLOEXEC
- pty master always sets CLOEXEC because the child doesn't need it
- termio exec now closes pty slave fd after fork

There still appear to be some fd leaks happening. They seem related to
GTK, they aren't things we're accessig directly. I still want to
investigate them but this at least cleans up the major sources of fd
leakage.
2025-01-23 22:12:58 -08:00
Mitchell Hashimoto
5c469a0b44 renderer: render lock for password input 2024-09-18 11:14:37 -07:00
Mitchell Hashimoto
4f6995d727 termio: poll termios for changes 2024-09-18 10:34:07 -07:00
Mitchell Hashimoto
e7cbeba140 pty: reset all signals after fork 2024-08-31 15:12:45 -07:00
Mitchell Hashimoto
9f52a963f5 pty: remove usingns 2024-08-16 10:37:31 -07:00
Mitchell Hashimoto
b7bf59d772 update zig 2024-03-22 11:15:26 -07:00
Mitchell Hashimoto
c2c115a768 fix some issues 2024-03-13 13:40:07 -07:00
Mitchell Hashimoto
3360a008cd build: build produces a broken object file for iOS
This gets `zig build -Dtarget=aarch64-ios` working. By "working" I mean
it produces an object file without compiler errors. However, the object
file certainly isn't useful since it uses a number of features that will
not work in the iOS sandbox.

This is just an experiment more than anything to see how hard it would be to
get libghostty working within iOS to render a terminal. Note iOS doesn't
support ptys so this wouldn't be a true on-device terminal. The
challenge right now is to just get a terminal rendering (not usable).
2024-01-13 21:38:58 -08:00
Krzysztof Wolicki
46699d53d1 Update to latest master 2023-11-30 21:40:01 +01:00
Mitchell Hashimoto
c9b7439354 pty: stylistic changes 2023-11-05 17:59:08 -08:00
Mitchell Hashimoto
85a5a231f2 termio: cleanup 2023-11-05 17:52:46 -08:00
Mitchell Hashimoto
74b840df8e rename Pty.zig to pty.zig 2023-11-05 23:41:45 +00:00