Commit Graph

993 Commits

Author SHA1 Message Date
Mitchell Hashimoto
3790fb78fe libghostty: simplify Wasm allocation API (#13860)
Replace a bunch of type-specific Wasm allocation functions with a
generic byte allocator and reusable opaque out-parameters for pointers.
This makes it a lot more ergonomic (relatively) to use the Wasm
interface and removes a dozen or so exports.

This also updates the `ghostty_type_json` `abi` field with a maximum
alignment value that host sides can use to keep every allocation aligned
properly, easily, without hardcoding numbers.

This adds a test to verify this all works as intended and runs in CI.
2026-08-16 12:44:01 -07:00
Mitchell Hashimoto
a8e9b413f1 libghostty: simplify Wasm allocation API
Replace a bunch of type-specific Wasm allocation functions with a generic
byte allocator and reusable opaque out-parameters for pointers. This
makes it a lot more ergonomic (relatively) to use the Wasm interface
and removes a dozen or so exports.

This also updates the `ghostty_type_json` `abi` field with a maximum
alignment value that host sides can use to keep every allocation aligned
properly, easily, without hardcoding numbers.

This adds a test to verify this all works as intended and runs in CI.
2026-08-16 12:39:51 -07:00
ghostty-vouch[bot]
7b57c0a029 Update VOUCHED list (#13859)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13858#discussioncomment-18043290)
from @jcollie.

Vouch: @tsacha

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-16 19:25:55 +00:00
Mitchell Hashimoto
c75559589e libghostty: add ABI manifest schema
The ABI manifest previously had no machine-readable grammar or test that
the public export conformed to it.

Define a Draft 2020-12 schema and add a build check that executes
ghostty_type_json for native and wasm libraries before validation. Run
both forms in CI and publish the schema with the generated API docs.
2026-08-15 21:16:34 -07:00
ghostty-vouch[bot]
cecf81678e Update VOUCHED list (#13843)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13841#discussioncomment-18031969)
from @jcollie.

Vouch: @preiter93

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-15 16:07:28 +00:00
Mitchell Hashimoto
794515ba60 libghostty: -Dvt-features to compile out unused features (#13834)
This introduces a `-Dvt-features` build option for libghostty-vt that
compiles out optional feature areas, primarily so size-conscious
embedders (e.g. wasm) can significantly trim the binary.

The flag is similar to `-Dcpu`, `+feature` or `feature` to enable it,
`-feature` to disable, magic word `all` to turn all features on or off.
Example: `-Dvt-features=-all,+render-state` builds only the render state
API.

Added CI to verify the lib and tests _compile_ (we don't run it) for
each individual feature.

### Sizes

wasm32, ReleaseFast:

| Build | Bytes | Brotli |
|---|---|---|
| default (all features) | 876,500 | 218,309 |
| web interactive
(`-all,+render-state,+input-encode,+selection,+color,+grid-introspection`)
| 661,119 | 168,994 |
| read-only viewer (`-all,+render-state`) | 537,441 | 132,858 | 
| bare VT core (`-all`) | 515,422 | 125,756 |
| xterm.js browser bundle (incl. renderers) | 488,663 | 99,311 | 
| @xterm/headless | 182,672 | 39,651 |

Note: xterm versions are stable as of this commit.

### C Header Note

I didn't do a `vt/features.h` style header that has macros to guard
symbols for the various features. This is something we should do in the
future. The way it is now, the C header always declares everything, and
its not a problem unless an unavailable function is referenced at link
time.
2026-08-14 22:35:38 -07:00
Mitchell Hashimoto
1fdbb8c912 libghostty: -Dvt-features to compile out unused features
This introduces a `-Dvt-features` build option for libghostty-vt that
compiles out optional feature areas, primarily so size-conscious
embedders (e.g. wasm) can significantly trim the binary.

The flag is similar to `-Dcpu`, `+feature` or `feature` to enable it,
`-feature` to disable, magic word `all` to turn all features on or off.
Example: `-Dvt-features=-all,+render-state` builds only the render
state API.

### Sizes

| Build | Bytes | Brotli |
|---|---|---|
| default (all features) | 876,500 | 218,309 |
| web interactive (`-all,+render-state,+input-encode,+selection,+color,+grid-introspection`) | 661,119 | 168,994 |
| read-only viewer (`-all,+render-state`) | 537,441 | 132,858 |
| bare VT core (`-all`) | 515,422 | 125,756 |
| xterm.js browser bundle (incl. renderers) | 488,663 | 99,311 |
| @xterm/headless | 182,672 | 39,651 |

Note: xterm versions are stable as of this commit.
2026-08-14 22:07:54 -07:00
ghostty-vouch[bot]
348f714ff9 Update VOUCHED list (#13833)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13831#discussioncomment-18025282)
from @jcollie.

Vouch: @DiegoArmstrong

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-15 04:55:55 +00:00
ghostty-vouch[bot]
e84dd30155 Update VOUCHED list (#13829)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13828#discussioncomment-18024891)
from @jcollie.

Vouch: @diego-moment

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-15 03:47:57 +00:00
Mitchell Hashimoto
29a70bc367 ci: publish wasm tip artifacts
This builds and publishes `ghostty-vt.wasm` binaries into our tip
GitHub releases. These are built with the proper optimization, `simd128`
CPU feature set, and run through `wasm-opt`.

This allows wasm consumers to use libghostty without a Zig toolkit.

Published two: `ghostty-vt.wasm` and `ghostty-vt-small.wasm`. The latter
is ReleaseSmall, but is 10 to 20% slower. Users choice.
2026-08-14 10:47:22 -07:00
ghostty-vouch[bot]
f81dcadc82 Update VOUCHED list (#13814)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13812#discussioncomment-18018163)
from @mitchellh.

Vouch: @elitex45

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-14 13:56:41 +00:00
ghostty-vouch[bot]
89a26a39eb Update VOUCHED list (#13808)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12664#discussioncomment-18012616)
from @pluiedev.

Vouch: @Zlitus

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-14 06:12:09 +00:00
ghostty-vouch[bot]
710b872390 Update VOUCHED list (#13805)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13804#discussioncomment-18010199)
from @jcollie.

Vouch: @pssalman

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-14 02:34:51 +00:00
ghostty-vouch[bot]
43fe699071 Update VOUCHED list (#13797)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13796#discussioncomment-18006390)
from @jcollie.

Vouch: @sghng

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-13 18:55:20 +00:00
ghostty-vouch[bot]
bb019cac27 Update VOUCHED list (#13794)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13792#discussioncomment-18005749)
from @jcollie.

Vouch: @dmunozv04

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-13 18:03:40 +00:00
ghostty-vouch[bot]
47703753ad Update VOUCHED list (#13793)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13791#discussioncomment-18005730)
from @jcollie.

Vouch: @dolzenko

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-13 18:03:00 +00:00
ghostty-vouch[bot]
d2c70a8c7b Update VOUCHED list (#13775)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13773#discussioncomment-17996184)
from @jcollie.

Vouch: @steven-tk

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-13 02:34:01 +00:00
trag1c
4a516fa393 github: remove the issue templates 2026-08-12 20:36:26 +02:00
Lukas
b112f3954c build: stop building Ghostty for iOS
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 14:00:03 +02:00
ghostty-vouch[bot]
9f9b8d1d05 Update VOUCHED list (#13756)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13755#discussioncomment-17982722)
from @jcollie.

Vouch: @figelwump

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-12 01:20:06 +00:00
ghostty-vouch[bot]
fad7f854e8 Update VOUCHED list (#13754)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13753#discussioncomment-17980814)
from @mitchellh.

Vouch: @shorsher

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-11 20:53:22 +00:00
trag1c
04d1939d5f issue-triage: add a documentation search checkbox 2026-08-11 19:54:52 +02:00
ghostty-vouch[bot]
426386b857 Update VOUCHED list (#13747)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13746#discussioncomment-17977627)
from @jcollie.

Vouch: @alex19EP

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-11 15:13:48 +00:00
ghostty-vouch[bot]
94d775fefc Update VOUCHED list (#13743)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13742#discussioncomment-17970277)
from @jcollie.

Vouch: @dave92082

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-11 02:51:56 +00:00
ghostty-vouch[bot]
09557e91dc Update VOUCHED list (#13739)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13738#discussioncomment-17968662)
from @jcollie.

Vouch: @PRIHLOP

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-10 22:48:46 +00:00
dependabot[bot]
c285d3c244 build(deps): bump dorny/paths-filter from 4.0.2 to 4.0.3
Bumps [dorny/paths-filter](https://github.com/dorny/paths-filter) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](7b450fff21...ceb8a2b8f2)

---
updated-dependencies:
- dependency-name: dorny/paths-filter
  dependency-version: 4.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-10 00:16:56 +00:00
ghostty-vouch[bot]
6e647a1cbd Update VOUCHED list (#13697)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13693#issuecomment-5227046478)
from @tristan957.

Vouch: @gotenksIN

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-08 16:40:24 +00:00
ghostty-vouch[bot]
47147324ce Update VOUCHED list (#13691)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13690#issuecomment-5224579870)
from @00-kat.

Vouch: @a-lang

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-08 04:50:39 +00:00
ghostty-vouch[bot]
7f96e0bdab Update VOUCHED list (#13683)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13675#issuecomment-5218250080)
from @jcollie.

Vouch: @zenangst

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-07 14:23:01 +00:00
Mitchell Hashimoto
49fd1ae654 build: default dependencies to lib-vt mode
Related to #10651

Default Ghostty dependency builds to libghostty-vt-only mode and
avoid initializing anything that would trigger broader dependency
requirements.

The impact of this is that Zig consumers can import ghostty-vt without
requiring Xcode on macOS.
2026-08-05 22:01:49 -07:00
ghostty-vouch[bot]
2346c4fe47 Update VOUCHED list (#13617)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12984#issuecomment-5187316604)
from @mitchellh.

Denounce: @jamesarch

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-05 03:50:37 +00:00
ghostty-vouch[bot]
08342c9244 Update VOUCHED list (#13603)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13602#discussioncomment-17895866)
from @jcollie.

Vouch: @UnsaltedScholar

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-04 15:33:09 +00:00
ghostty-vouch[bot]
bdd849fc2f Update VOUCHED list (#13596)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13589#issuecomment-5178660481)
from @jparise.

Vouch: @lotheac

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-04 11:57:34 +00:00
ghostty-vouch[bot]
a4f9b9cea2 Update VOUCHED list (#13564)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13563#issuecomment-5160200376)
from @trag1c.

Denounce: @guysoft

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-02 20:29:16 +00:00
ghostty-vouch[bot]
6837d7027f Update VOUCHED list (#13550)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13549#issuecomment-5157211534)
from @trag1c.

Vouch: @12ya

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-02 10:32:48 +00:00
ghostty-vouch[bot]
74ad15c104 Update VOUCHED list (#13542)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13527#issuecomment-5152299257)
from @jcollie.

Vouch: @gadgetman6

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-01 16:23:13 +00:00
Mitchell Hashimoto
66ea61dd9d ci: verify snapshot kaitai
Run the snapshot Kaitai verifier in its own required xsm job. This gives schema, fixture, checksum, and cross-record validation a distinct CI result without coupling it to the libghostty-vt test suite.
2026-07-30 21:10:14 -07:00
ghostty-vouch[bot]
70c498ac32 Update VOUCHED list (#13521)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13520#discussioncomment-17837792)
from @pluiedev.

Vouch: @carlvillads

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-30 08:51:35 +00:00
ghostty-vouch[bot]
96e39f8235 Update VOUCHED list (#13518)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13516#discussioncomment-17834904)
from @jcollie.

Vouch: @fallintoplace

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-30 03:17:51 +00:00
ghostty-vouch[bot]
a34bf0dce7 Update VOUCHED list (#13511)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13508#discussioncomment-17828581)
from @jcollie.

Vouch: @simonbcn

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-29 14:17:15 +00:00
ghostty-vouch[bot]
232d40c062 Update VOUCHED list (#13499)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13498#issuecomment-5109104876)
from @mitchellh.

Vouch: @vegerot

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-28 20:07:22 +00:00
ghostty-vouch[bot]
7bea975bd3 Update VOUCHED list (#13497)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13458#discussioncomment-17817388)
from @jcollie.

Vouch: @RoniJacobson

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-28 19:46:53 +00:00
ghostty-vouch[bot]
95befb3377 Update VOUCHED list (#13495)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13491#discussioncomment-17814823)
from @tristan957.

Vouch: @ruseel

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-28 15:12:57 +00:00
ghostty-vouch[bot]
28f02ac3ce Update VOUCHED list (#13487)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/13485#issuecomment-5094118020)
from @jcollie.

Vouch: @svmhdvn

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-27 16:44:59 +00:00
Riccardo Mazzarini
1fe1b2d23c build: fix static libghostty-vt linking on Windows
This PR fixes static linking for libghostty-vt on Windows by propagating
a couple of missing dependencies (discovered while running Neovim's Zig
build, see
https://github.com/neovim/neovim/actions/runs/30130848061/job/89604799965?pr=39773).
2026-07-26 15:36:54 -07:00
ghostty-vouch[bot]
2de5e7d38e Update VOUCHED list (#13463)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13462#discussioncomment-17783961)
from @pluiedev.

Vouch: @aurelleb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-26 04:05:01 +00:00
ghostty-vouch[bot]
4c725242b7 Update VOUCHED list (#13437)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13436#discussioncomment-17759608)
from @jcollie.

Vouch: @SanJJ1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-24 04:43:32 +00:00
Mitchell Hashimoto
d65cb5128a build: link libghostty-vt on Apple hosts with native linker
Replaces: https://github.com/ghostty-org/ghostty/pull/13427

Zig's Mach-O linker does not emit LC_ENCRYPTION_INFO_64 for physical
iOS dylibs. This allows libghostty-vt to build successfully but causes
frameworks containing it to fail App Store validation.

I think it'd be cleaner to always just build Apple targets on Apple hosts
with the native linker. We don't need to rely on Zig being correct and 
this helps ensure compatibility for details like this.
2026-07-23 06:41:30 -07:00
Mitchell Hashimoto
d97a574242 ci: test with Xcode 27 2026-07-22 13:04:59 -07:00
Mitchell Hashimoto
7aa9591746 Update to Zig 0.16.0 (#12726)
Closes #12228
Supersedes #12388

**UPDATED** - Also check comments for additional details!

This commit represents the majority of the work necessary to upgrade
Ghostty to use Zig 0.16.0.

At this point, all tests pass under Linux, but more work may be
necessary to get them to build and function on other platforms.

There are some parts of this update that deserve commentary, so that
follows below:

## Expanded use of global state (IO/environment related)

Global state, once generally only used by the C library, has now been
expanded to be used across the project at large. The static local
variable that holds the state has been moved private in its source
container with all attributes that need to be accessed globally gated
behind accessors, most of which guard on testing and send test copies
instead. Use of the global state in non-testing scenarios asserts that
the state has been initialized through `init` naturally through the
optional assertion process.

The rationale for this change is to have a location to store a
general-purpose I/O implementation and environment variables, both of
which are now provided through [Juicy
Main](https://ziglang.org/download/0.16.0/release-notes.html#Juicy-Main)
and hence can no longer be accessed or mutated through stdlib without
use of lower-level system calls and hacks (some of which are employed,
but sparingly).

As the code matures, dependence on global state should naturally slim
down.

We do not allow global state to be used in libghostty-vt. There are
comptime guards that prevent this should compilation of libghostty-vt
end up pulling `global.zig`. This means that as per the last paragraph,
work has already begun to de-couple the codebase from global state where
necessary. Additionally, in some places where environment needs to be
updated and where it can be done in an isolated fashion, environment
maps are used - system-level injection of environment through the use of
`setenv` or `unsetenv` now only happens during early initialization (and
hopefully we can remove these in the future too, especially since they
require re-synchronization of the higher-level environment primitives
after this is done).

## The `lib/compat` Tree

Some stdlib features that have been removed but still either seem they
would be valuable to us or outright complex to move away from
(particularly `SegmentedList`) have been extracted from 0.15.2, updated
as needed, and placed in `src/lib/compat`. The intention again is to
allow for piecemeal migration to more modern implementations or possibly
straight local versions.

This paradigm has also allowed us to add `std.Io.Condition.waitTimeout`,
which incidentally was missed in the 0.16.0 shuffle and has been
re-added for 0.17.0. We can remove this in favor of the upstream when we
eventually migrate to that, obviously.

Note that there was a lot more of this extracted code when this work was
started, but a lot of said code has been removed (namely environment or
process/fd-related functionality).

## translate-c Issues (functional on Linux, Darwin WIP)

There have been a number of C translation issues that we have been
working through through submitted patches and the great help from folks
on the Arocc and Zig side. This is ongoing, with the remaining work to
getting things fixed mainly focused on the MacOS side. Stay tuned for
further developments.

As mentioned at the top, follow comments for more details!
2026-07-22 08:26:45 -07:00