Commit Graph

15708 Commits

Author SHA1 Message Date
ghostty-vouch[bot]
e3bbd54dd3 Update VOUCHED list (#12094)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12093#discussioncomment-16444399)
from @jcollie.

Vouch: @jordandm

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-04 01:46:07 +00:00
Mitchell Hashimoto
0790937d03 macOS: fix Find Next/Previous button in the menu bar is not working as expected (#12070)
I don’t know why the search-related commands were added as performable
keybinds in 240d5e0fc5, but **I asked
Claude to add some tests for that**

> This won't fix cmd+g/G not working when the search bar is focused.
2026-04-02 12:56:39 -07:00
Lukas
18f2702225 macOS: fix Find Next/Previous button in the menu bar is not working as expected 2026-04-02 20:31:31 +02:00
ghostty-vouch[bot]
7747c96033 Update VOUCHED list (#12069)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12068#issuecomment-4179350272)
from @jcollie.

Vouch: @Douglas-MacGregor

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-02 17:28:57 +00:00
ghostty-vouch[bot]
63372f8ddb Update VOUCHED list (#12066)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12038#discussioncomment-16423690)
from @mitchellh.

Vouch: @h3nock

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-02 13:53:39 +00:00
ghostty-vouch[bot]
48d3e972d8 Update VOUCHED list (#12052)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12050#issuecomment-4173393542)
from @mitchellh.

Vouch: @justonia

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-01 22:42:46 +00:00
Mitchell Hashimoto
b8251de7e8 fix: Ensure snap paths come first in gio module loading (#12045)
This fixes the issue reported in
https://github.com/ghostty-org/ghostty/discussions/11311
2026-04-01 14:32:27 -07:00
Mitchell Hashimoto
92a4601f39 Revert "macOS: close search bar if needed when it loses focus (#11980)" (#12046)
This reverts commit 20cfaae2e5, reversing
changes made to 3509ccf78e.

This breaks some behaviours when there are multiple splits, which
requires another click to focus to another split in the same window🫪
2026-04-01 14:32:09 -07:00
Ken VanDine
c16cf0ef07 fix: Ensure snap paths come first in gio module loading 2026-04-01 13:30:40 -04:00
Lukas
9ec5672505 Revert "macOS: close search bar if needed when it loses focus (#11980)"
This reverts commit 20cfaae2e5, reversing
changes made to 3509ccf78e.
2026-04-01 19:21:42 +02:00
Mitchell Hashimoto
f6e6bb0238 macOS: fix upper cased letter is not correctly mapped to menu shortcut (#12039)
This is known issues before key-related PRs, tested on
fa9265636b.

The following config is mapped incorrectly to the menu shortcut:
```
keybind=A=goto_split:left
```
<img width="223" height="106" alt="image"
src="https://github.com/user-attachments/assets/b80da251-9cff-4b29-b143-64854a5c4271"
/>

Surfaces only accept `a` as a trigger to select left split, not
`shift+a`
2026-04-01 08:10:47 -07:00
Leah Amelia Chen
6d15b53fc7 gtk(chore): fix typos (#12036) 2026-04-01 22:12:23 +08:00
Lukas
702a2b43c3 macOS: fix upper cased letter is not correctly mapped to menu shortcut 2026-04-01 14:50:53 +02:00
Lukas
c8702ece8f gtk(chore): fix typos
### AI Disclosure

Claude wrote the regex to ignore base64-encoded sequences
2026-04-01 13:08:55 +02:00
ghostty-vouch[bot]
b7e56044db Update VOUCHED list (#12031)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12030#issuecomment-4167464133)
from @mitchellh.

Vouch: @Jarred-Sumner

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-01 04:59:00 +00:00
Jeffrey C. Ollie
c2dd7579e2 core/gtk: ensure that first surface gets marked as focused surface by app (#12029) 2026-03-31 15:29:18 -05:00
Jeffrey C. Ollie
0f6836c69f gtk: use surface id for notifications instead of pointer (#12028) 2026-03-31 15:07:47 -05:00
Jeffrey C. Ollie
4b5f2d60e7 core/gtk: ensure that first surface gets marked as focused surface by app 2026-03-31 14:57:41 -05:00
Jeffrey C. Ollie
dee8598dc0 gtk: use surface id for notifications instead of pointer 2026-03-31 14:53:19 -05:00
Jeffrey C. Ollie
f90180f91f core: add 64 bit unique ID to every core surface (#12027)
- Expose that ID as the environment variable GHOSTTY_SURFACE_ID to
processes running in Ghostty surfaces.
- Add a function to the core app to search for surfaces by ID.
- ID is randomly generated, it has no other meaning other than as a
unique identifier for the surface. The ID also cannot be zero as that is
used to indicate a null ID in some situations.
2026-03-31 14:50:00 -05:00
Jeffrey C. Ollie
ff02ed1b34 core: add 64 bit unique ID to every core surface
- Expose that ID as the environment variable GHOSTTY_SURFACE_ID to
  processes running in Ghostty surfaces.
- Add a function to the core app to search for surfaces by ID.
- ID is randomly generated, it has no other meaning other than as a
  unique identifier for the surface. The ID also cannot be zero as that
  is used to indicate a null ID in some situations.
2026-03-31 13:13:05 -05:00
Mitchell Hashimoto
f16d35489b apprt/embedded: fix ghostty_surface_free_text parameter mismatch (#12025)
Fixes #12020

The C header declared ghostty_surface_free_text with both a
ghostty_surface_t and ghostty_text_s* parameter, but the Zig
implementation only accepted a *Text parameter. This caused the surface
pointer to be interpreted as the text pointer, so the actual text
allocation was never freed.

I opted to keep the surface parameter to minimize the diff here. I'm not
sure why I thought I would need access to that surface pointer but just
want to fix the leak first.
2026-03-31 09:52:25 -07:00
Mitchell Hashimoto
4803d58bb4 apprt/embedded: fix ghostty_surface_free_text parameter mismatch
Fixes #12020

The C header declared ghostty_surface_free_text with both a
ghostty_surface_t and ghostty_text_s* parameter, but the Zig
implementation only accepted a *Text parameter. This caused the
surface pointer to be interpreted as the text pointer, so the
actual text allocation was never freed.
2026-03-31 09:46:35 -07:00
ghostty-vouch[bot]
b2880636af Update VOUCHED list (#12022)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12019#discussioncomment-16396278)
from @jcollie.

Vouch: @danneu

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-31 14:56:43 +00:00
Mitchell Hashimoto
292bf13d06 macOS: Make version in about dialog clickable (#12007)
- Fixes: https://github.com/ghostty-org/ghostty/issues/11964

Made a private enum type `VersionConfig` to reference whether the
release is a semver or tip, makes it easier for later in the view to
`switch` between cases.

I do think there could be a better place for this enum or we can get rid
of it, open to opinions. Right now version parsing is kind of duplicated
between `AboutView` and `UpdateModalView` so we can also extract to a
common helper if wanted.

Tested by manually setting `Marketing Version` in build settings to 

`1.3.1`
<img width="412" height="532" alt="Screenshot 2026-03-30 at 18 31 15"
src="https://github.com/user-attachments/assets/285bb94d-138b-4169-bb66-684eb04b6ca3"
/>

`332b2aefc`
<img width="412" height="532" alt="Screenshot 2026-03-30 at 18 32 48"
src="https://github.com/user-attachments/assets/fea30d39-bea7-4885-8221-1696e148f45e"
/>

### AI Disclosure
I used Sonnet 4.6 to understand where the version strings came from and
in what format, it read release yml files to see what's going on. Then
it proposed really bad code so I manually went in and cleaned up the
view.
2026-03-31 06:38:59 -07:00
Mitchell Hashimoto
5fe876cfa0 ghostty.h: guard sys/types.h include for MSVC (#12010)
## Summary

- Move `sys/types.h` include into the `#else` branch of the existing
`_MSC_VER` guard
- MSVC does not ship `sys/types.h` (POSIX header), and already gets
`ssize_t` from `BaseTsd.h`

## Test plan

- [x] `zig build -Dapp-runtime=none` -- clean build
- [x] `zig build test -Dapp-runtime=none` on Windows (2606/2660 passed,
54 skipped)
- [x] `zig build test` on Linux (2658/2684 passed, 26 skipped)
- [x] `zig build test` on macOS (2658/2668 passed, 10 skipped)
- [x] `zig build test-lib-vt` on all 3 platforms
- [x] Zig examples build on all 3 platforms
- [x] CMake examples build on Windows (c-vt-cmake pass,
c-vt-cmake-static pass)
2026-03-31 06:38:36 -07:00
Mitchell Hashimoto
f140b1463f macOS: fix incorrect delete symbol mapping (#12011)
`GHOSTTY_KEY_DELETE` should be mapped to `KeyEquivalent.deleteForward`.
This fixes the correct symbol showing in the menu. Previously, both
`GHOSTTY_KEY_DELETE` and `GHOSTTY_KEY_BACKSPACE` were showing `⌫`, but
`GHOSTTY_KEY_DELETE` only worked for `fn+delete`.

Add the following keybind and observe the symbol in the menu:
```
keybind=delete=new_tab
```

<img width="535" height="318" alt="image"
src="https://github.com/user-attachments/assets/67ed7b5d-f848-42ee-a382-fe364d86cb2c"
/>
2026-03-31 06:38:25 -07:00
Mitchell Hashimoto
f827530103 libghostty: add all C struct layout metadata for WASM (#12017)
Added all C structs and sorted the entries for readability.
2026-03-31 06:01:49 -07:00
Elias Andualem
1d0a247c20 sort map alphabetically 2026-03-31 19:34:52 +08:00
Elias Andualem
30c9dec76b add all C struct layout metadata for WASM 2026-03-31 19:28:46 +08:00
Lukas
591dbd5112 macOS: fix incorrect delete symbol mapping 2026-03-31 10:27:12 +02:00
Louis Qian
010880a90a chore: make url computed property & rework enum signature 2026-03-30 20:15:01 -07:00
Mitchell Hashimoto
20cfaae2e5 macOS: close search bar if needed when it loses focus (#11980)
This adds features like:

1. Clicking outside of search bar works like typing `escape`
2. Typing `tab` while search bar is focused also works like typing
`escape`


https://github.com/user-attachments/assets/a51f1560-ed14-4002-81b4-96eb927b17ca
2026-03-30 19:39:26 -07:00
Louis Qian
183e2cef2f chore: clean up switch statement 2026-03-30 18:51:45 -07:00
Louis Qian
90d71dd2f6 chore: clean up comments 2026-03-30 18:49:17 -07:00
Louis Qian
b29f261dc8 chore: clean up versionConfig to be init-able 2026-03-30 18:44:49 -07:00
Louis Qian
ed6f0588a3 feat: make version clickable depending on type 2026-03-30 18:41:26 -07:00
Alessandro De Blasis
e993ded7c8 ghostty.h: guard sys/types.h include for MSVC
sys/types.h is a POSIX header that does not exist on MSVC. Move it
into the #else branch of the existing _MSC_VER guard that already
provides ssize_t via BaseTsd.h.
2026-03-31 02:40:33 +02:00
ghostty-vouch[bot]
3509ccf78e Update VOUCHED list (#12005)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11981#issuecomment-4158783258)
from @tristan957.

Vouch: @yabbal

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-30 23:27:44 +00:00
Mitchell Hashimoto
50f3b1d60d libghostty: export function table and make it growable for wasm (#12003)
Replaces #11958

This exports the function table and makes it growable so that the
effects API can be used. It's still very not ergonomic to use the
effects API so I'm going to work on that next, but this at least makes
it _possible_. Zig 0.15.x is missing the ability to pass
`--growable-table` to the linker so we use binary patching to add it
(yay!) lol.
2026-03-30 15:29:29 -07:00
Mitchell Hashimoto
f89195ace9 revert example/wasm-vt 2026-03-30 15:21:27 -07:00
ghostty-vouch[bot]
8fc0c85e0c Update VOUCHED list (#12002)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12001#discussioncomment-16386924)
from @jcollie.

Vouch: @louisunlimited

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-30 22:14:54 +00:00
Jeffrey C. Ollie
c75081b89c build: normalize input archives before Darwin libtool merge (#11999)
## Root cause

Zig 0.15.2 can produce macOS `.a` archives where some 64-bit Mach-O
members are only 4-byte aligned inside the archive. Recent Apple
`libtool -static` does not handle that layout correctly: it emits `not
8-byte aligned` warnings and, in the failing case, silently drops those
members when creating the combined static library.

In Ghostty, this happened in the Darwin `libtool` merge step that builds
`libghostty-fat.a`. The x86_64 input `libghostty.a` still contained the
expected `libghostty_zcu.o` and about 97 exported `_ghostty_` symbols,
but after `libtool -static` the output archive contained only 4 SIMD
symbols because `libghostty_zcu.o` had been discarded. The same warning
pattern also appeared in third-party input archives such as
`libfreetype.a` and `libz.a`, so this was not only a `libghostty.a`
problem.

## What needed to be done

The inputs to Apple `libtool` needed to be normalized before they were
merged.

The safest fix is to copy each input archive and run `ranlib -D` on the
copy before passing it to `libtool`. `ranlib` rewrites the archive into
a form that Apple’s linker tools accept, fixing the alignment/layout
issue without changing the archive’s semantic contents.

## Why this approach

An `ar x` -> `ar rcs` workaround can also make the warnings go away, but
it is a broader and riskier transformation. Extracting archive members
into a flat directory is not semantics-preserving:

- duplicate member basenames can collide
- non-`.o` members can be lost
- member order can change

That means an `ar`-based rearchive can silently change valid archives
while fixing alignment. `ranlib -D` avoids those hazards because it
rewrites the archive in place instead of flattening it through the
filesystem.

`-D` is also important because plain `ranlib` is not deterministic. In
local testing, `ranlib -D` still fixed the alignment issue, preserved
all 97 `_ghostty_` symbols, produced no `libtool` warnings, and was
byte-stable across repeated runs.

## Validation

This was reproduced directly:

- before normalization, running `libtool -static` on the affected x86_64
`libghostty.a` produced a `libghostty_zcu.o not 8-byte aligned` warning
and the output archive dropped from 97 `_ghostty_` symbols to 4
- after `ranlib -D`, the same `libtool -static` command preserved all 97
`_ghostty_` symbols and emitted no alignment warnings

After applying the normalization step, a clean `zig build` succeeded,
and the final macOS xcframework archive contained 97 `_ghostty_` symbols
in both the `x86_64` and `arm64` slices.

## Summary

This was not a Metal issue, not an Xcode project issue, and not a
stale-cache issue. The actual root cause was an Apple `libtool`
interoperability problem with Zig-produced macOS archives. The required
fix was to normalize each archive before the Darwin `libtool` merge
step, and `ranlib -D` is the least invasive way to do that while
preserving archive semantics.
2026-03-30 16:22:20 -05:00
Barut
a83a82b3f8 build: normalize input archives before Darwin libtool merge
Apple's recent libtool can warn about misaligned 64-bit archive members
and silently drop them when merging static libraries. In Ghostty this
showed up in the Darwin libtool step that builds libghostty-fat.a.

Normalize each input archive by copying it and running ranlib on the
copy
before handing it to libtool. That rewrites the archive into a layout
Apple's linker tools accept without flattening members through the
filesystem or changing Ghostty's archive format.
2026-03-30 16:59:07 -04:00
ghostty-vouch[bot]
500ab13c86 Update VOUCHED list (#12000)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11999#issuecomment-4158097469)
from @jcollie.

Vouch: @BarutSRB

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-30 20:50:51 +00:00
Mitchell Hashimoto
01a8ea7212 build: binary patching with Zig 2026-03-30 12:06:41 -07:00
Mitchell Hashimoto
6c085e5442 build: binary patch to add growable tables 2026-03-30 11:41:24 -07:00
Mitchell Hashimoto
624b4884c3 Add build_table 2026-03-30 11:34:09 -07:00
Mitchell Hashimoto
ee19c8ff7f wasm: binary patching wow 2026-03-30 11:28:13 -07:00
Mitchell Hashimoto
7269fa7d14 lib: rename GHOSTTY_EXPORT to GHOSTTY_API (#11994)
Rename the shared library visibility macro from GHOSTTY_EXPORT to
GHOSTTY_API across all public C headers. This applies to both the
libghostty-vt headers under include/ghostty/vt/ and the main
include/ghostty.h header.

This is a bit more idiomatic compared to other C libs and addresses the
fact that we're not always exporting...
2026-03-30 10:51:52 -07:00