Commit Graph

202 Commits (facda0c3fb1310c7698fc77ba193165ef38cd58e)

Author SHA1 Message Date
Jeffrey C. Ollie 6dd9bf0038
nix: fix Ghostty homepage in package 2025-01-30 11:04:44 -06:00
Mitchell Hashimoto adf4066b69
nix: use --system build flag instead of relying on $ZIG_GLOBAL_CACHE_DIR (#5434)
Fixes #5431
2025-01-30 08:48:31 -08:00
Jeffrey C. Ollie 40973417d0
nix: use --system build flag instead of relying on $ZIG_GLOBAL_CACHE_DIR
Fixes #5431
2025-01-30 10:16:45 -06: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
Mitchell Hashimoto 78a2a815f3
nix: vms for testing ghostty (#4608)
Adds a Nix VM configuration to run Gnome/Wayland. The primary purpose
will be testing Ghostty in a "clean" environment. I'm going to continue
to experiment with running this in CI to see if we can do some basic
testing of GTK since it's difficult to unit test that code.

To use, run `nix run .#wayland-gnome` in the Ghostty source directory. I
have no idea if this works on macOS. There's probably a lot of extra
stuff that can be trimmed to slim it down.

Whatever directory you run this from will be mounted at `/tmp/shared` in
the VM. The `ghostty` user runs as uid/gid 1000/1000 so that may affect
your ability to read/write that directory if your host system user runs
as a different uid/gid.

If this is something that we'd like to keep, we should add VM
definitions for KDE Plasma and maybe one tiling window manager.


https://github.com/user-attachments/assets/57190913-f338-4383-93aa-90c9e351543d
2025-01-23 16:03:29 -08:00
mitchellh 3f367857fc deps: Update iTerm2 color schemes 2025-01-19 00:58:22 +00:00
Jeffrey C. Ollie 3159a7bec7
nix: add x11 xfce vm 2025-01-15 20:37:31 -06:00
Jeffrey C. Ollie 423133bc3c
nix: document how to create custom vms 2025-01-15 11:56:19 -06:00
Jeffrey C. Ollie 1ac56a7ac2
nix vm: +fish +zsh -zig 2025-01-15 10:25:03 -06:00
Jeffrey C. Ollie 321119e001
nix vm: more reusability 2025-01-15 10:25:03 -06:00
Jeffrey C. Ollie e1e2f94681
nix vm: try and make vm creation more re-usable 2025-01-15 10:25:03 -06:00
Jeffrey C. Ollie 268fc1a040
nix vm: simplify vm definition 2025-01-15 10:25:03 -06:00
Jeffrey C. Ollie 450c019b4e
nix vm: add plasma and cinnamon vms 2025-01-15 10:25:03 -06:00
Jeffrey C. Ollie 6be0902c09
nix vm: add documentation, add Gnome/X11 VM 2025-01-15 10:25:02 -06:00
Jeffrey C. Ollie dddc2a50a8
nix vm: more slimming 2025-01-15 10:25:02 -06:00
Jeffrey C. Ollie 4bfb1f616c
nix: disable geary 2025-01-15 10:25:02 -06:00
Jeffrey C. Ollie 4ff7f6df06
nix: fix dark mode setting 2025-01-15 10:25:02 -06:00
Jeffrey C. Ollie 0b456d14a4
nix: vms for testing ghostty 2025-01-15 10:24:58 -06: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 8bf5c4ed7f
This is a major refactor of `build.zig`.
The major idea behind the refactor is to split the `build.zig` file up into
distinct `src/build/*.zig` files. By doing so, we can improve readability of
the primary `build.zig` while also enabling better reuse of steps. Our
`build.zig` is now less than 150 lines of code (of course, it calls into a lot
more lines but they're neatly organized now).

Improvements:

  * `build.zig` is less than 150 lines of readable code.
  * Help strings and unicode table generators are only run once when multiple
    artifacts are built since the results are the same regardless of target.
  * Metal lib is only built once per architecture (rather than once per artifact)
  * Resources (shell integration, terminfo, etc.) and docs are only
    built/installed for artifacts that need them

Breaking changes:

  * Removed broken wasm build (@gabydd will re-add)
  * Removed conformance files, shell scripts are better and we don't run
    these anymore
  * Removed macOS app bundle creation, we don't use this anymore since we
    use Xcode

## Some History

Our `build.zig` hasn't been significantly refactored since the project started,
when Zig was _version 0.10_. Since then, the build system has changed
significantly. We've only ever duct taped the `build.zig` as we needed to
support new Zig versions, new features, etc. It was a mess.

The major improvement is adapting the entire Ghostty `build.zig` to the Step
and LazyPath changes introduced way back in Zig 0.12. This lets us better take
advantage of parallelism and the dependency graph so that steps are only
executed as they're needed.

As such, you can see in the build.zig that we initialize a lot of things, but
unless a final target (i.e. install, run) references those steps, _they'll
never be executed_. This lets us clean up a lot.
2025-01-07 19:47:43 -08:00
Mitchell Hashimoto ce77b91bf6
nix fmt 2025-01-05 12:37:56 -08:00
Mitchell Hashimoto 0ae8d9ed42
nix: update hash 2025-01-05 12:30:16 -08:00
Leah Amelia Chen 31439f311d build: add wayland 2025-01-05 12:27:11 -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
Mitchell Hashimoto 1d71196de3
up version to 1.0.2 for development 2024-12-31 14:12:00 -08:00
mitchellh 12a333dfb4 deps: Update iTerm2 color schemes 2024-12-31 05:40:18 +00:00
Jeffrey C. Ollie b6e45d49a3
gtk/x11: link directly to libX11, no more dlopen 2024-12-29 01:15:01 -06:00
mitchellh a671ca43f8 deps: Update iTerm2 color schemes 2024-12-29 01:00:43 +00:00
Jeffrey C. Ollie 8ecb11a602
gtk: add option to not link against libX11 2024-12-28 13:40:17 -06:00
Mitchell Hashimoto 35b9ceee21
up the version to 1.0.1 everywhere for dev 2024-12-26 15:21:50 -08:00
Mitchell Hashimoto 68f09eb60d
set version metadata to 1.0.0 2024-12-26 11:49:31 -08:00
Mitchell Hashimoto 010e73517d
nix: move vimfiles instead of copying (#3073) 2024-12-22 19:07:41 -08: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
Jeffrey C. Ollie b41db4f288
nix: move vimfiles instead of copying 2024-12-22 14:25:36 -06:00
mitchellh 7da6af85e1 deps: Update iTerm2 color schemes 2024-12-22 01:01:15 +00:00
Anund ac6956f1fe nix: support `programs.vim.plugins = [ ghostty.vim ]`
nix vim module expects vim plugins to have their code organized as top level
directories. eg: /ftdetect rather than /share/vim/vimfiles/ftdetect. Adding
a separate output seems like a convenient way to reference the plugin
files in `programs.vim.plugins ...`. Interestingly nvim will find the
plugin via nested directories making ghostty.vim and ghostty the same
for `programs.neovim.plugins`
2024-12-19 07:21:54 -08:00
Anund c39b60709f nix: address warning to use toplevel adwaita-icon-theme 2024-12-17 14:37:20 +11: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
Mitchell Hashimoto 1ee7da174b
flake: update to Nix 24.11 2024-12-05 12:15:48 -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