9928 Commits

Author SHA1 Message Date
Mitchell Hashimoto
bfec219510 Regenerate translations to fix CI (#6820)
I don't see any actual changes here, just reordering. It's using the Nix
environment so I'm not sure why this happened but it seemed to stem from
the Norwegian work originally. Fixing it back.
2025-03-19 08:39:00 -07:00
Mitchell Hashimoto
e56002e149 Regenerate translations.
I don't see any actual changes here, just reordering. It's using the Nix
environment so I'm not sure why this happened but it seemed to stem from
the Norwegian work originally. Fixing it back.
2025-03-19 08:35:39 -07:00
Leah Amelia Chen
907e62aa29 Fix typo: Alejanda → Alejandra in README.md (#6817) 2025-03-19 14:03:38 +01:00
CKay9
dc21ea9998 Fix typo: Alejanda → Alejandra in README.md 2025-03-19 13:38:38 +01:00
azhn
c5b1961c6b os: Add extra sentinel for GHOSTTY_RESOURCES_DIR
Discover resourcesdir with `terminfo/g/ghostty`
as well as existing `terminfo/x/xterm-ghostty`.
This allows either terminfo file to be installed,
notably ncurses only provides a `terminfo/g/ghostty`.
2025-03-19 20:49:02 +11:00
Mitchell Hashimoto
bd7c5cc95f Add Norwegian Bokmål Translations (#6731)
Pull request to add Norwegian Bokmål translations.
Asking assistance from @Uzaaft for review and help.
2025-03-18 16:04:41 -07:00
hanna
02bfa946d5 i18n: add norwegian bokmal translations 2025-03-18 15:44:46 -07:00
Mitchell Hashimoto
f7999444eb ci: zig fmt check (#6802)
This adds a CI test to ensure that all Zig files are properly formatted.
This avoids unrelated diff noise in future PRs.

This also runs `zig fmt` once to clean up all formatting issues for
future PRs.

I also introduced a new `xsm` (extra small) runner profile to use less
resources for our tiny tasks.
2025-03-18 14:39:34 -07:00
Jeffrey C. Ollie
07ec421cd3 CI: Add checks for blueprint compiler / Nix refactors (#6801)
1. Refactored Nix devshell/package to make it easier to keep
LD_LIBRARY_PATH & buildInputs in sync (plus make it easier to re-use in
other Nix environment).
2. Added a CI job to ensure that Blueprints are formatted correctly and
that they will compile using `blueprint-compiler` 0.16.0.
3. Reformatted all Blueprints with `blueprint-compiler format`.
2025-03-18 16:37:34 -05:00
Jeffrey C. Ollie
648e0a06ab CI: Add checks for blueprint compiler / Nix refactors
1. Refactored Nix devshell/package to make it easier to keep
   LD_LIBRARY_PATH & buildInputs in sync (plus make it easier to re-use
   in other Nix environment).
2. Added a CI job to ensure that Blueprints are formatted correctly and
   that they will compile using `blueprint-compiler` 0.16.0.
3. Reformatted all Blueprints with `blueprint-compiler format`.
2025-03-18 16:12:49 -05:00
Mitchell Hashimoto
4d0bf303c6 ci: zig fmt check
This adds a CI test to ensure that all Zig files are properly formatted.
This avoids unrelated diff noise in future PRs.
2025-03-18 13:58:49 -07:00
Mitchell Hashimoto
c0f5f913c9 zig build dist and distcheck for source tarballs (#6800)
This moves the source tarball creation process into the Zig build system
and follows the autotools-standard naming conventions of `dist` and
`distcheck`.

This doesn't change any of our build process otherwise. This is the
foundation for #6760 along with other source tarball tasks I have
planned (i.e. gobject bindings too).

The `dist` target creates a source tarball in the `PREFIX/dist`
directory. The tarball is named `ghostty-VERSION.tar.gz` as expected by
standard source tarball conventions.

The `distcheck` target does the same as `dist`, but also takes the
resulting tarball, extracts it, and runs tests on the extracted source
to verify the source tarball works as expected. Distcheck currently only
runs `zig build test` but in the future we can add additional checks to
run.

This commit also updates CI:

  1. Tagged releases now use the new `zig build distcheck` command.
  2. Tip releases now use the new `zig build dist` command.
3. A new test build tests that source tarball generation works on every
commit.
2025-03-18 13:21:24 -07:00
Mitchell Hashimoto
bab8c28c8b zig build dist and distcheck for source tarballs
This moves the source tarball creation process into the Zig build system
and follows the autotools-standard naming conventions of `dist` and
`distcheck`.

The `dist` target creates a source tarball in the `PREFIX/dist`
directory. The tarball is named `ghostty-VERSION.tar.gz` as expected by
standard source tarball conventions.

The `distcheck` target does the same as `dist`, but also takes the
resulting tarball, extracts it, and runs tests on the extracted source
to verify the source tarball works as expected.

This commit also updates CI:

  1. Tagged releases now use the new `zig build distcheck` command.
  2. Tip releases now use the new `zig build dist` command.
  3. A new test build tests that source tarball generation works on
     every commit.
2025-03-18 12:41:55 -07:00
Leah Amelia Chen
69590c80a1 gtk: unify gtk/adwaita version checks, use std.SemanticVersion in all cases (#6797) 2025-03-18 20:35:34 +01:00
Jeffrey C. Ollie
5bf10dce12 c804cd3dbb0274f3271736e0b8f279795bdff394 2025-03-18 14:14:50 -05:00
Jeffrey C. Ollie
0f2f0ab69f Update Adwaita version check for Box unref (#6796)
As of Adwaita 1.5.0, the GTK Box is not being properly unref'd when the
parent window is closed. Update the conditional to account for this.

Also add a couple of missing unref()s in errdefers.

This fixes an issue where Ghostty would not properly quit after closing
the last surface.
https://github.com/ghostty-org/ghostty/discussions/3807 is related
(though I'm not sure it's the exact same problem).
2025-03-18 10:42:00 -05:00
Gregory Anders
946c0c370f Update Adwaita version check for Box unref
As of Adwaita 1.5.0, the GTK Box is not being properly unref'd when the
parent window is closed. Update the conditional to account for this.

Also add a couple of missing unref()s in errdefers.
2025-03-18 10:24:42 -05:00
Jeffrey C. Ollie
ee78a3d345 gtk: remove c.zig (#6792)
It has been done.
2025-03-18 09:59:23 -05:00
Leah Amelia Chen
72017ea4d8 translations(zh_CN): update 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
8c0ccfc5b3 translations: update 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
a773588c99 gtk: remove c.zig
It has been done.
2025-03-18 12:35:41 +01:00
Leah Amelia Chen
73341b052b gtk: port ConfigErrorsWindow to dialogs 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
1ee9c85954 gtk: port inspector & key handling to zig-gobject 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
e3fbbe8fe3 ci(test/translations): ignore untranslated entries 2025-03-18 12:32:55 +01:00
Leah Amelia Chen
d75c5ec038 gtk: convert App to zig-gobject (#6787) 2025-03-18 09:14:19 +01:00
Jeffrey C. Ollie
ee95a5f3e0 gtk: convert App to zig-gobject 2025-03-17 23:39:45 -05:00
Leah Amelia Chen
742bca713d gtk: convert Window (and some related files) to zig-gobject (#6775) 2025-03-17 21:19:17 +01:00
Mitchell Hashimoto
899ab302e1 apprt/gtk: any preedit change should note a composing state (#6779)
Fixes #6772

When typing Korean with the fcitx5-hangful input method, moving between
graphemes does not trigger a preedit end/start cycle and instead just
clears the preexisting preedit and reuses the started state.

Every other input method we've tested up until now doesn't do this. We
need to mark composing set to "false" in "commit" because some input
methods on the contrary fail to ever call END.

What is the point of start/end events if they are just ignored depending
on the whim of the input method? Nothing. That's what. Its all a mess
that GTK should be protecting us from but it doesn't and now its the app
developer's problem. I'm frustrated because I feel like the point of an
app framework is to mask this kind of complexity from the app developer
and I'm playing whack-a-mole with input methods.

Well, here's another whack. Let's see if it works.
2025-03-17 11:59:33 -07:00
Mitchell Hashimoto
590eb60759 apprt/gtk: any preedit change should note a composing state
Fixes #6772

When typing Korean with the fcitx5-hangful input method, moving between
graphemes does not trigger a preedit end/start cycle and instead just
clears the preexisting preedit and reuses the started state.

Every other input method we've tested up until now doesn't do this. We
need to mark composing set to "false" in "commit" because some input
methods on the contrary fail to ever call END.

What is the point of start/end events if they are just ignored depending
on the whim of the input method? Nothing. That's what. Its all a mess
that GTK should be protecting us from but it doesn't and now its the app
developer's problem. I'm frustrated because I feel like the point of an
app framework is to mask this kind of complexity from the app developer
and I'm playing whack-a-mole with input methods.

Well, here's another whack. Let's see if it works.
2025-03-17 11:44:39 -07:00
Jeffrey C. Ollie
daa79c3598 gtk: address review comments
1. Remove usage of C header imports for gtk x11/wayland.
2. Move X11 C header imports to winproto_x11.zig
3. Clean up long line by breaking it up into multiple steps.
2025-03-17 12:35:31 -05:00
Jeffrey C. Ollie
29322535a5 gtk: convert Window (and some related files) to zig-gobject 2025-03-17 12:06:57 -05:00
Jeffrey C. Ollie
e0fe12cc05 Update Debian 12 Dockerfile (#6776)
1. Automatically detect the required Zig version rather than using a
hardcoded value.
2. Run `ghostty +version` after the build as a sanity check.
2025-03-17 11:09:47 -05:00
Jeffrey C. Ollie
1d040dd17d debian workflow: remove unused ZIG_VERSION arg 2025-03-17 10:54:44 -05:00
Jeffrey C. Ollie
7f7191dfec Update Debian 12 Dockerfile
1. Automatically detect the required Zig version rather than
using a hardcoded value.
2. Run `ghostty +version` after the build as a sanity check.
2025-03-17 10:41:17 -05:00
Jeffrey C. Ollie
a2df8e4b86 gtk: update Tab to use zig-gobject (#6729) 2025-03-17 10:39:13 -05:00
Mitchell Hashimoto
c344c320eb Update iTerm2 colorschemes (#6755)
Upstream revision:
e348884a00
2025-03-16 07:18:30 -07:00
mitchellh
291c2f541c deps: Update iTerm2 color schemes 2025-03-16 14:17:59 +00:00
Mitchell Hashimoto
f8590ce44f scroll: translate non-precision to precision (#6750)
Some wheel mice are capable of reporting fractional wheel ticks. These
mice don't necessarily report a corresponding precision scroll start
event, at least in Wayland + GTK. We can treat all discrete (ie
non-precision) events as the number of wheel ticks - for wheel mice,
yoff will be "1.0" per tick, while precision wheel mice may report
fractional values. This unifies handling of scroll events by normalizing
all events to "pixels to scroll".

We now report `mouse-scroll-multiplier` wheel or arrow events per wheel
tick (or per accumulated cell height). This means that applications
which subscribe to mouse button events will receive (by default) three
wheel events per wheel tick. For precision scrolls, they will receive
one wheel tick per line of scroll. In my opinion, this provides the best
user experience while also allowing customization of how much a
wheel tick should scroll

Reference: https://github.com/ghostty-org/ghostty/discussions/6677
2025-03-16 07:15:34 -07:00
Mitchell Hashimoto
d3424a922a update zon2nix (#6728)
Upstream is now mostly pure Zig and the build.zig.zon.* files are
generated directly by zon2nix. The JSON file is no longer used as an
intermediate file but is retained for downstream packager usage.
2025-03-16 07:13:24 -07:00
Jeffrey C. Ollie
5cd8ebdafd update zon2nix
Upstream is now mostly pure Zig and the build.zig.zon.* files are
generated directly by zon2nix. The JSON file is no longer used as an
intermediate file but is retained for downstream packager usage.
2025-03-16 01:09:52 -05:00
Jeffrey C. Ollie
3bc2b02303 build: update libvaxis and zf (#6752)
Fixes #6734
2025-03-15 23:42:49 -05:00
Jeffrey C. Ollie
ec4d110251 build: update libvaxis and zf
Fixes #6734
2025-03-15 22:06:18 -05:00
Tim Culverhouse
2018a8fd3c scroll: translate non-precision to precision
Some wheel mice are capable of reporting fractional wheel ticks. These
mice don't necessarily report a corresponding precision scroll start
event, at least in Wayland + GTK. We can treat all discrete (ie
non-precision) events as the number of wheel ticks - for wheel mice,
yoff will be "1.0" per tick, while precision wheel mice may report
fractional values. This unifies handling of scroll events by normalizing
all events to "pixels to scroll".

We now report `mouse-scroll-multiplier` wheel or arrow events per wheel
tick (or per accumulated cell height). This means that applications
which subscribe to mouse button events will receive (by default) three
wheel events per wheel tick. For precision scrolls, they will receive
one wheel tick per line of scroll. In my opinion, this provides the best
user experience while also allowing customization of how much a
wheel tick should scroll

Reference: https://github.com/ghostty-org/ghostty/discussions/6677
2025-03-15 21:35:39 -05:00
Jeffrey C. Ollie
4b1d1e0ed4 gtk: update Tab to use zig-gobject 2025-03-15 14:19:59 -05:00
Mitchell Hashimoto
644acdacdc termio, flatpak: implement process watcher with xev (#6658)
This allows `termio.Exec` to track processes spawned via
`FlatpakHostCommand`, finally allowing Ghostty to function as a Flatpak.

Alongside this is a few bug fixes:

* Don't add ghostty to PATH when running in flatpak mode since it's
unreachable.
* Correctly handle exit status returned by Flatpak. Previously this was
not processed and contains extra status bits.
* Use correct type for PID returned by Flatpak.
2025-03-15 08:09:54 -07:00
Mitchell Hashimoto
791d332a25 pkg/macos: clean up for Zig 0.14, consolidate C imports into one decl (#6736)
Fixes #6727

The major change in this commit is to consolidate all the C imports in a
single decl in main.zig. This is required for Zig 0.14. Without it, the
problem in #6727 will happen. I was never able to minimize why this
happens in order to open a Zig bug.

Beyond this, I fixed the build.zig and build.zig.zon to work with Zig
0.14 so that we can test building `pkg/macos` in isolation. There are no
downstream impacting changes in the build.zig files.
2025-03-15 07:30:05 -07:00
Leorize
009b53c45e termio, flatpak: implement process watcher with xev
This allows `termio.Exec` to track processes spawned via
`FlatpakHostCommand`, finally allowing Ghostty to function as a
Flatpak.

Alongside this is a few bug fixes:

* Don't add ghostty to PATH when running in flatpak mode since it's
  unreachable.
* Correctly handle exit status returned by Flatpak. Previously this was
  not processed and contains extra status bits.
* Use correct type for PID returned by Flatpak.
2025-03-15 07:29:13 -07:00
Mitchell Hashimoto
5ad8ea6b22 pkg/macos: clean up for Zig 0.14, consolidate C imports into one decl
Fixes #6727

The major change in this commit is to consolidate all the C imports in
a single decl in main.zig. This is required for Zig 0.14. Without it,
the problem in #6727 will happen. I was never able to minimize why this
happens in order to open a Zig bug.

Beyond this, I fixed the build.zig and build.zig.zon to work with Zig
0.14 so that we can test building `pkg/macos` in isolation. There are no
downstream impacting changes in the build.zig files.
2025-03-15 07:02:53 -07:00
Leah Amelia Chen
f8f9f7041a os: fix use of deprecated splitBackwards for Flatpak (#6733) 2025-03-15 08:02:41 +01:00
Leorize
2e6a2a148f os: fix use of deprecated splitBackwards for Flatpak 2025-03-14 23:48:59 -05:00