9868 Commits

Author SHA1 Message Date
Uzair Aftab
09d538b620 feat: source .envrc.local if it exists
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-03-14 11:50:56 +01:00
Leah Amelia Chen
07b653bd71 contributing: link to po/README_CONTRIBUTORS.md 2025-03-14 08:46:06 +01:00
Leah Amelia Chen
e8101c1136 contributing: fix link to Translator's Guide
For some reason it pointed to the Contributor's Guide instead...
2025-03-14 08:44:04 +01:00
Mitchell Hashimoto
8eacde92e6 Replace mach-glfw with pkg/glfw (#6708)
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 21:18:41 -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
73c7943fff CODEOWNERS: add localization teams (#6704) 2025-03-13 10:19:29 -07:00
Mitchell Hashimoto
d8497d9b16 CODEOWNERS: add localization teams 2025-03-13 10:07:27 -07:00
Mitchell Hashimoto
ef0ff94c75 translations: add German translation (#6601)
This PR adds a translation for German `de_DE`.

Additionally it excludes all `*.po` files from the typos CI action.

Some comments on the decisions I made (open to discuss them):

- I choosed to use `du` instead of `Sie` as this seems appropriate
  to me.
- I added `Window` (`Fenster` in German) to all split commands
  as it appears more naturally to me.
2025-03-13 10:05:27 -07:00
Jeffrey C. Ollie
572fc8b5d7 gtk: convert Surface to zig-gobject 2025-03-13 12:04:10 -05:00
Mitchell Hashimoto
1f6b1d75eb Fix aspect ratio when rendering images with kitty protocol (#6675)
Fixes https://github.com/ghostty-org/ghostty/issues/6673

<img width="914" alt="image"
src="https://github.com/user-attachments/assets/010a1304-0d46-46ec-9a82-87a8d8fbea1b"
/>
2025-03-13 09:50:19 -07:00
Mitchell Hashimoto
aeada3f1a8 Zig 0.14 (#6699)
Closes #5744 

This gets Ghostty onto Zig 0.14. The goal of this PR is to focus only on
Zig 0.14 _compatibility_. I plan to open a number of subsequent issues
for future improvements I'd like to tackle, as noted in #5744.

I did run some basic benchmarks on a Zig 0.13 vs 0.14 build and didn't
notice any statistically significant changes. All our scrolling
benchmarks on vtebench got consistently 1 or 2ms faster but that may
just be noise. The good news is nothing got consistently slower (nothing
got slower at all on any runs!).

The Git history here is kind of nasty, I'm going to squash it.
2025-03-13 09:36:09 -07:00
Mitchell Hashimoto
f1f9db8b96 Update PACKAGING to note Zig 0.14 requirement 2025-03-13 09:18:34 -07:00
Mitchell Hashimoto
a542e63582 pkg/gtk4-layer-shell: disable ubsan 2025-03-13 09:14:37 -07:00
Mitchell Hashimoto
bdb66984b6 for iOS simulator builds for apple M1 as base CPU model 2025-03-13 07:13:13 -07:00
Mitchell Hashimoto
6613a695f0 nix 2025-03-12 16:30:22 -07:00
Mitchell Hashimoto
b96a5d702b fix mach-glfw on windows 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
66c83648c8 ci: debian 12 build should use zig 0.14 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
1dbeba7065 ci: update snap to Zig 0.14 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
fc21444f2d fix windows 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
907ed239a1 update typos 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
b123b14686 update zig2nix 2025-03-12 15:56:24 -07:00
Mitchell Hashimoto
99bde549af fix /usr/lib issues 2025-03-12 15:46:15 -07:00
Mitchell Hashimoto
1f6aa0e90d apprt/glfw: move darwin enabled const out to top-level 2025-03-12 12:53:15 -07:00
Mitchell Hashimoto
18084a3e61 update gobject, fix compiler errors 2025-03-12 12:32:50 -07:00
Mitchell Hashimoto
816ff8cef0 fix tests building on Linux 2025-03-12 11:29:13 -07:00
Mitchell Hashimoto
2e45a4c7a3 fix typos 2025-03-12 11:23:11 -07:00
Mitchell Hashimoto
3116a1b92c bundle ubsan rt 2025-03-12 11:07:15 -07:00
Mitchell Hashimoto
601acf4059 pkg/highway: upgrade to fix compilation issues on LLVM18 2025-03-12 11:03:54 -07:00
Mitchell Hashimoto
7e9be00924 working on macos 2025-03-12 10:15:14 -07:00
Mitchell Hashimoto
43467690f3 test 2025-03-12 10:04:17 -07:00
Mitchell Hashimoto
2408d4c6a9 more fixes 2025-03-12 09:59:24 -07:00
Mitchell Hashimoto
0f4d2bb237 Lots of 0.14 changes 2025-03-12 09:55:52 -07:00
Mitchell Hashimoto
86d3f18707 pkg/oniguruma: fix build 2025-03-12 09:10:17 -07:00
Bryan Lee
2f814b37e8 Add unit tests for kitty image aspect ratio calculation 2025-03-12 22:44:17 +08:00
Mitchell Hashimoto
bd848a27d2 update all packages to new hash for caching 2025-03-12 07:30:01 -07:00
Bryan Lee
f091a69790 Fix aspect ratio when rendering images with kitty protocol 2025-03-12 15:06:06 +08: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
3abbe6d3ba nix: must not inject xcrun into PATH on macOS 2025-03-11 14:49:01 -07:00
Mitchell Hashimoto
7e2286eb8c Zig 0.14 2025-03-11 14:39:04 -07:00
Leah Amelia Chen
95daca616d core: refactor RepeatablePath into separate files and add Path (#6622)
Slims down `Config.zig` and makes some of the code reusable in Path.
2025-03-10 09:14:25 +01:00
Leah Amelia Chen
14b66e93d1 pkg(gtk4-layer-shell): Enable using system-installed headers for dynamic linking (#6624)
I noticed we weren't doing system-integration against the pkgconfig for
gtk4-layer-shell. This behaviour differed from how we handled system
integration for existing deps in `pkg/` (oniguruma, fontconfig).

Refactored `pkg/gtk4-layer-shell/build.zig` referencing
`pkg/oniguruma/build.zig` to use pkgconfig names in system integration.
Previously we used to libname `libgtk4-layer-shell.so`
(`gtk4-layer-shell`) instead of pkgconfig name `gtk4-layer-shell-0.pc`
which meant system integration still relied on fetching the C-headers
via `zig fetch` instead of system C-headers.

I've tested this with a `--system` build where the relevant
`.zig-cache/p/<hash of gtk4-layer-shell>` is stubbed to an empty
directory and `pkgconfig(gtk4-layer-shell-0)` is installed instead on
fedora linux.
2025-03-10 09:11:42 +01:00
Mitchell Hashimoto
0ecee3ee92 Fix passing EnvMap for Flatpak builds (#6647)
When using -Dflatpak=true the EnvMap was passed as the incorrect type.
2025-03-09 18:39:54 -07:00
Mitchell Hashimoto
57d0a4d2e7 font(freetype): constrain emoji to cell width (#6602)
When scaling emoji (with freetype), we would unilaterally scale the
bitmap to fit within the `cell_height`. For narrow fonts, this would
result in a horizontal overflow:


![image](https://github.com/user-attachments/assets/87b9f952-6f12-40b2-bbed-5bfe948f45b4)

Modify the glyph rendering such that we scale to fit within the cell
width. After doing so, the above image looks like:


![image](https://github.com/user-attachments/assets/c75bfa51-4730-4179-b032-c3afa7840d65)

The emoji glyph is noticeably smaller because we have constrained the
height further than before, but fits perfectly within two cells. I am
using Victor Mono as my font, which is pretty narrow. The effect would
be even more pronounced on something like Iosevka.
2025-03-09 18:34:34 -07:00
Mitchell Hashimoto
480b1a9805 macOS: only set LANGUAGE for app bundle, do not inherit in termio env (#6648)
Fixes #6633

For macOS, we set LANGUAGE to the priority list of preferred languages
for the app bundle, using the GNU gettext priority list format (colon
separated list of language codes).

This previously was inherited by the termio env. At first, this was by
design, but this has inherent flaws. Namely, the priority list format is
a GNU gettext specific format, and programs that use alternate gettext
implementations (like musl or Python) do not understand it and actually
do the wrong thing (not their fault!).

This change removes the inheritance of LANGUAGE in the termio env. To
make it extra safe, we only do set and unset LANGUAGE when we know we
launch from an app bundle. That was always the desired behavior but this
makes it more explicit.
2025-03-09 17:08:55 -07:00
Mitchell Hashimoto
ebffe299ce macOS: only set LANGUAGE for app bundle, do not inherit in termio env
Fixes #6633

For macOS, we set LANGUAGE to the priority list of preferred languages
for the app bundle, using the GNU gettext priority list format (colon
separated list of language codes).

This previously was inherited by the termio env. At first, this was by
design, but this has inherent flaws. Namely, the priority list format is
a GNU gettext specific format, and programs that use alternate gettext
implementations (like musl or Python) do not understand it and actually
do the wrong thing (not their fault!).

This change removes the inheritance of LANGUAGE in the termio env. To
make it extra safe, we only do set and unset LANGUAGE when we know we
launch from an app bundle. That was always the desired behavior but this
makes it more explicit.
2025-03-09 18:17:38 -05:00
Yorick Peterse
300f4544ef Fix passing EnvMap for Flatpak builds
When using -Dflatpak=true the EnvMap was passed as the incorrect type.
2025-03-09 23:46:24 +01:00
Jeffrey C. Ollie
843cc83f42 gtk: implement quick-terminal-size (#6629)
Fixes #2384 on GTK

I'm not exactly sure how to deal with centered quick terminals so I
opted to make them similar to either top/bottom or left/right quick
terminals based on the monitor's orientation (portrait/landscape). This
may not be the right approach, so I'd like to hear more thoughts about
this.
2025-03-09 09:51:04 -05:00
Mitchell Hashimoto
78f16d040d macOS: disable setting LANGUAGE for now until bug is fixed
See: https://github.com/ghostty-org/ghostty/discussions/6633

This is temporary while we figure this out.
2025-03-09 07:25:55 -07:00
Jeffrey C. Ollie
6767493428 core: move RepeatablePath to separate file and enable Path as config type
Slim down Config.zig by moving RepeatablePath to a separate file and
enable the use of Path as it's own config type.
2025-03-09 09:18:01 -05:00