10968 Commits

Author SHA1 Message Date
Mitchell Hashimoto
81cef6e63b various cleanups around scroll timers 2025-06-30 09:40:49 -07:00
moni-dz
f73c90bf5d surface: add timer-based scrolling during selection 2025-06-30 09:17:20 -07:00
moni-dz
c00b8740aa termio: add selection scrolling callback 2025-06-30 09:15:53 -07:00
Mitchell Hashimoto
ffcd633c01 Introduce font-shaping-break config option (#5374)
Adds the config option as described in #4515.

Plumbed it into the `RunIterator` and updated all the tests that rely on
that, adding additional cases to the cursor boundary tests where I found
them.

Closes #4515
2025-06-30 09:12:14 -07:00
Mitchell Hashimoto
73ff4b8f74 move runIterator options to dedicated struct 2025-06-30 09:05:09 -07:00
Daniel Patterson
beb961fb80 Introduce font-shaping-break config option 2025-06-30 08:06:00 -07:00
Damyan Bogoev
2850c3b58a Adding Bulgarian localization. 2025-06-30 16:51:11 +03:00
RME
9aa2383e05 Merge branch 'main' into ko_kr 2025-06-30 15:05:01 +02:00
RME
6484df9134 update debug build string, line 251 2025-06-30 15:01:44 +02:00
RME
e25029eff6 add ko_KR i18n to CODEOWNERS 2025-06-30 15:00:15 +02:00
Mitchell Hashimoto
2592286988 termio: indicate support for OSC 52 in primary DA report (#7725)
This is an extension agreed upon by modern terminals to indicate that
they support copying to the clipboard with XTerm's OSC 52 sequence. It
is only reported when writing to the clipboard is actually allowed.

Ref: #7590
2025-06-29 19:18:53 -07:00
Mitchell Hashimoto
747076abbf terminal: introduce testWriteSemanticString (#7733)
This test-only function wraps testWriteString with semantic prompt
marking. This replaces the manual, row-based semantic_prompt field
manipulation we were doing in all of our prompt-related test setups.

This function's heuristics are a little complex because it wraps
testWriteString as a "black box"; we don't benefit from that function's
own line-based logic to know which rows need to be updated with the
semantic prompt flag. We need to infer them externally instead.

I considered adding an options argument to testWriteString that would
allow passing e.g. a semantic_prompt prompt. Given that it's called from
200+ places, that would involve a lot of unrelated changes, but it
remains an "option" (ha!) if there's value there for other cases.

I also have plans that move us from row-based to cell-based semantic
tracking, where the current semantic type is tracked by the cursor. In
that implementation, testWriteString can update the written cells
directly, and testWriteSemanticString just helps manage the cursor's
state. Introducing testWriteSemanticString here and now therefore helps
bridge us to that world while maintaining test consistency.
2025-06-29 19:16:53 -07:00
Mitchell Hashimoto
20c6a6fcf2 update libxev to workaround the io_uring regression in Linux 6.15.4 (#7731)
Fixes #7724

Background at the end of the commit message. The fix in libxev is
described in the PR and commit we pin to here, but basically we swap
read for poll for eventfd/timerfd. libxev commit:
75a10d0fb3

From Jens Axboe on X:

> This will fix it: https://pastebin.com/n7JSZWpW which makes me
suspicious
> that it's an S_IFREG check somewhere else, as anon inodes are now
listed as
> regular files. Has potentially pretty broad implications...

> I think I can already answer why that breaks things - io_uring checks
if
> this is a regular file, and if it is, it doesn't do short reads. Short
> reads on regular files (or a bdev) will cause application issues, as
> basically nobody expects them.

> Now we have what acts like a char dev, but where io_uring will retry
IO
> because the application asked for more data than what was delivered.
This
> will cause the weird slowdowns as data isn't delivered as soon as it's
> available.

## Backporting to 1.1.3

It's a bit risky, but we can back port the libxev update to 1.1.3 (and
release a 1.1.4) since we don't plan on a 1.2 release for a couple
months. Realistically, we've been running the latest libxev on tip
(before this commit) for awhile and there haven't been issues so I think
it's safe enough.

I think we should let this merge settle for a few days at least before
we do that back port though.
2025-06-29 19:03:58 -07:00
Kat
098038cf70 i18n: Add Irish (ga_IE) translation (#7650)
This PR introduces support for Irish (Gaeilge), the first official
language of Ireland and an EU working language.

The translation file was initialized using the standard gettext tooling:

` msginit -i po/com.mitchellh.ghostty.pot -l $LANG -o "po/$LANG.po"`

The locale code `ga_IE` follows ISO standards for Gaeilge as spoken in
Ireland.

I'm happy to volunteer as the ongoing maintainer of the Irish
translation and will keep it up to date as Ghostty evolves.

Go raibh maith agat!
2025-06-30 01:56:54 +00:00
Jon Parise
a82223259a terminal: introduce testWriteSemanticString
This test-only function wraps testWriteString with semantic prompt
marking. This replaces the manual, row-based semantic_prompt field
manipulation we were doing in all of our prompt-related test setups.

This function's heuristics are a little complex because it wraps
testWriteString as a "black box"; we don't benefit from that function's
own line-based logic to know which rows need to be updated with the
semantic prompt flag. We need to infer them externally instead.

I considered adding an options argument to testWriteString that would
allow passing e.g. a semantic_prompt prompt. Given that it's called from
200+ places, that would involve a lot of unrelated changes, but it
remains an "option" (ha!) if there's value there for other cases.

I also have plans that move us from row-based to cell-based semantic
tracking, where the current semantic type is tracked by the cursor. In
that implementation, testWriteString can update the written cells
directly, and testWriteSemanticString just helps manage the cursor's
state. Introducing testWriteSemanticString here and now therefore helps
bridge us to that world while maintaining test consistency.
2025-06-29 19:51:35 -04:00
Mitchell Hashimoto
d0e12cc082 update libxev to workaround the io_uring regression in Linux 6.15.4
Fixes #7724

Background at the end of the commit message. The fix in libxev is
described in the PR and commit we pin to here, but basically we swap
read for poll for eventfd/timerfd.

From Jens Axboe on X:

> This will fix it: https://pastebin.com/n7JSZWpW which makes me suspicious
> that it's an S_IFREG check somewhere else, as anon inodes are now listed as
> regular files. Has potentially pretty broad implications...

> I think I can already answer why that breaks things - io_uring checks if
> this is a regular file, and if it is, it doesn't do short reads. Short
> reads on regular files (or a bdev) will cause application issues, as
> basically nobody expects them.

> Now we have what acts like a char dev, but where io_uring will retry IO
> because the application asked for more data than what was delivered. This
> will cause the weird slowdowns as data isn't delivered as soon as it's
> available.
2025-06-29 15:11:24 -07:00
Aindriú Mac Giolla Eoin
5da461dc35 Corrected 2 strings for better readability and consistency 2025-06-29 21:20:20 +01:00
trag1c
7106a3d716 Add Argentinian Spanish translation and locale support (#7397) 2025-06-29 21:23:31 +02:00
Alan Moyano
046f21f2dc Adding email address 2025-06-29 16:02:23 -03:00
Alan Moyano
ff599b5cf7 Improving Argentinian voseo 2025-06-29 16:02:23 -03:00
Alan Moyano
14ba7effcd Fixing issues and making the translation more similar to the es_BO version 2025-06-29 16:02:23 -03:00
Alan Moyano
43a3338491 Merge branch 'ghostty-org:main' into main 2025-06-29 15:59:29 -03:00
James Holderness
7f0778bcf2 termio: indicate support for OSC 52 in primary DA report
This is an extension agreed upon by modern terminals to indicate that
they support copying to the clipboard with XTerm's OSC 52 sequence. It
is only reported when writing to the clipboard is actually allowed.
2025-06-29 15:32:17 +01:00
Mitchell Hashimoto
0d55a1deef Introduce action for copying into clipboard (#7721)
This introduces an action for copying the path of a written
screen/selection file into the clipboard.

Pasting the path into the terminal doesn't work well if you have a
program still running and opening the file outside the terminal (on
macOS in TextEdit by default) isn't always a great experience.

Allowing to copy the file path into the clipboard seems like a minor and
hopefully uncontroversial addition. 😅
2025-06-29 06:56:21 -07:00
RME
ad5ab92333 Update po/ko_KR.UTF-8.po
Co-authored-by: Hojin You <dev.hojin@gmail.com>
2025-06-29 15:42:18 +02:00
Troels Thomsen
ef06e3d02c Introduce action for copying into clipboard 2025-06-29 09:32:48 +02:00
Mitchell Hashimoto
cc2c45ff4e Update iTerm2 colorschemes (#7718)
Upstream revision:
6fa671fdc1
2025-06-28 19:27:54 -07:00
Mitchell Hashimoto
67fe3d418a config: fix regression where we halted parsing on deprecated field (#7719)
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:27:43 -07:00
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