10940 Commits

Author SHA1 Message Date
Mitchell Hashimoto
5ab7ceb589 config: fix regression where we halted parsing on deprecated field
Fix regression from d44a6cde2c7ed59f0f28fad16e6b760d7529ebee where
we halted parsing on deprecated fields, which was not the intended
behavior.

This commit fixes that and adds a test to verify it.
2025-06-28 19:24:07 -07:00
mitchellh
2f978fbdcf deps: Update iTerm2 color schemes 2025-06-29 00:15:18 +00:00
Mitchell Hashimoto
2637400904 gtk: add "remember choice" toggle for clipboard confirmation dialog (#6783)
Implements #6763 (not backporting to the 1.2 version since I'm way too
lazy)


![image](https://github.com/user-attachments/assets/9c9aca3e-8b42-4d47-8a96-841612add812)
2025-06-28 14:55:31 -07:00
Mitchell Hashimoto
d44a6cde2c config: more general purpose backwards compatibility handlers (#7717)
Fixes #7706

We previously had a very specific backwards compatibility handler for
handling renamed fields. We always knew that wouldn't scale but I wanted
to wait for a real case. Well, #7706 is a real case, so here we are.

This commit makes our backwards compatibility handler more general
purpose, and makes a special-case handler for renamed fields built on
top of this same general purpose system. The new system lets us do a lot
more with regards to backwards compatibility.

To start, this addresses #7706 by allowing us to handle a removed single
enum value of a still-existing field.

In the future, I think this may continue to get _more_ general purpose
by moving the handlers from functions to structs so we can have more
metadata like descriptions and so on that we may use to generate docs or
other help strings.
2025-06-28 14:48:02 -07:00
RME
a219aae7fc Merge branch 'main' into ko_kr 2025-06-28 23:23:11 +02:00
Mitchell Hashimoto
84432a7beb config: more general purpose backwards compatibility handlers
Fixes #7706

We previously had a very specific backwards compatibility handler for
handling renamed fields. We always knew that wouldn't scale but I wanted
to wait for a real case. Well, #7706 is a real case, so here we are.

This commit makes our backwards compatibility handler more general
purpose, and makes a special-case handler for renamed fields built on
top of this same general purpose system. The new system lets us do a lot
more with regards to backwards compatibility.

To start, this addresses #7706 by allowing us to handle a removed single
enum value of a still-existing field.
2025-06-28 13:06:43 -07:00
Jon Parise
5e76606120 fix: enable boo on FreeBSD (#7716) 2025-06-28 14:55:28 -04:00
-k
4fac5f3749 fix: enable boo on FreeBSD 2025-06-28 13:08:56 -04:00
Leah Amelia Chen
f6d1c274b9 gtk(wayland): prevent gtk4-layer-shell crash on old versions (#7712)
Supersedes #7154

In gtk4-layer-shell versions < 1.0.4, the app could crash upon opening a
quick terminal window on certain compositors that implement the
`xdg_wm_dialog_v1` protocol. The exact reason is a bit complicated, but
is nicely summarized in the upstream issue (wmww/gtk4-layer-shell#50).

The circumstances that could cause this crash to occur should gradually
diminish as distros update to newer gtk4-layer-shell versions, but this
is known to crash on Fedora 41 and Hyprland, which could be a sizable
chunk of our userbase given that this would also occur on GNOME/Mutter
and KDE/KWin. The diff should be minimal enough that this can be removed
or reverted once this band-aid fix is no longer necessary.
2025-06-28 17:09:24 +02:00
Leah Amelia Chen
0973abf9f9 translations(zh_CN): add lines from #6783 2025-06-28 17:08:29 +02:00
Leah Amelia Chen
fbe94156f9 translations: update 2025-06-28 17:06:49 +02:00
Leah Amelia Chen
ce015899f3 gtk: add "remember choice" toggle for clipboard confirmation dialog 2025-06-28 17:06:40 +02:00
Leah Amelia Chen
5fa737834b gtk(wayland): prevent gtk4-layer-shell crash on old versions
Supersedes #7154

In gtk4-layer-shell versions < 1.0.4, the app could crash upon opening
a quick terminal window on certain compositors that implement the
`xdg_wm_dialog_v1` protocol. The exact reason is a bit complicated,
but is nicely summarized in the upstream issue (wmww/gtk4-layer-shell#50).

The circumstances that could cause this crash to occur should gradually
diminish as distros update to newer gtk4-layer-shell versions, but this
is known to crash on Fedora 41 and Hyprland, which could be a sizable
chunk of our userbase given that this would also occur on GNOME/Mutter
and KDE/KWin. The diff should be minimal enough that this can be removed
or reverted once this band-aid fix is no longer necessary.
2025-06-28 16:41:19 +02:00
Mitchell Hashimoto
1607f761d2 Equalize splits based on children oriented in the same direction (#7710)
This changes equalization so it only counts children oriented in the
same direction.

This makes splits a bit more aesthetic, and replicates how split
equalization works in neovim.

### This is how splits look before this change:

Notice how the left pane gets squeezed.

Before equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 47 40 AM"
src="https://github.com/user-attachments/assets/498d3026-cfde-4856-b88b-677b2e77b4a0"
/>

After equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 47 49 AM"
src="https://github.com/user-attachments/assets/2cf7bb60-62da-4d42-882c-d8324cc7bdb6"
/>



---

### And here's how the equalization works after this change:

Before equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 18 AM"
src="https://github.com/user-attachments/assets/39974948-573c-48e8-93a2-7504968f1418"
/>

After equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 24 AM"
src="https://github.com/user-attachments/assets/d97adccd-976e-45a5-b98e-6e5596cf89d3"
/>


For many splits it looks much more aesthetic:
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 28 AM"
src="https://github.com/user-attachments/assets/012d84fc-400f-4864-b8d4-cf7ce53067fb"
/>
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 35 AM"
src="https://github.com/user-attachments/assets/204583ad-66e6-4a1d-a3a0-d2805a8daded"
/>
2025-06-28 07:26:49 -07:00
Mitchell Hashimoto
5364c2d723 Don't pass arena allocator to internal_os.open (#7711)
This fixes #7702 by no longer passing the arena allocator to a task that
outlives its caller.

As far as I can tell, a reference to `config_path` may live on in the
`argv` field of the ChildProcess after the arena is cleared (unless
`argv` itself becomes a dangling pointer because the literal it's
referencing goes out of scope? Struggling to wrap my head around some of
the finer points of Zig array/slice/literal semantics). However, I
suppose it's safe to assume that `argv` is never referenced after
`exe.spawn()` has returned, in which case there's no issue. If this were
a problem, it would apply equally to all uses of `internal_os.open`, not
just the open config code path.
2025-06-28 06:57:50 -07:00
Mitchell Hashimoto
3dc4321689 deps: Default gtk4-layer-shell system integration to true (#6706)
Closes #6632 
When compiling the dynamic lib and linking, the rpath resolves to the
compile cache location instead of the install location for the lib. This
resulted in loading the dylib failing when the compile cache was removed
or the install location is changed.

Based on https://github.com/ziglang/zig/issues/5827 , we specify the
rpath to search relative to the executable.
Previous state:
- dynamic lib was not installed to the output directory -> now appears
in `$OUT/lib/libgtk4-layer-shell.so`
- rpath only included the compile cache location, not the install
location.
Before:
```sh
$ patchelf --print-rpath zig-out/bin/ghostty
/home/anthony/dev/ghostty-pure/.zig-cache/o/0254fb4753185c5429180337a720248d
$ ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => /home/anthony/dev/ghostty-pure/.zig-cache/o/0254fb4753185c5429180337a720248d/libgtk4-layer-shell.so (0x00007f7975468000)
        ...
$  ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => not found
        ...
```

After:

```sh
$ zig build
$ patchelf --print-rpath zig-out/bin/ghostty
/home/anthony/dev/ghostty/.zig-cache/o/f45360ddde653cb3bc70966c326dd96d:$ORIGIN/../lib/
$ ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => /home/anthony/dev/ghostty/.zig-cache/o/f45360ddde653cb3bc70966c326dd96d/libgtk4-layer-shell.so (0x00007fbf81ad8000)
        ...
 $ rm -r .zig-cache/
 $ ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => /home/anthony/dev/ghostty/zig-out/bin/../lib/libgtk4-layer-shell.so (0x00007f60dc087000)
        ...
```
2025-06-28 06:56:50 -07:00
azhn
a8cad9831a Remove copying libgtk4-layer-shell.so from cache since install is fixed 2025-06-28 19:21:32 +10:00
azhn
46b86570f2 deps: Enable building gtk4-layer-shell without system integration 2025-06-28 19:02:30 +10:00
azhn
33e07c87c9 deps: Default gtk4-layer-shell system integration to true
We default system-integration to true as this is a shared library that
must be installed on a library path and it is recommended to use the
system package.

If the system does not package gtk4-layer-shell then doing `zig build
-fno-sys` will now correctly build and install the shared library under
a lib/ subdirectory of the output prefix.

The output prefix should be a default library path (`/lib`, `/usr/lib`,
or a lib64 variant) otherwise a custom library path can be configured
using ldconfig (see `man ld.so 8`)
2025-06-28 19:01:26 +10:00
Daniel Wennberg
4ae75cc868 Don't pass arena allocator to os.open 2025-06-28 00:21:38 -07:00
Islam Sharabash
22a624e560 Equalize splits based on children oriented in the same direction
This changes equalization so it only counts children oriented in the
same direction.

This makes splits a bit more aesthetic, and replicates how split
equalization works in neovim.
2025-06-28 09:01:41 +02:00
Mitchell Hashimoto
206d41844e terminal: fix unexpected line wrapping in tests (#7709)
These tests write specific lines into a 10-column-wide test screen. The
"prompt3$ input3\n" writes exceed that column limit, and some of their
characters wrap onto the following line.

These tests' current assertions aren't sensitive to that overflow, but I
spotted the problem while doing some related work, and I thought it
worth making these corrections to avoid any future surprises.
2025-06-27 19:43:12 -07:00
Jon Parise
138f74524e terminal: fix unexpected line wrapping in tests
These tests write specific lines into a 10-column-wide test screen. The
"prompt3$ input3\n" writes exceed that column limit, and some of their
characters wrap onto the following line.

These tests' current assertions aren't sensitive to that overflow, but
I spotted the problem while doing some related work, and I thought it
worth making these corrections to avoid any future surprises.
2025-06-27 22:34:46 -04:00
Mitchell Hashimoto
98b1af8353 Move child exit handling logic to apprt thread (#7705)
Fixes #7500
Supersedes #7582

This commit moves the child exit handling logic from the IO thead to the
apprt thread. The IO thread now only sends a `child_exited` message to
the apprt thread with metadata about the exit conditions (exit code,
runtime).

From there, the apprt thread can handle the exit situation however is
necessary. This commit doesn't change the behavior but it does fix the
issue #7500. The behavior is: exit immediately, show abnormal exit
message, wait for user input, etc.

This also gets us closer to #7649.
2025-06-27 10:51:55 -07:00
Mitchell Hashimoto
591ef0f40f Move child exit handling logic to apprt thread
Fixes #7500
Supersedes #7582

This commit moves the child exit handling logic from the IO thead to the
apprt thread. The IO thread now only sends a `child_exited` message to
the apprt thread with metadata about the exit conditions (exit code,
runtime).

From there, the apprt thread can handle the exit situation however is
necessary. This commit doesn't change the behavior but it does fix the
issue #7500. The behavior is: exit immediately, show abnormal exit
message, wait for user input, etc.

This also gets us closer to #7649.
2025-06-27 10:36:23 -07:00
Mitchell Hashimoto
2775792b20 core: only update selection clipboard on left mouse release (#7704)
Fixes #4800, supercedes #5995

This is a rewrite of #5995 (though the solution is mostly the same since
this is pretty straightforward). The main difference is the rebase on
the new mouse handling we've had since, and I also continue to update
the selection clipboard on non-left-mouse events.
2025-06-27 09:45:52 -07:00
Mitchell Hashimoto
52354b8bec core: only update selection clipboard on left mouse release
Fixes #4800, supercedes #5995

This is a rewrite of #5995 (though the solution is mostly the same since
this is pretty straightforward). The main difference is the rebase on
the new mouse handling we've had since, and I also continue to update
the selection clipboard on non-left-mouse events.
2025-06-27 09:40:37 -07:00
Mitchell Hashimoto
4b5ccf79a5 fix compilation issue, tests should've caught this but GHA failed 2025-06-27 09:16:00 -07:00
Mitchell Hashimoto
240c9b8afc gtk: add option to always display the tab bar (#5590)
Also fixes crashes in both vanilla GTK and Adwaita implementations of
`closeTab`, which erroneously close windows twice when there are no more
tabs left (we probably already handle it somewhere else).
2025-06-27 09:14:13 -07:00
Mitchell Hashimoto
331769bc6b core: don't copy App and apprt.App (#5509)
Besides avoiding copying, this allows consumers to choose to allocate
these structs on the stack or to allocate on the heap. It also gives the
apprt.App a stable pointer sooner in the process.
2025-06-27 09:13:54 -07:00
Mitchell Hashimoto
83690744b2 reintroduce App.create 2025-06-27 09:12:20 -07:00
Jeffrey C. Ollie
1979fb92f4 embedded: fix core app init 2025-06-27 09:05:32 -07:00
Jeffrey C. Ollie
3c49d87751 fix order of defer 2025-06-27 09:05:32 -07:00
Jeffrey C. Ollie
c6f23bbb32 core: con't copy App and apprt.App
Besides avoiding copying, this allows consumers to choose to allocate
these structs on the stack or to allocate on the heap. It also gives the
apprt.App a stable pointer sooner in the process.
2025-06-27 09:05:32 -07:00
Mitchell Hashimoto
070e017b1b Update CODEOWNERS for localization managers (#7701) 2025-06-27 06:59:37 -07:00
Mitchell Hashimoto
937b10b422 Update CODEOWNERS for localization managers 2025-06-27 06:58:15 -07:00
Qwerasd
979d72056b OpenGL: Fix Custom Shaders (#7697)
Ref: GitHub Discussion #7696 

See commit messages for details.
2025-06-26 17:19:19 -06:00
Qwerasd
d6db3013be renderer/OpenGL: switch image texture from Rect to 2D
We were using the Rectangle target for simpler addressing, since that
allows for pixel coordinates instead of normalized coordinates, but
there are downsides to rectangle textures, including not supporting
compressed texture formats, and we do probably want to use compressed
formats in the future, so I'm making this change now.
2025-06-26 16:38:19 -06:00
Qwerasd
810ab6a844 renderer/OpenGL: revert change to compressed texture format
This was applied to the wrong thing by accident, making the custom
shader ping-pong textures compressed, which breaks custom shaders
because compressed texture formats are not color renderable.

Additionally, I've not switched the compressed format to the correct
texture options, because I tried that and it turns out that the default
compression applied by drivers can't be trusted to be good quality and
generally speaking looks terrible. In the future we can explore doing
the compression ourselves CPU-side with something like b7enc_rdo.
2025-06-26 16:34:51 -06:00
Mitchell Hashimoto
6d6dcf863a Correct AppStream metainfo XML, broken trailing tags 2025-06-26 13:37:20 -07:00
Mitchell Hashimoto
c12b280782 dbus and systemd activation - take 2 (#7679)
This replaces #7433. The improvements are:

1) Install the systemd user service in the proper directory depending on
if it's a 'user' install or a 'system' install. This is controlled
either by using the `--system` build flag (as most packages will) or by
the `-Dsystem-package` flag.

2) Add the absolute path to the `ghostty` binary in the application
file, the DBus service, and the systemd user service. This is done so
that they do not depend on `ghostty` being in the `PATH` of whatever is
launching Ghostty. That `PATH` is not necessarily the same as the `PATH`
in a user shell (especially for DBus activation and systemd user
services).

3) Adjust the DBus bus name that is expected by the system depending on
the optimization level that Ghostty is compiled with.
2025-06-26 13:31:29 -07:00
Mitchell Hashimoto
d92d1cac2a remove unused TODO.md 2025-06-26 13:16:55 -07:00
Mitchell Hashimoto
3d01bb43cc terminal/Screen: account for rectangle selection in clone (#7692)
Fixes an issue where rectangle selections would appear visually wrong if
their start or end were out of the viewport area, because when cloning
them the restored pins were defaulting to the start and end of the row
instead of the appropriate column.

This issue is shown in discussion #7687.
2025-06-26 13:15:48 -07:00
Mitchell Hashimoto
b4e81949ee wrong service name for dbus systemd service 2025-06-26 13:12:05 -07:00
Mitchell Hashimoto
77654eb01c use tail to clear the first line of the template 2025-06-26 13:07:41 -07:00
Mitchell Hashimoto
739b691a6d use cmake formatting to template, avoids the custom binary 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
73d5eb928c fix up formatting of desktop_template.zig 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
8a95212197 fix up the name in the metainfo when templating 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
fa4f420768 replace sed with a simple Zig program for templating desktop files 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
eb5a488b57 clean up duplicated code in installation of desktop services 2025-06-26 10:28:46 -07:00