Commit Graph

259 Commits (main)

Author SHA1 Message Date
Jacob Sandlund 7a1865080f Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-09-09 08:19:53 -04:00
Chris Marchesi 813e01a813
deps: update z2d to v0.8.0
Release notes at:
  https://github.com/vancluever/z2d/blob/v0.8.0/CHANGELOG.md

This is a small update and likely contains nothing related to Ghostty,
but I wanted to make sure it got in before the 1.2.0 release since it
contains the removal of non-functional code that wasn't compiling, just
for correctness' sake.

Also if for some reason ARGB/XRGB is needed for some utility purpose,
it's there now. :)
2025-09-08 11:15:01 -07:00
Jacob Sandlund 2a3629fe21 Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-09-08 08:31:34 -04:00
mitchellh ae95bb39ab deps: Update iTerm2 color schemes 2025-09-07 00:15:14 +00:00
Jacob Sandlund c3994347c0 doNotOptimizeAway 2025-09-06 14:55:21 -04:00
Jacob Sandlund f86a3a9b50 Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-09-06 14:31:41 -04:00
Jacob Sandlund 2af08bdbe3 trying a bunch of things to get performance to match 2025-09-06 10:42:02 -04:00
Jeffrey C. Ollie 43ee3cc8c6
update zig-gobject to Zig 0.15 version (but still builds on Zig 0.14) 2025-09-04 11:58:06 -05:00
Jeffrey C. Ollie e67db2a01c gtk-ng: pull in latest zig-gobject changes 2025-09-03 15:49:34 -07:00
Jacob Sandlund c67f51f3ee Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-09-01 01:34:03 -04:00
mitchellh c94805f0aa deps: Update iTerm2 color schemes 2025-08-31 00:16:30 +00:00
mitchellh 00e4a90699 deps: Update iTerm2 color schemes 2025-08-24 00:14:50 +00:00
Jacob Sandlund c7fa1d8381 using uucode for the graphemeBreak in shaper/web_canvas.zig 2025-08-23 14:33:11 -04:00
Jacob Sandlund 39ecfe9211 Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-08-23 09:16:11 -04:00
Jacob Sandlund 3c61aaca2a attempting to use uucode from uucode.x 2025-08-23 09:16:01 -04:00
Chris Marchesi 50fe12e85c
deps: update z2d to v0.7.2
Release notes at:
  https://github.com/vancluever/z2d/blob/v0.7.2/CHANGELOG.md

This is mostly a bugfix release for text rendering, including a fix for
an invalid free flagged as:
  https://github.com/vancluever/z2d/security/advisories/GHSA-v7f4-f3hm-282w

Note that the invalid free affects the new in-library text rendering
only and as such is likely not in use in Ghostty.

I'm anticipating *maybe* one more release after this ahead of Ghostty
1.2.0, depending on if I find any more bugs, but close to around the
release I am planning a freeze to ensure a clean versioned release
continues to be set.
2025-08-22 10:30:01 -07:00
Jacob Sandlund 0444c614da update for new grapheme_break 2025-08-21 22:29:34 -04:00
Jacob Sandlund 90832d89b3 Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-08-21 21:13:40 -04:00
Mitchell Hashimoto 936577c581
Update iTerm2 colorschemes (#8259)
Upstream revision:
8b639f0c26
2025-08-18 09:15:47 -07:00
Jacob Sandlund 8f0785e90a is_emoji_presentation 2025-08-17 21:33:37 -04:00
Jacob Sandlund 0b7ab006e9 nix and flatpak updates 2025-08-17 21:27:59 -04:00
Jacob Sandlund e84d8535f5 removing all ziglyph imports (aside from unicode/grapheme.zig) 2025-08-17 21:24:27 -04:00
Jacob Sandlund 1abc9b5e41 `array` 2025-08-17 19:05:40 -04:00
Jacob Sandlund 0979ea3371 Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-08-17 18:41:21 -04:00
Qwerasd 2a9ba56cdc deps: update z2d to 0.7.1 tagged release
This release contains performance and memory use improvements.

Some of the sprite font test renders had to be updated due to very minor
differences in the anti-aliasing, since the default anti-aliasing method
in z2d has been changed to MSAA rather than SSAA.
2025-08-17 14:00:20 -06:00
mitchellh 324d92ea31 deps: Update iTerm2 color schemes 2025-08-17 00:15:25 +00:00
Jacob Sandlund 341137ce2e case folding 2025-08-13 09:56:05 -04:00
Jacob Sandlund f5a036a6a0 update after refactor (string field config, etc) 2025-08-12 09:43:12 -04:00
Jacob Sandlund 563cfb94ba Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-08-12 09:38:19 -04:00
Jeffrey C. Ollie 2de0c108ba gtk-ng: better handling of weak references
The upstream GIR for g_weak_ref_get is incorrect - it does not allow the
returned value to be NULL. This PR pulls in a new version of our GObject
bindings with that patched and improves the safety of dealing with the
command palette weak reference held by the window.

See ianprime0509/zig-gobject#117
2025-08-11 11:56:08 -07:00
mitchellh c64701e744 deps: Update iTerm2 color schemes 2025-08-10 00:15:37 +00:00
Jeffrey C. Ollie 3b898a9800
gtk/gtk-ng: update zig-gobject to pick up fix for ianprime0509/zig-gobject#115 2025-08-06 21:19:18 -05:00
Jacob Sandlund 0c393299b0 using just `get` 2025-08-05 23:59:30 -04:00
Jacob Sandlund 8dec520b41 testing uucode.x 2025-08-04 10:02:41 -04:00
Jacob Sandlund e5bbc9e83d Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-08-04 10:00:33 -04:00
mitchellh 7a7790a212 deps: Update iTerm2 color schemes 2025-08-03 00:15:54 +00:00
Jacob Sandlund 807d128e20 Use `table_0_fields` build option 2025-07-30 11:22:35 -04:00
Jacob Sandlund fb2cab5aee Using uucode in a few places where it's easy. 2025-07-27 18:27:46 -04:00
Jacob Sandlund 70bc29f815 Initial testing including uucode 2025-07-27 16:30:55 -04:00
Jeffrey C. Ollie 80b72dd6cb
update zig-gobject pick up fix for ianprime0509/zig-gobject#111 2025-07-22 23:45:19 -05:00
Jeffrey C. Ollie 22b2344f50 gtk: update zig-gobject to get improved gobject accessors 2025-07-19 13:01:33 -07:00
Mitchell Hashimoto 355c8a4d16
build: update libxev to remove usingnamespace usage
This drops our `usingnamespace` usage to one more library (zigimg via
libvaxis) which should get fixed soon. With that, we have zero
usingnamespace and we should be able to test incremental compilation
with Zig (no binary mode, so Sema only) amongst other future features.
2025-07-13 21:36:37 -07:00
mitchellh b43fa129d6 deps: Update iTerm2 color schemes 2025-07-13 00:15:37 +00:00
Mitchell Hashimoto b799462745
Better Glyph Constraint Logic (#7809)
This is a big'un.

- **Glyph constraint logic is now done fully on the CPU** at the
rasterization stage, so it only needs to be done once per glyph instead
of every frame. This also lets us eliminate padding between glyphs on
the atlas because we're doing nearest-neighbor sampling instead of
interpolating-- which ever so slightly increases our packing efficiency.
- **Special constraints for nerd font glyphs** are applied based roughly
on the constraints they use in their patcher. It's a simplification of
what they do, the largest difference being that they scale groups of
glyphs based on a shared bounding box so that they maintain relative
size to one another, but that would require loading all glyphs on the
group and I'd want to do that on font load TBH and at that point I'd
basically be re-implementing the nerd fonts patcher in Zig to patch
fonts at load time which is way beyond the scope I want to have. (Fixes
#7069)
- These constraints allow for **perfectly sized and centered emojis**,
this is very nice.
- **Changed the default embedded fonts** from 4 copies (regular, italic,
bold, bold italic) of a patched (and outdated) JetBrains Mono to a
single JetBrains Mono variable font and a single Nerd Fonts Symbols Only
font. This cuts the weight of those down from 9MB to 3MB!
- **FreeType's `renderGlyph` is significantly reworked**, and the new
code is, IMO, much cleaner- although there are probably some edge case
behavior differences I've introduced.

> [!NOTE]
> One breaking change I definitely introduced is changing the
`monochrome` freetype load flag config from its previous completely
backwards meaning to instead the correct one (I also changed the
default, so this won't affect any user who hasn't touched it, but users
who set the `monochrome` flag will find their fonts quite crispy after
this change because they will have no anti-aliasing anymore)

### Future work

Following this change I want to get to work on automatic font size
matching (a la CSS
[`font-size-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust)).
I set the stage for that quite some time ago so it shouldn't be too much
work and it will be a big benefit for users who regularly use multiple
writing systems and so have multiple fonts for them that aren't
necessarily size-compatible.
2025-07-05 14:37:46 -07:00
Mitchell Hashimoto 9ff77a5622
build: switch symbols over 2025-07-05 14:23:10 -07:00
Mitchell Hashimoto 43404bf4dc
build: try again, also do symbol packages 2025-07-05 14:21:27 -07:00
Mitchell Hashimoto 28b54fe22b
build: fix JBM zip to tar.gz 2025-07-05 14:10:28 -07:00
Mitchell Hashimoto fb9c52ecf4
Nuke GLFW from Orbit
This deletes the GLFW apprt from the Ghostty codebase.

The GLFW apprt was the original apprt used by Ghostty (well, before
Ghostty even had the concept of an "apprt" -- it was all just a single
application then). It let me iterate on the core terminal features,
rendering, etc. without bothering about the UI. It was a good way to get
started. But it has long since outlived its usefulness.

We've had a stable GTK apprt for Linux (and Windows via WSL) and a
native macOS app via libghostty for awhile now. The GLFW apprt only
remained within the tree for a few reasons:

  1. Primarily, it provided a faster feedback loop on macOS because
     building the macOS app historically required us to hop out of the
     zig build system and into Xcode, which is slow and cumbersome.

  2. It was a convenient way to narrow whether a bug was in the
     core Ghostty codebase or in the apprt itself. If a bug was in both
     the glfw and macOS app then it was likely in the core.

  3. It provided us a way on macOS to test OpenGL.

All of these reasons are no longer valid. Respectively:

  1. Our Zig build scripts now execute the `xcodebuild` CLI directly and
     can open the resulting app, stream logs, etc. This is the same
     experience we have on Linux. (Xcode has always been a dependency of
     building on macOS in general, so this is not cumbersome.)

  2. We have a healthy group of maintainers, many of which have access
     to both macOS and Linux, so we can quickly narrow down bugs
     regardless of the apprt.

  3. Our OpenGL renderer hasn't been compatible with macOS for some time
     now, so this is no longer a useful feature.

At this point, the GLFW apprt is just a burden. It adds complexity
across the board, and some people try to run Ghostty with it in the real
world and get confused when it doesn't work (it's always been lacking in
features and buggy compared to the other apprts).

So, it's time to say goodbye. Its bittersweet because it is a big part
of Ghostty's history, but we've grown up now and it's time to move on.
Thank you, goodbye.

(NOTE: If you are a user of the GLFW apprt, then please fork the project
prior to this commit or start a new project based on it. We've warned
against using it for a very, very long time now.)
2025-07-04 14:12:18 -07:00
Qwerasd c2484f48ef font: add jb mono and symbols-only nerd font as dependencies
Rather than using binaries statically in our source tree; this makes
them easier to update. This also makes it so that they are separated
from each other rather than using a patched JB mono as our fallback.
2025-07-03 15:59:04 -06:00
Qwerasd 8ed08aaecf deps: update zig-objc
This update also fixes a memory leak that was caused by blocks not being
deallocated and just collecting every single frame, slowly accumulating
memory until OOM.
2025-07-02 16:38:13 -06:00
Qwerasd 61b7dffcaa deps: update z2d
We need to use this version of z2d so that we can get reproducible PNG
exports in CI for testing, since previously the PNG export was affected
by the CPU arch / features because it depended on vector width.
2025-06-30 11:16:47 -06:00
Mitchell Hashimoto d0e12cc082
update libxev to workaround the io_uring regression in Linux 6.15.4
Fixes #7724

Background at the end of the commit message. The fix in libxev is
described in the PR and commit we pin to here, but basically we swap
read for poll for eventfd/timerfd.

From Jens Axboe on X:

> This will fix it: https://pastebin.com/n7JSZWpW which makes me suspicious
> that it's an S_IFREG check somewhere else, as anon inodes are now listed as
> regular files. Has potentially pretty broad implications...

> I think I can already answer why that breaks things - io_uring checks if
> this is a regular file, and if it is, it doesn't do short reads. Short
> reads on regular files (or a bdev) will cause application issues, as
> basically nobody expects them.

> Now we have what acts like a char dev, but where io_uring will retry IO
> because the application asked for more data than what was delivered. This
> will cause the weird slowdowns as data isn't delivered as soon as it's
> available.
2025-06-29 15:11:24 -07:00
mitchellh 2f978fbdcf deps: Update iTerm2 color schemes 2025-06-29 00:15:18 +00:00
mitchellh fece388f58 deps: Update iTerm2 color schemes 2025-06-22 00:15:04 +00:00
-k d6b2d0ef2a fix: update `libxev` 2025-06-21 14:11:50 -07:00
-k 4d7a667dd1 build(deps): bump charlesrocket/libxev to `e29fc0c`
Waiting for mitchellh/libxev#167
2025-06-21 14:11:50 -07:00
-k c1830b563d Import `libxev` fork
Temp
2025-06-21 14:11:50 -07:00
mitchellh 3b33813071 deps: Update iTerm2 color schemes 2025-06-08 00:14:39 +00:00
mitchellh b94d2da567 deps: Update iTerm2 color schemes 2025-05-25 00:15:05 +00:00
mitchellh 8a0ca1b573 deps: Update iTerm2 color schemes 2025-05-18 00:14:40 +00:00
mitchellh db1608ff16 deps: Update iTerm2 color schemes 2025-05-11 00:14:21 +00:00
mitchellh abf5f18598 deps: Update iTerm2 color schemes 2025-05-04 00:14:51 +00:00
Mitchell Hashimoto 17441de37f
Update iTerm2 colorschemes (#7210)
Upstream revision:
5233095e44
2025-04-27 06:53:06 -07:00
rhodes-b 0c8339d2da update z2d to 0.6.1 2025-04-26 23:39:02 -05:00
mitchellh 12f48419b6 deps: Update iTerm2 color schemes 2025-04-27 00:14:50 +00:00
mitchellh 48cba761b9 deps: Update iTerm2 color schemes 2025-04-20 00:14:26 +00:00
mitchellh f6ec39a5d8 deps: Update iTerm2 color schemes 2025-04-06 00:13:30 +00:00
Jeffrey C. Ollie 9f57a03926
core: update libvaxis and zf for transitive zigimg dependency 2025-03-28 14:31:57 -05:00
Jeffrey C. Ollie 27978ef4d0
version bump for development 2025-03-26 23:29:15 -05:00
mitchellh 8aab16b6e6 deps: Update iTerm2 color schemes 2025-03-23 00:13:47 +00:00
Jeffrey C. Ollie ee95a5f3e0
gtk: convert App to zig-gobject 2025-03-17 23:39:45 -05:00
mitchellh 291c2f541c deps: Update iTerm2 color schemes 2025-03-16 14:17:59 +00:00
Jeffrey C. Ollie ec4d110251
build: update libvaxis and zf
Fixes #6734
2025-03-15 22:06:18 -05:00
Mitchell Hashimoto cfea2ea12c
build: mark most dependencies as lazy
Lazy dependencies are only fetched if the build script would actually
reach a usage of that dependency at runtime (when the `lazyDependency`
function is called). This can save a lot of network traffic, disk uage,
and time because we don't have to fetch and build dependencies that we
don't actually need.

Prior to this commit, Ghostty fetched almost everything for all
platforms and configurations all the time. This commit reverses that to
fetching almost nothing until it's actually needed.

There are very little downsides to doing this[1]. One downside is `zig
build --fetch` doesn't fetch lazy dependencies, but we don't rely on
this command for packaging and suggest using our custom shell script
that downloads a cached list of URLs (`build.zig.zon.txt`).

This commit doesn't cover 100% of dependencies, since some provide no
benefit to make lazy while the complexity to make them lazy is higher
(in code style typically).

Conversely, some simple dependencies are marked lazy even if they're
almost always needed if they don't introduce any real complexity to the
code, because there is very little downside to do so.

[1]: https://ziggit.dev/t/lazy-dependencies-best-dependencies/5509/5
2025-03-14 13:32:19 -07:00
Mitchell Hashimoto 221f905a1c
pkg/glfw
Closes #6702

This removes our mach-glfw dependency and replaces it with an in-tree
pkg/glfw that includes both the source for compiling glfw as well as the
Zig bindings. This matches the pattern from our other packages.

This is based on the upstream mach-glfw work and therefore includes the
original license and copyright information.

The reasoning is stated in the issue but to summarize for the commit:

  - mach-glfw is no longer maintained, so we have to take ownership
  - mach-glfw depended on some large blobs of header files to enable
    cross-compilation but this isn't something we actually care about,
    so we can (and do) drop the blobs
  - mach-glfw blobs were hosted on mach hosts. given mach-glfw is
    unmaintained, we can't rely on this hosting
  - mach-glfw relied on a "glfw" package which was owned by another
    person to be Zig 0.14 compatible, but we no longer need to rely on
    this
  - mach-glfw builds were outdated based on latest Zig practices
2025-03-13 20:52:33 -07:00
Mitchell Hashimoto b96a5d702b
fix mach-glfw on windows 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto b123b14686
update zig2nix 2025-03-12 15:56:24 -07:00
Mitchell Hashimoto 18084a3e61
update gobject, fix compiler errors 2025-03-12 12:32:50 -07:00
Mitchell Hashimoto 7e9be00924
working on macos 2025-03-12 10:15:14 -07:00
Mitchell Hashimoto bd848a27d2
update all packages to new hash for caching 2025-03-12 07:30:01 -07:00
Mitchell Hashimoto 2466de4556
pkg: update to new build.zig.zon format and hash values 2025-03-11 15:00:47 -07:00
Mitchell Hashimoto 251caeb22a
Zig 0.14 fixes 2025-03-11 14:53:30 -07:00
Mitchell Hashimoto 7e2286eb8c
Zig 0.14 2025-03-11 14:39:04 -07:00
Mitchell Hashimoto dd95f727ec
build: add libintl for macOS builds 2025-03-07 13:41:59 -08:00
Leah Amelia Chen cd442eb9e2
gtk: build gtk4-layer-shell ourselves
As of now `gtk4-layer-shell` is unavailable on recent, stable releases
of many distros (Debian 12, Ubuntu 24.04, openSUSE Leap & Tumbleweed, etc.)
and outdated on many others (Nixpkgs 24.11/unstable, Fedora 41, etc.)
This is inconvenient for our users and severely limits where the quick
terminal can be used. As a result we then build gtk4-layer-shell ourselves
by default unless `--system` or `-fsys=gtk4-layer-shell` are specified.
This also allows me to add an idiomatic Zig API on top of the library
and avoiding adding even more raw C code in the GTK apprt.

Since we now build gtk4-layer-shell it should be theoretically available
on all Linux systems we target. As such, the `-Dgtk-layer-shell` build
option has been removed. This is somewhat of an experimental change as
I don't know if gtk4-layer-shell works perfectly across all distros, and
we can always add the option back if need be.
2025-03-07 17:52:06 +01:00
mitchellh 29447b60b3 deps: Update iTerm2 color schemes 2025-03-02 00:13:13 +00:00
Mitchell Hashimoto d532a6e260
Update libxev to use dynamic backend, support Linux configurability
Related to #3224

Previously, Ghostty used a static API for async event handling: io_uring
on Linux, kqueue on macOS. This commit changes the backend to be dynamic
on Linux so that epoll will be used if io_uring isn't available, or if
the user explicitly chooses it.

This introduces a new config `async-backend` (default "auto") which can
be set by the user to change the async backend in use. This is a
best-effort setting: if the user requests io_uring but it isn't
available, Ghostty will fall back to something that is and that choice
is up to us.

Basic benchmarking both in libxev and Ghostty (vtebench) show no
noticeable performance differences introducing the dynamic API, nor
choosing epoll over io_uring.
2025-02-21 15:04:37 -08:00
mitchellh fe11efff63 deps: Update iTerm2 color schemes 2025-02-16 00:13:20 +00:00
Tim Culverhouse 9cb297202b cli: add +boo command
Add a `+boo` command to show the animation from the website. The data
for the frames is compressed during the build process. This build step
was added to the SharedDeps object because it is used in both
libghostty and in binaries.

The compression is done as follows:
- All files are concatenated together using \x01 as a combining byte
- The files are compressed to a cached build file
- A zig file is written to stdout which `@embedFile`s the compressed
  file and exposes it to the importer
- A new anonymous module "framedata" is added in the SharedDeps object

Any file can import framedata and access the compressed bytes via
`framedata.compressed`. In the `boo` command, we decompress the file and
split it into frames for use in the animation.

The overall addition to the binary size is 348k.
2025-02-14 14:46:18 -08:00
Mitchell Hashimoto 8231ebb770
build: mirror most of our direct dependencies
This adds a new script `update-mirror.sh` which generates the proper
blob format for R2 (or any blob storage) to mirror all of our
dependencies.

It doesn't automate updating build.zig.zon but on an ongoing basis this
should be easy to do manually, and we can strive to automate it in the
future.

I omitted iTerm2 color themes because we auto-update that via CI and
updating all of the machinery to send it to our mirror and so on is a
pain. Additionally, this doesn't mirror transitive dependencies because
Zig doesn't have a way to fetch those from a mirror instead (unless you
pre-generate a full cache like packagers but that's not practical for
day to day development).

It's hugely beneficial just to get most of our dependencies mirrored.
2025-02-14 10:06:15 -08:00
Jeffrey C. Ollie f32ad5216b build: generate a build.zig.zon.txt file for easy zig fetch scripting
This fixes a regression in 1.1.1/1.1.2 where our PACKAGING docs mention
using `fetch-zig-cache.sh` but it was removed. This commit adds it back,
generating its contents from the build.zig.zon file (via zon2nix which
we use for our Nix packaging).

For packagers, there are no dependency changes: you still need Zig and
POSIX sh. For release time, Ghostty has a new dependency on `jq` but
otherwise the release process is the same. The check-zig-cache.sh script
is updated to generate the new build.zig.zon.txt file.
2025-02-14 09:23:51 -08:00
Mitchell Hashimoto 52a5069dec
up versions for development 2025-02-13 15:31:14 -08:00
Mitchell Hashimoto 710ea1c8d9
up all the metadata to 1.1.2 2025-02-13 13:02:06 -08:00
Mitchell Hashimoto 5919c57527
build: replace codeberg dep with self-hosted mirror
The content hashes match so if users don't trust us they can grab from
upstream.
2025-02-13 09:18:50 -08:00
Leah Amelia Chen 843c714088
gtk: introduce Zig bindings for GTK/GObject
`zig-gobject` is a set of GObject bindings that allow us to write
GTK-facing code in Zig instead of getting hands dirty with C.
It's been tested and refined in real-life applications and several
GTK contributors agree that it is a marked improvement over using
the C API directly, such as allowing method call syntax and avoiding
many manual `@ptrCast`s.

This commit doesn't actually contain any changes to our preexisting
GTK code — the migration process is intended to begin in chunks,
firstly in self-contained components (e.g. the header bar, overlays,
etc.), and then full-scale migration can begin when we remove non-Adwaita
GTK builds for 1.2. (After all, why port code that you'll remove later
either way?)
2025-02-10 18:34:08 +01:00
mitchellh 5100f4ff7d deps: Update iTerm2 color schemes 2025-02-02 00:10:42 +00:00
Mitchell Hashimoto c5508e7d19
update version for development 2025-01-30 14:23:24 -08:00
Mitchell Hashimoto a62b26cd2f
next version will be 1.1.0 2025-01-30 07:18:43 -08:00
Mitchell Hashimoto 9ab2e563bb
Update libxev to fix zombie processes on macOS
Fixes #4554

xev.Process.wait is documented as being equivalent to calling `waitpid`,
i.e. including reaping the process. On Linux, it does this automatically
by using pidfd and the `waitid` syscall. On macOS, it wasn't doing this.

This commit updates libxev to include a fix that explicitly calls
`waitpid` for kqueue.
2025-01-24 12:07:01 -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