67 Commits

Author SHA1 Message Date
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
Jeffrey C. Ollie
3a8c934b19 nix: use zig2nix to manage nix cache/deps
This brings the internal package more in line with how the nixpkgs
package is built. It also handles recursive dependencies better than the
current system.
2025-02-11 08:25:34 -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
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
mitchellh
3f367857fc deps: Update iTerm2 color schemes 2025-01-19 00:58:22 +00:00
mitchellh
50e33a6665 deps: Update iTerm2 color schemes 2025-01-12 01:01:09 +00:00
Mitchell Hashimoto
6e411d60f2 Fix wayland-scanner/protocols packaging dependency
By updating zig-wayland:
https://codeberg.org/ifreund/zig-wayland/issues/67
2025-01-10 09:57:29 -08:00
Mitchell Hashimoto
622cc3f9c7 build: update zig-wayland to use new LazyPath API
This is a more idiomatic way to handle build paths in Zig 0.13 and
later.
2025-01-08 19:55:57 -08:00
Mitchell Hashimoto
bade7be021 Use build.zig.zon for Wayland protocols 2025-01-07 20:26:26 -08:00
Mitchell Hashimoto
0ae8d9ed42 nix: update hash 2025-01-05 12:30:16 -08:00
mitchellh
6db39e827e deps: Update iTerm2 color schemes 2025-01-05 01:00:16 +00:00
Jeffrey C. Ollie
652079b26c wuffs: update, add jpeg decoding, add simple tests 2025-01-01 22:48:30 -06:00
mitchellh
12a333dfb4 deps: Update iTerm2 color schemes 2024-12-31 05:40:18 +00:00
mitchellh
a671ca43f8 deps: Update iTerm2 color schemes 2024-12-29 01:00:43 +00:00
Qwerasd
b920352c39 deps: update z2d to v0.4.0
Introduces static path methods and a reworked context API that makes
things generally cleaner.

This update incidentally fixed a bug we had before where the corner
triangle shade characters were drawn solid rather than medium shade.
2024-12-22 16:07:05 -05:00
mitchellh
7da6af85e1 deps: Update iTerm2 color schemes 2024-12-22 01:01:15 +00:00
mitchellh
854ec586f9 deps: Update iTerm2 color schemes 2024-12-15 01:05:52 +00:00
mitchellh
c4029015b9 deps: Update iTerm2 color schemes 2024-12-12 21:45:11 +00:00
Mitchell Hashimoto
313752dee2 update libxev
This fixes a possible deadlock. This has never happened in reports by
beta testers but good hygiene to get this fixed.
2024-12-08 16:49:50 -08:00
furtidev
d32e3be0b3 update nix cache 2024-11-16 21:15:20 +06:00
Mitchell Hashimoto
523e3a6ae3 deps: update iterm2 color themes 2024-11-12 19:49:53 -08:00
Mitchell Hashimoto
b26ff0a41b deps: update zf and nix hash 2024-11-12 19:07:07 -08:00
Mitchell Hashimoto
98c4c453ee update iterm2 themes 2024-11-05 16:32:30 -08:00
Mitchell Hashimoto
f8d2ac6c8c update zig-objc
removes usingnamespace
2024-11-04 09:52:19 -08:00
Mitchell Hashimoto
038b3dec79 update zig-objc
This fixes a hack we had around apple paths since we do this now
upstream in zig-objc. This also adds in support for NSFastEnumeration
needed for #2586
2024-11-03 15:21:26 -08:00
Mitchell Hashimoto
dc26a9abe0 nix hash 2024-10-15 09:26:46 -07:00
Tim Culverhouse
e502597e8d fix(list-keybinds): reset SGR after pretty printing
Update libvaxis which now resets SGR at the end of a pretty print.

Fixes: #2333
2024-09-30 20:16:27 -07:00
Jeffrey C. Ollie
39733ac3e5 nix: work around ziglang/zig#20976 and fix nix package builds
Because Zig does not fetch recursive dependencies when you run `zig build
--fetch` (see https://github.com/ziglang/zig/issues/20976) we need to do some
extra work to fetch everything that we actually need to build without Internet
access (such as when building a Nix package).

An example of this happening:

```
error: builder for '/nix/store/cx8qcwrhjmjxik2547fw99v5j6np5san-ghostty-0.1.0.drv' failed with exit code 1;
      la/build/tmp.xgHOheUF7V/p/12208cfdda4d5fdbc81b0c44b82e4d6dba2d4a86bff644a153e026fdfc80f8469133/build.zig.zon:7:20: error: unable to discover remote git server capabilities: TemporaryNameServerFailure
      >             .url = "git+https://github.com/zigimg/zigimg#3a667bdb3d7f0955a5a51c8468eac83210c1439e",
      >                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      > /build/tmp.xgHOheUF7V/p/12208cfdda4d5fdbc81b0c44b82e4d6dba2d4a86bff644a153e026fdfc80f8469133/build.zig.zon:16:20: error: unable to discover remote git server capabilities: TemporaryNameServerFailure
      >             .url = "git+https://github.com/mitchellh/libxev#f6a672a78436d8efee1aa847a43a900ad773618b",
      >                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      >
      For full logs, run 'nix log /nix/store/cx8qcwrhjmjxik2547fw99v5j6np5san-ghostty-0.1.0.drv'.
```

To update this script, add any failing URLs with a line like this:

```
  zig fetch <url>
```

Periodically old URLs may need to be cleaned out.

Hopefully when the Zig issue is fixed this script can be eliminated in favor
of a plain `zig build --fetch`.
2024-09-27 15:49:02 -05:00
Jeffrey C. Ollie
a969364f93 cli/list-themes: add ability to search theme names 2024-09-27 10:53:58 -07:00
Jeffrey C. Ollie
743e547235 cli: "fancy" theme preview
This adds a "fancy" theme preview to the `+list-themes` CLI action.
By default, if the command is connected to a TTY, it will display the
fancy preview. If it is not connected to a TTY, or the user specifies
`--plain` on the command line, a simple list of themes will be printed
to stdout.

While in the preview `F1` or `?` will show a help screen.
2024-09-27 10:53:58 -07:00
Mitchell Hashimoto
c91c5164ff update libxev
This fixes the issue where a write could be interrupted and not retried.
2024-09-23 09:30:57 -07:00
Mitchell Hashimoto
e6c3ba2cf9 update zig cache hash 2024-09-02 20:47:07 -07:00
Mitchell Hashimoto
f133206c55 nix: update cache 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
b826c98701 update nix hash 2024-08-28 21:43:18 -07:00
hanna
329848ca60 update the zig cache hash for nix 2024-08-07 17:53:31 -07:00
Mitchell Hashimoto
d50fa27243 nix: update hash 2024-08-06 14:55:40 -07:00
Mitchell Hashimoto
a5ddf57d4c nix: update hash 2024-08-01 10:30:57 -07:00
Mitchell Hashimoto
c8e94a5553 nix: update hash 2024-08-01 10:15:14 -07:00
Mitchell Hashimoto
ac0550e267 update libxev 2024-06-24 15:16:24 -07:00
Mitchell Hashimoto
5eff2d88a2 nix: update package to zig 0.13 2024-06-24 15:16:24 -07:00
Mitchell Hashimoto
f062d6e405 Update libxev
Fixes #1836, upstream: efde8a1708
2024-06-23 21:32:44 -07:00
Mitchell Hashimoto
4b277f1bca update color themes to a34aeb1f505707a35102fe95984d4bea4a85eb3e 2024-06-03 19:24:56 -07:00
Mitchell Hashimoto
0fdbf80381 nix: update hash 2024-05-25 14:12:56 -07:00
Mitchell Hashimoto
a11c7ac785 update Dear Imgui to 1.90.6 2024-05-10 10:17:33 -07:00
Mitchell Hashimoto
0030ce7ff9 nix: update hash again 2024-05-09 21:08:43 -07:00
Mitchell Hashimoto
76ff6b81d8 nix: update cache hash 2024-05-09 21:02:26 -07:00
Mitchell Hashimoto
dbbaceec4a fix windows build 2024-04-18 14:48:07 -07:00
Mitchell Hashimoto
5370ac7eef nix: update cache hash 2024-04-18 14:23:10 -07:00