From 41dd733ca7123c9ac4bfc6c781697a660e95b052 Mon Sep 17 00:00:00 2001
From: Can Celik
Date: Sat, 4 Apr 2026 19:22:04 +0300
Subject: feat: finish ghostty pane backend integration
---
Cargo.toml | 5 +
build.rs | 43 +
justfile | 10 +-
scripts/build_vendored_libghostty_vt.sh | 17 +
scripts/test_vendor_libghostty_vt.py | 50 +
scripts/vendor_libghostty_vt.py | 107 +
src/app/actions.rs | 3 +-
src/app/input.rs | 118 +-
src/app/mod.rs | 21 +-
src/ghostty/bindings.rs | 2472 ++
src/ghostty/mod.rs | 1106 +
src/input/encode.rs | 52 +-
src/input/mod.rs | 4 +-
src/input/parse.rs | 24 +
src/input/tests.rs | 52 +-
src/main.rs | 2 +
src/pane.rs | 1171 +-
src/pty_callbacks.rs | 1 +
src/selection.rs | 8 +
src/ui.rs | 8 +-
tests/api_ping.rs | 8 +
vendor/libghostty-vt.vendor.json | 6 +
.../libghostty-vt/.agents/commands/review-branch | 75 +
.../skills/writing-commit-messages/SKILL.md | 62 +
vendor/libghostty-vt/.clang-format | 182 +
vendor/libghostty-vt/.editorconfig | 14 +
vendor/libghostty-vt/.envrc | 8 +
vendor/libghostty-vt/.gitattributes | 58 +
.../.github/DISCUSSION_TEMPLATE/issue-triage.yml | 162 +
.../.github/DISCUSSION_TEMPLATE/vouch-request.yml | 42 +
.../.github/ISSUE_TEMPLATE/config.yml | 5 +
.../.github/ISSUE_TEMPLATE/preapproved.md | 9 +
vendor/libghostty-vt/.github/VOUCHED.td | 211 +
vendor/libghostty-vt/.github/dependabot.yml | 8 +
vendor/libghostty-vt/.github/pinact.yml | 4 +
.../.github/scripts/check-translations.sh | 16 +
vendor/libghostty-vt/.github/scripts/ghostty-tip | 19 +
.../.github/workflows/clean-artifacts.yml | 17 +
vendor/libghostty-vt/.github/workflows/flatpak.yml | 50 +
.../libghostty-vt/.github/workflows/milestone.yml | 33 +
vendor/libghostty-vt/.github/workflows/nix.yml | 59 +
.../.github/workflows/publish-tag.yml | 74 +
.../.github/workflows/release-tag.yml | 410 +
.../.github/workflows/release-tip.yml | 911 +
vendor/libghostty-vt/.github/workflows/snap.yml | 59 +
vendor/libghostty-vt/.github/workflows/test.yml | 1760 +
.../.github/workflows/update-colorschemes.yml | 96 +
.../.github/workflows/vouch-check-issue.yml | 22 +
.../.github/workflows/vouch-check-pr.yml | 22 +
.../workflows/vouch-manage-by-discussion.yml | 35 +
.../.github/workflows/vouch-manage-by-issue.yml | 36 +
.../.github/workflows/vouch-sync-codeowners.yml | 32 +
vendor/libghostty-vt/.gitignore | 31 +
vendor/libghostty-vt/.gitmodules | 0
vendor/libghostty-vt/.mailmap | 8 +
vendor/libghostty-vt/.prettierignore | 28 +
vendor/libghostty-vt/.shellcheckrc | 8 +
vendor/libghostty-vt/.swiftlint.yml | 2 +
vendor/libghostty-vt/AGENTS.md | 35 +
vendor/libghostty-vt/AI_POLICY.md | 65 +
vendor/libghostty-vt/CMakeLists.txt | 231 +
vendor/libghostty-vt/CODEOWNERS | 198 +
vendor/libghostty-vt/CONTRIBUTING.md | 200 +
vendor/libghostty-vt/Doxyfile | 92 +
vendor/libghostty-vt/DoxygenLayout.xml | 247 +
vendor/libghostty-vt/HACKING.md | 487 +
vendor/libghostty-vt/LICENSE | 21 +
vendor/libghostty-vt/Makefile | 28 +
vendor/libghostty-vt/PACKAGING.md | 124 +
vendor/libghostty-vt/README.md | 226 +
vendor/libghostty-vt/VERSION | 1 +
vendor/libghostty-vt/build.zig | 371 +
vendor/libghostty-vt/build.zig.zon | 125 +
vendor/libghostty-vt/build.zig.zon.json | 187 +
vendor/libghostty-vt/build.zig.zon.nix | 381 +
vendor/libghostty-vt/build.zig.zon.txt | 37 +
vendor/libghostty-vt/default.nix | 13 +
vendor/libghostty-vt/dist/cmake/README.md | 67 +
.../dist/cmake/ghostty-vt-config.cmake.in | 65 +
vendor/libghostty-vt/flake.lock | 128 +
vendor/libghostty-vt/flake.nix | 163 +
vendor/libghostty-vt/include/ghostty.h | 1206 +
vendor/libghostty-vt/include/ghostty/vt.h | 133 +
.../libghostty-vt/include/ghostty/vt/allocator.h | 255 +
.../libghostty-vt/include/ghostty/vt/build_info.h | 140 +
vendor/libghostty-vt/include/ghostty/vt/color.h | 97 +
vendor/libghostty-vt/include/ghostty/vt/device.h | 150 +
vendor/libghostty-vt/include/ghostty/vt/focus.h | 75 +
.../libghostty-vt/include/ghostty/vt/formatter.h | 225 +
vendor/libghostty-vt/include/ghostty/vt/grid_ref.h | 131 +
vendor/libghostty-vt/include/ghostty/vt/key.h | 73 +
.../libghostty-vt/include/ghostty/vt/key/encoder.h | 245 +
.../libghostty-vt/include/ghostty/vt/key/event.h | 480 +
vendor/libghostty-vt/include/ghostty/vt/modes.h | 196 +
vendor/libghostty-vt/include/ghostty/vt/mouse.h | 70 +
.../include/ghostty/vt/mouse/encoder.h | 211 +
.../libghostty-vt/include/ghostty/vt/mouse/event.h | 193 +
vendor/libghostty-vt/include/ghostty/vt/osc.h | 233 +
vendor/libghostty-vt/include/ghostty/vt/paste.h | 101 +
vendor/libghostty-vt/include/ghostty/vt/point.h | 88 +
vendor/libghostty-vt/include/ghostty/vt/render.h | 603 +
vendor/libghostty-vt/include/ghostty/vt/screen.h | 340 +
vendor/libghostty-vt/include/ghostty/vt/sgr.h | 358 +
.../libghostty-vt/include/ghostty/vt/size_report.h | 100 +
vendor/libghostty-vt/include/ghostty/vt/style.h | 138 +
vendor/libghostty-vt/include/ghostty/vt/terminal.h | 983 +
vendor/libghostty-vt/include/ghostty/vt/types.h | 121 +
vendor/libghostty-vt/include/ghostty/vt/wasm.h | 160 +
vendor/libghostty-vt/include/module.modulemap | 7 +
.../nix/build-support/build-inputs.nix | 46 +
.../nix/build-support/check-blueprints.sh | 6 +
.../nix/build-support/check-zig-cache.sh | 120 +
.../nix/build-support/fetch-zig-cache.sh | 27 +
.../nix/build-support/gi-typelib-path.nix | 17 +
.../nix/build-support/ld-library-path.nix | 10 +
.../nix/build-support/update-mirror.nu | 96 +
vendor/libghostty-vt/nix/devShell.nix | 234 +
vendor/libghostty-vt/nix/libghostty-vt.nix | 85 +
vendor/libghostty-vt/nix/package.nix | 141 +
vendor/libghostty-vt/nix/pkgs/blessed.nix | 40 +
vendor/libghostty-vt/nix/pkgs/ucs-detect.nix | 47 +
vendor/libghostty-vt/nix/pkgs/wcwidth.nix | 27 +
vendor/libghostty-vt/nix/pkgs/wraptest.nix | 43 +
vendor/libghostty-vt/nix/tests.nix | 284 +
vendor/libghostty-vt/nix/vm/common-cinnamon.nix | 18 +
vendor/libghostty-vt/nix/vm/common-gnome.nix | 149 +
vendor/libghostty-vt/nix/vm/common-plasma6.nix | 21 +
vendor/libghostty-vt/nix/vm/common-xfce.nix | 18 +
vendor/libghostty-vt/nix/vm/common.nix | 75 +
vendor/libghostty-vt/nix/vm/create-cinnamon.nix | 12 +
vendor/libghostty-vt/nix/vm/create-gnome.nix | 12 +
vendor/libghostty-vt/nix/vm/create-plasma6.nix | 12 +
vendor/libghostty-vt/nix/vm/create-xfce.nix | 12 +
vendor/libghostty-vt/nix/vm/create.nix | 42 +
vendor/libghostty-vt/nix/vm/wayland-cinnamon.nix | 7 +
vendor/libghostty-vt/nix/vm/wayland-gnome.nix | 9 +
vendor/libghostty-vt/nix/vm/wayland-plasma6.nix | 6 +
vendor/libghostty-vt/nix/vm/x11-cinnamon.nix | 7 +
vendor/libghostty-vt/nix/vm/x11-plasma6.nix | 6 +
vendor/libghostty-vt/nix/vm/x11-xfce.nix | 7 +
vendor/libghostty-vt/nix/zigCacheHash.nix | 3 +
vendor/libghostty-vt/pkg/README.md | 33 +
vendor/libghostty-vt/pkg/afl++/LICENSE | 23 +
vendor/libghostty-vt/pkg/afl++/afl.c | 141 +
vendor/libghostty-vt/pkg/afl++/build.zig | 59 +
vendor/libghostty-vt/pkg/afl++/build.zig.zon | 11 +
vendor/libghostty-vt/pkg/android-ndk/build.zig | 207 +
vendor/libghostty-vt/pkg/android-ndk/build.zig.zon | 10 +
vendor/libghostty-vt/pkg/apple-sdk/build.zig | 111 +
vendor/libghostty-vt/pkg/apple-sdk/build.zig.zon | 7 +
vendor/libghostty-vt/pkg/breakpad/build.zig | 159 +
vendor/libghostty-vt/pkg/breakpad/build.zig.zon | 15 +
vendor/libghostty-vt/pkg/dcimgui/build.zig | 210 +
vendor/libghostty-vt/pkg/dcimgui/build.zig.zon | 26 +
vendor/libghostty-vt/pkg/dcimgui/ext.cpp | 53 +
vendor/libghostty-vt/pkg/dcimgui/main.zig | 77 +
vendor/libghostty-vt/pkg/fontconfig/build.zig | 298 +
vendor/libghostty-vt/pkg/fontconfig/build.zig.zon | 16 +
vendor/libghostty-vt/pkg/fontconfig/c.zig | 3 +
vendor/libghostty-vt/pkg/fontconfig/char_set.zig | 40 +
vendor/libghostty-vt/pkg/fontconfig/common.zig | 139 +
vendor/libghostty-vt/pkg/fontconfig/config.zig | 61 +
vendor/libghostty-vt/pkg/fontconfig/error.zig | 7 +
vendor/libghostty-vt/pkg/fontconfig/font_set.zig | 44 +
vendor/libghostty-vt/pkg/fontconfig/init.zig | 43 +
vendor/libghostty-vt/pkg/fontconfig/lang_set.zig | 61 +
vendor/libghostty-vt/pkg/fontconfig/main.zig | 45 +
vendor/libghostty-vt/pkg/fontconfig/matrix.zig | 10 +
vendor/libghostty-vt/pkg/fontconfig/object_set.zig | 30 +
.../pkg/fontconfig/override/include/fcalias.h | 0
.../pkg/fontconfig/override/include/fcaliastail.h | 0
.../pkg/fontconfig/override/include/fcftalias.h | 0
.../fontconfig/override/include/fcftaliastail.h | 0
.../pkg/fontconfig/override/include/fcobjshash.h | 347 +
vendor/libghostty-vt/pkg/fontconfig/pattern.zig | 168 +
vendor/libghostty-vt/pkg/fontconfig/range.zig | 13 +
vendor/libghostty-vt/pkg/fontconfig/test.zig | 66 +
vendor/libghostty-vt/pkg/fontconfig/value.zig | 76 +
vendor/libghostty-vt/pkg/freetype/Library.zig | 92 +
vendor/libghostty-vt/pkg/freetype/build.zig | 219 +
vendor/libghostty-vt/pkg/freetype/build.zig.zon | 18 +
vendor/libghostty-vt/pkg/freetype/c.zig | 3 +
vendor/libghostty-vt/pkg/freetype/computations.zig | 8 +
vendor/libghostty-vt/pkg/freetype/errors.zig | 295 +
vendor/libghostty-vt/pkg/freetype/face.zig | 385 +
vendor/libghostty-vt/pkg/freetype/freetype-zig.h | 9 +
vendor/libghostty-vt/pkg/freetype/main.zig | 18 +
.../pkg/freetype/res/FiraCode-Regular.ttf | Bin 0 -> 289624 bytes
vendor/libghostty-vt/pkg/freetype/tag.zig | 17 +
vendor/libghostty-vt/pkg/freetype/test.zig | 1 +
vendor/libghostty-vt/pkg/glslang/build.zig | 169 +
vendor/libghostty-vt/pkg/glslang/build.zig.zon | 16 +
vendor/libghostty-vt/pkg/glslang/c.zig | 4 +
vendor/libghostty-vt/pkg/glslang/init.zig | 9 +
vendor/libghostty-vt/pkg/glslang/main.zig | 15 +
.../pkg/glslang/override/glslang/build_info.h | 62 +
vendor/libghostty-vt/pkg/glslang/program.zig | 60 +
vendor/libghostty-vt/pkg/glslang/shader.zig | 58 +
vendor/libghostty-vt/pkg/glslang/test.zig | 10 +
vendor/libghostty-vt/pkg/glslang/test/simple.frag | 56 +
.../libghostty-vt/pkg/gtk4-layer-shell/build.zig | 127 +
.../pkg/gtk4-layer-shell/build.zig.zon | 18 +
.../pkg/gtk4-layer-shell/src/main.zig | 71 +
vendor/libghostty-vt/pkg/harfbuzz/blob.zig | 126 +
vendor/libghostty-vt/pkg/harfbuzz/buffer.zig | 373 +
vendor/libghostty-vt/pkg/harfbuzz/build.zig | 185 +
vendor/libghostty-vt/pkg/harfbuzz/build.zig.zon | 18 +
vendor/libghostty-vt/pkg/harfbuzz/c.zig | 8 +
vendor/libghostty-vt/pkg/harfbuzz/common.zig | 247 +
vendor/libghostty-vt/pkg/harfbuzz/coretext.zig | 30 +
vendor/libghostty-vt/pkg/harfbuzz/errors.zig | 5 +
vendor/libghostty-vt/pkg/harfbuzz/face.zig | 17 +
vendor/libghostty-vt/pkg/harfbuzz/font.zig | 28 +
vendor/libghostty-vt/pkg/harfbuzz/freetype.zig | 78 +
vendor/libghostty-vt/pkg/harfbuzz/main.zig | 31 +
vendor/libghostty-vt/pkg/harfbuzz/shape.zig | 27 +
vendor/libghostty-vt/pkg/harfbuzz/version.zig | 47 +
vendor/libghostty-vt/pkg/highway/bridge.cpp | 9 +
vendor/libghostty-vt/pkg/highway/build.zig | 141 +
vendor/libghostty-vt/pkg/highway/build.zig.zon | 17 +
vendor/libghostty-vt/pkg/highway/main.zig | 57 +
vendor/libghostty-vt/pkg/libintl/build.zig | 104 +
vendor/libghostty-vt/pkg/libintl/build.zig.zon | 15 +
vendor/libghostty-vt/pkg/libintl/config.h | 2370 ++
vendor/libghostty-vt/pkg/libintl/libgnuintl.h | 1 +
vendor/libghostty-vt/pkg/libintl/libintl.h | 1168 +
vendor/libghostty-vt/pkg/libpng/build.zig | 91 +
vendor/libghostty-vt/pkg/libpng/build.zig.zon | 17 +
vendor/libghostty-vt/pkg/libpng/pnglibconf.h | 219 +
vendor/libghostty-vt/pkg/libxml2/build.zig | 227 +
vendor/libghostty-vt/pkg/libxml2/build.zig.zon | 13 +
.../pkg/libxml2/override/config/posix/config.h | 80 +
.../pkg/libxml2/override/config/win32/config.h | 20 +
.../libxml2/override/include/libxml/xmlversion.h | 18 +
vendor/libghostty-vt/pkg/macos/animation.zig | 10 +
vendor/libghostty-vt/pkg/macos/animation/c.zig | 1 +
vendor/libghostty-vt/pkg/macos/build.zig | 82 +
vendor/libghostty-vt/pkg/macos/build.zig.zon | 9 +
vendor/libghostty-vt/pkg/macos/carbon.zig | 5 +
vendor/libghostty-vt/pkg/macos/carbon/c.zig | 1 +
vendor/libghostty-vt/pkg/macos/dispatch.zig | 18 +
vendor/libghostty-vt/pkg/macos/dispatch/c.zig | 1 +
vendor/libghostty-vt/pkg/macos/dispatch/data.zig | 31 +
vendor/libghostty-vt/pkg/macos/dispatch/queue.zig | 8 +
vendor/libghostty-vt/pkg/macos/foundation.zig | 37 +
.../libghostty-vt/pkg/macos/foundation/array.zig | 176 +
.../pkg/macos/foundation/attributed_string.zig | 103 +
vendor/libghostty-vt/pkg/macos/foundation/base.zig | 35 +
vendor/libghostty-vt/pkg/macos/foundation/c.zig | 1 +
.../pkg/macos/foundation/character_set.zig | 49 +
vendor/libghostty-vt/pkg/macos/foundation/data.zig | 38 +
.../pkg/macos/foundation/dictionary.zig | 125 +
.../libghostty-vt/pkg/macos/foundation/number.zig | 79 +
.../libghostty-vt/pkg/macos/foundation/string.zig | 174 +
vendor/libghostty-vt/pkg/macos/foundation/type.zig | 2 +
vendor/libghostty-vt/pkg/macos/foundation/url.zig | 104 +
vendor/libghostty-vt/pkg/macos/graphics.zig | 24 +
.../pkg/macos/graphics/affine_transform.zig | 16 +
.../pkg/macos/graphics/bitmap_context.zig | 50 +
vendor/libghostty-vt/pkg/macos/graphics/c.zig | 1 +
.../pkg/macos/graphics/color_space.zig | 99 +
.../libghostty-vt/pkg/macos/graphics/context.zig | 172 +
vendor/libghostty-vt/pkg/macos/graphics/font.zig | 3 +
.../libghostty-vt/pkg/macos/graphics/geometry.zig | 34 +
vendor/libghostty-vt/pkg/macos/graphics/image.zig | 31 +
vendor/libghostty-vt/pkg/macos/graphics/path.zig | 68 +
vendor/libghostty-vt/pkg/macos/iosurface.zig | 8 +
vendor/libghostty-vt/pkg/macos/iosurface/c.zig | 1 +
.../pkg/macos/iosurface/iosurface.zig | 136 +
vendor/libghostty-vt/pkg/macos/main.zig | 35 +
vendor/libghostty-vt/pkg/macos/os.zig | 10 +
vendor/libghostty-vt/pkg/macos/os/c.zig | 1 +
vendor/libghostty-vt/pkg/macos/os/log.zig | 65 +
vendor/libghostty-vt/pkg/macos/os/signpost.zig | 214 +
vendor/libghostty-vt/pkg/macos/os/zig_macos.c | 11 +
vendor/libghostty-vt/pkg/macos/text.zig | 38 +
vendor/libghostty-vt/pkg/macos/text/c.zig | 1 +
vendor/libghostty-vt/pkg/macos/text/ext.c | 10 +
vendor/libghostty-vt/pkg/macos/text/font.zig | 306 +
.../pkg/macos/text/font_collection.zig | 139 +
.../pkg/macos/text/font_descriptor.zig | 287 +
.../libghostty-vt/pkg/macos/text/font_manager.zig | 23 +
vendor/libghostty-vt/pkg/macos/text/frame.zig | 33 +
.../libghostty-vt/pkg/macos/text/framesetter.zig | 66 +
vendor/libghostty-vt/pkg/macos/text/line.zig | 123 +
.../pkg/macos/text/paragraph_style.zig | 49 +
vendor/libghostty-vt/pkg/macos/text/run.zig | 117 +
.../pkg/macos/text/stylized_strings.zig | 16 +
vendor/libghostty-vt/pkg/macos/text/typesetter.zig | 36 +
vendor/libghostty-vt/pkg/macos/video.zig | 10 +
vendor/libghostty-vt/pkg/macos/video/c.zig | 1 +
.../libghostty-vt/pkg/macos/video/display_link.zig | 86 +
.../libghostty-vt/pkg/macos/video/pixel_format.zig | 171 +
vendor/libghostty-vt/pkg/oniguruma/build.zig | 171 +
vendor/libghostty-vt/pkg/oniguruma/build.zig.zon | 16 +
vendor/libghostty-vt/pkg/oniguruma/c.zig | 3 +
vendor/libghostty-vt/pkg/oniguruma/errors.zig | 201 +
vendor/libghostty-vt/pkg/oniguruma/init.zig | 16 +
vendor/libghostty-vt/pkg/oniguruma/main.zig | 21 +
vendor/libghostty-vt/pkg/oniguruma/match_param.zig | 23 +
vendor/libghostty-vt/pkg/oniguruma/regex.zig | 152 +
vendor/libghostty-vt/pkg/oniguruma/region.zig | 51 +
vendor/libghostty-vt/pkg/oniguruma/testing.zig | 15 +
vendor/libghostty-vt/pkg/oniguruma/types.zig | 96 +
vendor/libghostty-vt/pkg/opengl/Buffer.zig | 245 +
vendor/libghostty-vt/pkg/opengl/Framebuffer.zig | 116 +
vendor/libghostty-vt/pkg/opengl/Program.zig | 137 +
vendor/libghostty-vt/pkg/opengl/Renderbuffer.zig | 56 +
vendor/libghostty-vt/pkg/opengl/Sampler.zig | 43 +
vendor/libghostty-vt/pkg/opengl/Shader.zig | 56 +
vendor/libghostty-vt/pkg/opengl/Texture.zig | 221 +
vendor/libghostty-vt/pkg/opengl/VertexArray.zig | 116 +
vendor/libghostty-vt/pkg/opengl/build.zig | 6 +
vendor/libghostty-vt/pkg/opengl/c.zig | 3 +
vendor/libghostty-vt/pkg/opengl/draw.zig | 94 +
vendor/libghostty-vt/pkg/opengl/errors.zig | 33 +
vendor/libghostty-vt/pkg/opengl/extensions.zig | 32 +
vendor/libghostty-vt/pkg/opengl/glad.zig | 45 +
vendor/libghostty-vt/pkg/opengl/main.zig | 45 +
vendor/libghostty-vt/pkg/opengl/primitives.zig | 18 +
vendor/libghostty-vt/pkg/sentry/build.zig | 243 +
vendor/libghostty-vt/pkg/sentry/build.zig.zon | 17 +
vendor/libghostty-vt/pkg/sentry/c.zig | 3 +
vendor/libghostty-vt/pkg/sentry/envelope.zig | 31 +
vendor/libghostty-vt/pkg/sentry/level.zig | 8 +
vendor/libghostty-vt/pkg/sentry/main.zig | 35 +
vendor/libghostty-vt/pkg/sentry/transport.zig | 26 +
vendor/libghostty-vt/pkg/sentry/uuid.zig | 22 +
vendor/libghostty-vt/pkg/sentry/value.zig | 75 +
vendor/libghostty-vt/pkg/simdutf/build.zig | 81 +
vendor/libghostty-vt/pkg/simdutf/build.zig.zon | 10 +
.../libghostty-vt/pkg/simdutf/vendor/simdutf.cpp | 38579 +++++++++++++++++++
vendor/libghostty-vt/pkg/simdutf/vendor/simdutf.h | 3757 ++
vendor/libghostty-vt/pkg/spirv-cross/build.zig | 120 +
vendor/libghostty-vt/pkg/spirv-cross/build.zig.zon | 16 +
vendor/libghostty-vt/pkg/spirv-cross/c.zig | 3 +
vendor/libghostty-vt/pkg/spirv-cross/main.zig | 1 +
vendor/libghostty-vt/pkg/utfcpp/build.zig | 69 +
vendor/libghostty-vt/pkg/utfcpp/build.zig.zon | 17 +
vendor/libghostty-vt/pkg/utfcpp/empty.cc | 2 +
vendor/libghostty-vt/pkg/wuffs/build.zig | 53 +
vendor/libghostty-vt/pkg/wuffs/build.zig.zon | 27 +
vendor/libghostty-vt/pkg/wuffs/src/c.zig | 18 +
vendor/libghostty-vt/pkg/wuffs/src/error.zig | 13 +
vendor/libghostty-vt/pkg/wuffs/src/jpeg.zig | 151 +
vendor/libghostty-vt/pkg/wuffs/src/main.zig | 20 +
vendor/libghostty-vt/pkg/wuffs/src/png.zig | 151 +
vendor/libghostty-vt/pkg/wuffs/src/swizzle.zig | 121 +
vendor/libghostty-vt/pkg/zlib/build.zig | 71 +
vendor/libghostty-vt/pkg/zlib/build.zig.zon | 16 +
vendor/libghostty-vt/shell.nix | 12 +
vendor/libghostty-vt/src/App.zig | 623 +
vendor/libghostty-vt/src/Command.zig | 903 +
vendor/libghostty-vt/src/Surface.zig | 6660 ++++
vendor/libghostty-vt/src/apprt.zig | 59 +
vendor/libghostty-vt/src/apprt/action.zig | 1007 +
vendor/libghostty-vt/src/apprt/browser.zig | 4 +
vendor/libghostty-vt/src/apprt/embedded.zig | 2231 ++
vendor/libghostty-vt/src/apprt/gtk.zig | 17 +
vendor/libghostty-vt/src/apprt/gtk/App.zig | 93 +
vendor/libghostty-vt/src/apprt/gtk/Surface.zig | 104 +
vendor/libghostty-vt/src/apprt/gtk/adw_version.zig | 122 +
.../src/apprt/gtk/build/blueprint.zig | 174 +
.../src/apprt/gtk/build/gresource.zig | 277 +
vendor/libghostty-vt/src/apprt/gtk/build/info.zig | 18 +
vendor/libghostty-vt/src/apprt/gtk/cgroup.zig | 115 +
vendor/libghostty-vt/src/apprt/gtk/class.zig | 367 +
.../src/apprt/gtk/class/application.zig | 2945 ++
.../gtk/class/clipboard_confirmation_dialog.zig | 352 +
.../apprt/gtk/class/close_confirmation_dialog.zig | 204 +
.../src/apprt/gtk/class/command_palette.zig | 789 +
.../libghostty-vt/src/apprt/gtk/class/config.zig | 175 +
.../src/apprt/gtk/class/config_errors_dialog.zig | 161 +
.../src/apprt/gtk/class/debug_warning.zig | 50 +
.../libghostty-vt/src/apprt/gtk/class/dialog.zig | 91 +
.../src/apprt/gtk/class/global_shortcuts.zig | 633 +
.../src/apprt/gtk/class/imgui_widget.zig | 551 +
.../src/apprt/gtk/class/inspector_widget.zig | 245 +
.../src/apprt/gtk/class/inspector_window.zig | 217 +
.../src/apprt/gtk/class/key_state_overlay.zig | 342 +
.../src/apprt/gtk/class/resize_overlay.zig | 338 +
.../src/apprt/gtk/class/search_overlay.zig | 493 +
.../src/apprt/gtk/class/split_tree.zig | 1290 +
.../libghostty-vt/src/apprt/gtk/class/surface.zig | 4049 ++
.../src/apprt/gtk/class/surface_child_exited.zig | 264 +
.../apprt/gtk/class/surface_scrolled_window.zig | 228 +
vendor/libghostty-vt/src/apprt/gtk/class/tab.zig | 592 +
.../src/apprt/gtk/class/title_dialog.zig | 234 +
.../libghostty-vt/src/apprt/gtk/class/window.zig | 2111 +
.../libghostty-vt/src/apprt/gtk/css/style-dark.css | 8 +
.../src/apprt/gtk/css/style-hc-dark.css | 3 +
.../libghostty-vt/src/apprt/gtk/css/style-hc.css | 3 +
vendor/libghostty-vt/src/apprt/gtk/css/style.css | 183 +
vendor/libghostty-vt/src/apprt/gtk/ext.zig | 70 +
vendor/libghostty-vt/src/apprt/gtk/ext/actions.zig | 198 +
vendor/libghostty-vt/src/apprt/gtk/ext/slice.zig | 111 +
vendor/libghostty-vt/src/apprt/gtk/flatpak.zig | 29 +
vendor/libghostty-vt/src/apprt/gtk/gsettings.zig | 101 +
vendor/libghostty-vt/src/apprt/gtk/gtk_version.zig | 140 +
vendor/libghostty-vt/src/apprt/gtk/ipc/DBus.zig | 196 +
.../libghostty-vt/src/apprt/gtk/ipc/new_window.zig | 62 +
vendor/libghostty-vt/src/apprt/gtk/key.zig | 535 +
vendor/libghostty-vt/src/apprt/gtk/media.zig | 102 +
vendor/libghostty-vt/src/apprt/gtk/portal.zig | 105 +
.../libghostty-vt/src/apprt/gtk/portal/OpenURI.zig | 565 +
vendor/libghostty-vt/src/apprt/gtk/post_fork.zig | 121 +
vendor/libghostty-vt/src/apprt/gtk/pre_exec.zig | 81 +
.../gtk/ui/1.0/clipboard-confirmation-dialog.blp | 86 +
.../apprt/gtk/ui/1.2/close-confirmation-dialog.blp | 12 +
.../src/apprt/gtk/ui/1.2/config-errors-dialog.blp | 28 +
.../src/apprt/gtk/ui/1.2/debug-warning.blp | 11 +
.../src/apprt/gtk/ui/1.2/key-state-overlay.blp | 58 +
.../src/apprt/gtk/ui/1.2/resize-overlay.blp | 33 +
.../src/apprt/gtk/ui/1.2/search-overlay.blp | 94 +
.../libghostty-vt/src/apprt/gtk/ui/1.2/surface.blp | 371 +
.../src/apprt/gtk/ui/1.3/debug-warning.blp | 9 +
.../src/apprt/gtk/ui/1.3/surface-child-exited.blp | 22 +
.../gtk/ui/1.4/clipboard-confirmation-dialog.blp | 96 +
.../src/apprt/gtk/ui/1.5/command-palette.blp | 110 +
.../src/apprt/gtk/ui/1.5/imgui-widget.blp | 51 +
.../src/apprt/gtk/ui/1.5/inspector-widget.blp | 10 +
.../src/apprt/gtk/ui/1.5/inspector-window.blp | 38 +
.../src/apprt/gtk/ui/1.5/split-tree-split.blp | 20 +
.../src/apprt/gtk/ui/1.5/split-tree.blp | 25 +
.../apprt/gtk/ui/1.5/surface-scrolled-window.blp | 11 +
vendor/libghostty-vt/src/apprt/gtk/ui/1.5/tab.blp | 18 +
.../src/apprt/gtk/ui/1.5/title-dialog.blp | 18 +
.../libghostty-vt/src/apprt/gtk/ui/1.5/window.blp | 323 +
vendor/libghostty-vt/src/apprt/gtk/weak_ref.zig | 44 +
vendor/libghostty-vt/src/apprt/gtk/winproto.zig | 155 +
.../src/apprt/gtk/winproto/BlurRegion.zig | 187 +
.../libghostty-vt/src/apprt/gtk/winproto/noop.zig | 73 +
.../src/apprt/gtk/winproto/wayland.zig | 486 +
.../src/apprt/gtk/winproto/wayland/Globals.zig | 252 +
.../libghostty-vt/src/apprt/gtk/winproto/x11.zig | 498 +
vendor/libghostty-vt/src/apprt/ipc.zig | 192 +
vendor/libghostty-vt/src/apprt/none.zig | 19 +
vendor/libghostty-vt/src/apprt/runtime.zig | 29 +
vendor/libghostty-vt/src/apprt/structs.zig | 114 +
vendor/libghostty-vt/src/apprt/surface.zig | 197 +
vendor/libghostty-vt/src/benchmark/Benchmark.zig | 178 +
vendor/libghostty-vt/src/benchmark/CApi.zig | 34 +
.../libghostty-vt/src/benchmark/CodepointWidth.zig | 207 +
.../libghostty-vt/src/benchmark/GraphemeBreak.zig | 152 +
vendor/libghostty-vt/src/benchmark/IsSymbol.zig | 151 +
vendor/libghostty-vt/src/benchmark/OscParser.zig | 118 +
vendor/libghostty-vt/src/benchmark/ScreenClone.zig | 193 +
.../libghostty-vt/src/benchmark/TerminalParser.zig | 108 +
.../libghostty-vt/src/benchmark/TerminalStream.zig | 161 +
vendor/libghostty-vt/src/benchmark/cli.zig | 100 +
vendor/libghostty-vt/src/benchmark/main.zig | 13 +
vendor/libghostty-vt/src/benchmark/options.zig | 20 +
vendor/libghostty-vt/src/build/Config.zig | 666 +
vendor/libghostty-vt/src/build/GhosttyBench.zig | 55 +
vendor/libghostty-vt/src/build/GhosttyDist.zig | 257 +
vendor/libghostty-vt/src/build/GhosttyDocs.zig | 124 +
vendor/libghostty-vt/src/build/GhosttyExe.zig | 127 +
.../libghostty-vt/src/build/GhosttyFrameData.zig | 75 +
vendor/libghostty-vt/src/build/GhosttyI18n.zig | 193 +
vendor/libghostty-vt/src/build/GhosttyLib.zig | 199 +
vendor/libghostty-vt/src/build/GhosttyLibVt.zig | 310 +
.../libghostty-vt/src/build/GhosttyResources.zig | 442 +
vendor/libghostty-vt/src/build/GhosttyWebdata.zig | 119 +
.../libghostty-vt/src/build/GhosttyXCFramework.zig | 104 +
.../libghostty-vt/src/build/GhosttyXcodebuild.zig | 203 +
vendor/libghostty-vt/src/build/GhosttyZig.zig | 102 +
vendor/libghostty-vt/src/build/GitVersion.zig | 83 +
vendor/libghostty-vt/src/build/HelpStrings.zig | 56 +
vendor/libghostty-vt/src/build/LibtoolStep.zig | 78 +
vendor/libghostty-vt/src/build/LipoStep.zig | 42 +
vendor/libghostty-vt/src/build/MetallibStep.zig | 84 +
vendor/libghostty-vt/src/build/SharedDeps.zig | 974 +
vendor/libghostty-vt/src/build/UnicodeTables.zig | 92 +
vendor/libghostty-vt/src/build/XCFrameworkStep.zig | 77 +
.../src/build/docker/debian/Dockerfile | 43 +
.../src/build/docker/lib-c-docs/Dockerfile | 38 +
.../src/build/docker/lib-c-docs/entrypoint.sh | 32 +
.../src/build/framegen/frames/frame_001.txt | 41 +
.../src/build/framegen/frames/frame_002.txt | 41 +
.../src/build/framegen/frames/frame_003.txt | 41 +
.../src/build/framegen/frames/frame_004.txt | 41 +
.../src/build/framegen/frames/frame_005.txt | 41 +
.../src/build/framegen/frames/frame_006.txt | 41 +
.../src/build/framegen/frames/frame_007.txt | 41 +
.../src/build/framegen/frames/frame_008.txt | 41 +
.../src/build/framegen/frames/frame_009.txt | 41 +
.../src/build/framegen/frames/frame_010.txt | 41 +
.../src/build/framegen/frames/frame_011.txt | 41 +
.../src/build/framegen/frames/frame_012.txt | 41 +
.../src/build/framegen/frames/frame_013.txt | 41 +
.../src/build/framegen/frames/frame_014.txt | 41 +
.../src/build/framegen/frames/frame_015.txt | 41 +
.../src/build/framegen/frames/frame_016.txt | 41 +
.../src/build/framegen/frames/frame_017.txt | 41 +
.../src/build/framegen/frames/frame_018.txt | 41 +
.../src/build/framegen/frames/frame_019.txt | 41 +
.../src/build/framegen/frames/frame_020.txt | 41 +
.../src/build/framegen/frames/frame_021.txt | 41 +
.../src/build/framegen/frames/frame_022.txt | 41 +
.../src/build/framegen/frames/frame_023.txt | 41 +
.../src/build/framegen/frames/frame_024.txt | 41 +
.../src/build/framegen/frames/frame_025.txt | 41 +
.../src/build/framegen/frames/frame_026.txt | 41 +
.../src/build/framegen/frames/frame_027.txt | 41 +
.../src/build/framegen/frames/frame_028.txt | 41 +
.../src/build/framegen/frames/frame_029.txt | 41 +
.../src/build/framegen/frames/frame_030.txt | 41 +
.../src/build/framegen/frames/frame_031.txt | 41 +
.../src/build/framegen/frames/frame_032.txt | 41 +
.../src/build/framegen/frames/frame_033.txt | 41 +
.../src/build/framegen/frames/frame_034.txt | 41 +
.../src/build/framegen/frames/frame_035.txt | 41 +
.../src/build/framegen/frames/frame_036.txt | 41 +
.../src/build/framegen/frames/frame_037.txt | 41 +
.../src/build/framegen/frames/frame_038.txt | 41 +
.../src/build/framegen/frames/frame_039.txt | 41 +
.../src/build/framegen/frames/frame_040.txt | 41 +
.../src/build/framegen/frames/frame_041.txt | 41 +
.../src/build/framegen/frames/frame_042.txt | 41 +
.../src/build/framegen/frames/frame_043.txt | 41 +
.../src/build/framegen/frames/frame_044.txt | 41 +
.../src/build/framegen/frames/frame_045.txt | 41 +
.../src/build/framegen/frames/frame_046.txt | 41 +
.../src/build/framegen/frames/frame_047.txt | 41 +
.../src/build/framegen/frames/frame_048.txt | 41 +
.../src/build/framegen/frames/frame_049.txt | 41 +
.../src/build/framegen/frames/frame_050.txt | 41 +
.../src/build/framegen/frames/frame_051.txt | 41 +
.../src/build/framegen/frames/frame_052.txt | 41 +
.../src/build/framegen/frames/frame_053.txt | 41 +
.../src/build/framegen/frames/frame_054.txt | 41 +
.../src/build/framegen/frames/frame_055.txt | 41 +
.../src/build/framegen/frames/frame_056.txt | 41 +
.../src/build/framegen/frames/frame_057.txt | 41 +
.../src/build/framegen/frames/frame_058.txt | 41 +
.../src/build/framegen/frames/frame_059.txt | 41 +
.../src/build/framegen/frames/frame_060.txt | 41 +
.../src/build/framegen/frames/frame_061.txt | 41 +
.../src/build/framegen/frames/frame_062.txt | 41 +
.../src/build/framegen/frames/frame_063.txt | 41 +
.../src/build/framegen/frames/frame_064.txt | 41 +
.../src/build/framegen/frames/frame_065.txt | 41 +
.../src/build/framegen/frames/frame_066.txt | 41 +
.../src/build/framegen/frames/frame_067.txt | 41 +
.../src/build/framegen/frames/frame_068.txt | 41 +
.../src/build/framegen/frames/frame_069.txt | 41 +
.../src/build/framegen/frames/frame_070.txt | 41 +
.../src/build/framegen/frames/frame_071.txt | 41 +
.../src/build/framegen/frames/frame_072.txt | 41 +
.../src/build/framegen/frames/frame_073.txt | 41 +
.../src/build/framegen/frames/frame_074.txt | 41 +
.../src/build/framegen/frames/frame_075.txt | 41 +
.../src/build/framegen/frames/frame_076.txt | 41 +
.../src/build/framegen/frames/frame_077.txt | 41 +
.../src/build/framegen/frames/frame_078.txt | 41 +
.../src/build/framegen/frames/frame_079.txt | 41 +
.../src/build/framegen/frames/frame_080.txt | 41 +
.../src/build/framegen/frames/frame_081.txt | 41 +
.../src/build/framegen/frames/frame_082.txt | 41 +
.../src/build/framegen/frames/frame_083.txt | 41 +
.../src/build/framegen/frames/frame_084.txt | 41 +
.../src/build/framegen/frames/frame_085.txt | 41 +
.../src/build/framegen/frames/frame_086.txt | 41 +
.../src/build/framegen/frames/frame_087.txt | 41 +
.../src/build/framegen/frames/frame_088.txt | 41 +
.../src/build/framegen/frames/frame_089.txt | 41 +
.../src/build/framegen/frames/frame_090.txt | 41 +
.../src/build/framegen/frames/frame_091.txt | 41 +
.../src/build/framegen/frames/frame_092.txt | 41 +
.../src/build/framegen/frames/frame_093.txt | 41 +
.../src/build/framegen/frames/frame_094.txt | 41 +
.../src/build/framegen/frames/frame_095.txt | 41 +
.../src/build/framegen/frames/frame_096.txt | 41 +
.../src/build/framegen/frames/frame_097.txt | 41 +
.../src/build/framegen/frames/frame_098.txt | 41 +
.../src/build/framegen/frames/frame_099.txt | 41 +
.../src/build/framegen/frames/frame_100.txt | 41 +
.../src/build/framegen/frames/frame_101.txt | 41 +
.../src/build/framegen/frames/frame_102.txt | 41 +
.../src/build/framegen/frames/frame_103.txt | 41 +
.../src/build/framegen/frames/frame_104.txt | 41 +
.../src/build/framegen/frames/frame_105.txt | 41 +
.../src/build/framegen/frames/frame_106.txt | 41 +
.../src/build/framegen/frames/frame_107.txt | 41 +
.../src/build/framegen/frames/frame_108.txt | 41 +
.../src/build/framegen/frames/frame_109.txt | 41 +
.../src/build/framegen/frames/frame_110.txt | 41 +
.../src/build/framegen/frames/frame_111.txt | 41 +
.../src/build/framegen/frames/frame_112.txt | 41 +
.../src/build/framegen/frames/frame_113.txt | 41 +
.../src/build/framegen/frames/frame_114.txt | 41 +
.../src/build/framegen/frames/frame_115.txt | 41 +
.../src/build/framegen/frames/frame_116.txt | 41 +
.../src/build/framegen/frames/frame_117.txt | 41 +
.../src/build/framegen/frames/frame_118.txt | 41 +
.../src/build/framegen/frames/frame_119.txt | 41 +
.../src/build/framegen/frames/frame_120.txt | 41 +
.../src/build/framegen/frames/frame_121.txt | 41 +
.../src/build/framegen/frames/frame_122.txt | 41 +
.../src/build/framegen/frames/frame_123.txt | 41 +
.../src/build/framegen/frames/frame_124.txt | 41 +
.../src/build/framegen/frames/frame_125.txt | 41 +
.../src/build/framegen/frames/frame_126.txt | 41 +
.../src/build/framegen/frames/frame_127.txt | 41 +
.../src/build/framegen/frames/frame_128.txt | 41 +
.../src/build/framegen/frames/frame_129.txt | 41 +
.../src/build/framegen/frames/frame_130.txt | 41 +
.../src/build/framegen/frames/frame_131.txt | 41 +
.../src/build/framegen/frames/frame_132.txt | 41 +
.../src/build/framegen/frames/frame_133.txt | 41 +
.../src/build/framegen/frames/frame_134.txt | 41 +
.../src/build/framegen/frames/frame_135.txt | 41 +
.../src/build/framegen/frames/frame_136.txt | 41 +
.../src/build/framegen/frames/frame_137.txt | 41 +
.../src/build/framegen/frames/frame_138.txt | 41 +
.../src/build/framegen/frames/frame_139.txt | 41 +
.../src/build/framegen/frames/frame_140.txt | 41 +
.../src/build/framegen/frames/frame_141.txt | 41 +
.../src/build/framegen/frames/frame_142.txt | 41 +
.../src/build/framegen/frames/frame_143.txt | 41 +
.../src/build/framegen/frames/frame_144.txt | 41 +
.../src/build/framegen/frames/frame_145.txt | 41 +
.../src/build/framegen/frames/frame_146.txt | 41 +
.../src/build/framegen/frames/frame_147.txt | 41 +
.../src/build/framegen/frames/frame_148.txt | 41 +
.../src/build/framegen/frames/frame_149.txt | 41 +
.../src/build/framegen/frames/frame_150.txt | 41 +
.../src/build/framegen/frames/frame_151.txt | 41 +
.../src/build/framegen/frames/frame_152.txt | 41 +
.../src/build/framegen/frames/frame_153.txt | 41 +
.../src/build/framegen/frames/frame_154.txt | 41 +
.../src/build/framegen/frames/frame_155.txt | 41 +
.../src/build/framegen/frames/frame_156.txt | 41 +
.../src/build/framegen/frames/frame_157.txt | 41 +
.../src/build/framegen/frames/frame_158.txt | 41 +
.../src/build/framegen/frames/frame_159.txt | 41 +
.../src/build/framegen/frames/frame_160.txt | 41 +
.../src/build/framegen/frames/frame_161.txt | 41 +
.../src/build/framegen/frames/frame_162.txt | 41 +
.../src/build/framegen/frames/frame_163.txt | 41 +
.../src/build/framegen/frames/frame_164.txt | 41 +
.../src/build/framegen/frames/frame_165.txt | 41 +
.../src/build/framegen/frames/frame_166.txt | 41 +
.../src/build/framegen/frames/frame_167.txt | 41 +
.../src/build/framegen/frames/frame_168.txt | 41 +
.../src/build/framegen/frames/frame_169.txt | 41 +
.../src/build/framegen/frames/frame_170.txt | 41 +
.../src/build/framegen/frames/frame_171.txt | 41 +
.../src/build/framegen/frames/frame_172.txt | 41 +
.../src/build/framegen/frames/frame_173.txt | 41 +
.../src/build/framegen/frames/frame_174.txt | 41 +
.../src/build/framegen/frames/frame_175.txt | 41 +
.../src/build/framegen/frames/frame_176.txt | 41 +
.../src/build/framegen/frames/frame_177.txt | 41 +
.../src/build/framegen/frames/frame_178.txt | 41 +
.../src/build/framegen/frames/frame_179.txt | 41 +
.../src/build/framegen/frames/frame_180.txt | 41 +
.../src/build/framegen/frames/frame_181.txt | 41 +
.../src/build/framegen/frames/frame_182.txt | 41 +
.../src/build/framegen/frames/frame_183.txt | 41 +
.../src/build/framegen/frames/frame_184.txt | 41 +
.../src/build/framegen/frames/frame_185.txt | 41 +
.../src/build/framegen/frames/frame_186.txt | 41 +
.../src/build/framegen/frames/frame_187.txt | 41 +
.../src/build/framegen/frames/frame_188.txt | 41 +
.../src/build/framegen/frames/frame_189.txt | 41 +
.../src/build/framegen/frames/frame_190.txt | 41 +
.../src/build/framegen/frames/frame_191.txt | 41 +
.../src/build/framegen/frames/frame_192.txt | 41 +
.../src/build/framegen/frames/frame_193.txt | 41 +
.../src/build/framegen/frames/frame_194.txt | 41 +
.../src/build/framegen/frames/frame_195.txt | 41 +
.../src/build/framegen/frames/frame_196.txt | 41 +
.../src/build/framegen/frames/frame_197.txt | 41 +
.../src/build/framegen/frames/frame_198.txt | 41 +
.../src/build/framegen/frames/frame_199.txt | 41 +
.../src/build/framegen/frames/frame_200.txt | 41 +
.../src/build/framegen/frames/frame_201.txt | 41 +
.../src/build/framegen/frames/frame_202.txt | 41 +
.../src/build/framegen/frames/frame_203.txt | 41 +
.../src/build/framegen/frames/frame_204.txt | 41 +
.../src/build/framegen/frames/frame_205.txt | 41 +
.../src/build/framegen/frames/frame_206.txt | 41 +
.../src/build/framegen/frames/frame_207.txt | 41 +
.../src/build/framegen/frames/frame_208.txt | 41 +
.../src/build/framegen/frames/frame_209.txt | 41 +
.../src/build/framegen/frames/frame_210.txt | 41 +
.../src/build/framegen/frames/frame_211.txt | 41 +
.../src/build/framegen/frames/frame_212.txt | 41 +
.../src/build/framegen/frames/frame_213.txt | 41 +
.../src/build/framegen/frames/frame_214.txt | 41 +
.../src/build/framegen/frames/frame_215.txt | 41 +
.../src/build/framegen/frames/frame_216.txt | 41 +
.../src/build/framegen/frames/frame_217.txt | 41 +
.../src/build/framegen/frames/frame_218.txt | 41 +
.../src/build/framegen/frames/frame_219.txt | 41 +
.../src/build/framegen/frames/frame_220.txt | 41 +
.../src/build/framegen/frames/frame_221.txt | 41 +
.../src/build/framegen/frames/frame_222.txt | 41 +
.../src/build/framegen/frames/frame_223.txt | 41 +
.../src/build/framegen/frames/frame_224.txt | 41 +
.../src/build/framegen/frames/frame_225.txt | 41 +
.../src/build/framegen/frames/frame_226.txt | 41 +
.../src/build/framegen/frames/frame_227.txt | 41 +
.../src/build/framegen/frames/frame_228.txt | 41 +
.../src/build/framegen/frames/frame_229.txt | 41 +
.../src/build/framegen/frames/frame_230.txt | 41 +
.../src/build/framegen/frames/frame_231.txt | 41 +
.../src/build/framegen/frames/frame_232.txt | 41 +
.../src/build/framegen/frames/frame_233.txt | 41 +
.../src/build/framegen/frames/frame_234.txt | 41 +
.../src/build/framegen/frames/frame_235.txt | 41 +
vendor/libghostty-vt/src/build/framegen/main.c | 168 +
vendor/libghostty-vt/src/build/gtk.zig | 27 +
vendor/libghostty-vt/src/build/main.zig | 34 +
.../src/build/mdgen/ghostty_1_footer.md | 64 +
.../src/build/mdgen/ghostty_1_header.md | 23 +
.../src/build/mdgen/ghostty_5_footer.md | 43 +
.../src/build/mdgen/ghostty_5_header.md | 122 +
.../src/build/mdgen/main_ghostty_1.zig | 16 +
.../src/build/mdgen/main_ghostty_5.zig | 16 +
vendor/libghostty-vt/src/build/mdgen/mdgen.zig | 117 +
vendor/libghostty-vt/src/build/uucode_config.zig | 109 +
.../src/build/wasm_patch_growable_table.zig | 269 +
.../src/build/webgen/main_actions.zig | 9 +
.../src/build/webgen/main_commands.zig | 53 +
.../libghostty-vt/src/build/webgen/main_config.zig | 134 +
vendor/libghostty-vt/src/build/xcframework.zig | 3 +
vendor/libghostty-vt/src/build/zig.zig | 18 +
vendor/libghostty-vt/src/build_config.zig | 105 +
vendor/libghostty-vt/src/cli.zig | 14 +
vendor/libghostty-vt/src/cli/CommaSplitter.zig | 483 +
vendor/libghostty-vt/src/cli/Pager.zig | 93 +
vendor/libghostty-vt/src/cli/README.md | 13 +
vendor/libghostty-vt/src/cli/action.zig | 277 +
vendor/libghostty-vt/src/cli/args.zig | 1627 +
vendor/libghostty-vt/src/cli/boo.zig | 236 +
vendor/libghostty-vt/src/cli/crash_report.zig | 93 +
vendor/libghostty-vt/src/cli/diagnostics.zig | 197 +
vendor/libghostty-vt/src/cli/edit_config.zig | 180 +
vendor/libghostty-vt/src/cli/explain_config.zig | 151 +
vendor/libghostty-vt/src/cli/ghostty.zig | 308 +
vendor/libghostty-vt/src/cli/help.zig | 78 +
vendor/libghostty-vt/src/cli/list_actions.zig | 52 +
vendor/libghostty-vt/src/cli/list_colors.zig | 209 +
vendor/libghostty-vt/src/cli/list_fonts.zig | 165 +
vendor/libghostty-vt/src/cli/list_keybinds.zig | 435 +
vendor/libghostty-vt/src/cli/list_themes.zig | 1741 +
vendor/libghostty-vt/src/cli/lorem_ipsum.txt | 45 +
vendor/libghostty-vt/src/cli/new_window.zig | 231 +
vendor/libghostty-vt/src/cli/show_config.zig | 92 +
vendor/libghostty-vt/src/cli/show_face.zig | 239 +
.../libghostty-vt/src/cli/ssh-cache/DiskCache.zig | 579 +
vendor/libghostty-vt/src/cli/ssh-cache/Entry.zig | 156 +
vendor/libghostty-vt/src/cli/ssh_cache.zig | 228 +
vendor/libghostty-vt/src/cli/tui.zig | 6 +
vendor/libghostty-vt/src/cli/validate_config.zig | 78 +
vendor/libghostty-vt/src/cli/version.zig | 76 +
vendor/libghostty-vt/src/config.zig | 56 +
vendor/libghostty-vt/src/config/CApi.zig | 280 +
.../src/config/ClipboardCodepointMap.zig | 44 +
vendor/libghostty-vt/src/config/Config.zig | 10887 ++++++
vendor/libghostty-vt/src/config/ErrorList.zig | 23 +
.../src/config/RepeatableStringMap.zig | 198 +
vendor/libghostty-vt/src/config/Wasm.zig | 54 +
vendor/libghostty-vt/src/config/c_get.zig | 240 +
vendor/libghostty-vt/src/config/command.zig | 330 +
vendor/libghostty-vt/src/config/conditional.zig | 94 +
vendor/libghostty-vt/src/config/config-template | 52 +
vendor/libghostty-vt/src/config/edit.zig | 104 +
vendor/libghostty-vt/src/config/file_load.zig | 166 +
vendor/libghostty-vt/src/config/formatter.zig | 232 +
vendor/libghostty-vt/src/config/formatter_file.zig | 110 +
vendor/libghostty-vt/src/config/io.zig | 254 +
vendor/libghostty-vt/src/config/key.zig | 57 +
vendor/libghostty-vt/src/config/path.zig | 510 +
vendor/libghostty-vt/src/config/string.zig | 146 +
.../libghostty-vt/src/config/testdata/theme_dark | 1 +
.../libghostty-vt/src/config/testdata/theme_light | 1 +
.../libghostty-vt/src/config/testdata/theme_simple | 2 +
vendor/libghostty-vt/src/config/theme.zig | 277 +
vendor/libghostty-vt/src/config/url.zig | 523 +
vendor/libghostty-vt/src/crash/dir.zig | 66 +
vendor/libghostty-vt/src/crash/main.zig | 21 +
vendor/libghostty-vt/src/crash/sentry.zig | 317 +
vendor/libghostty-vt/src/crash/sentry_envelope.zig | 597 +
.../src/datastruct/array_list_collection.zig | 44 +
.../src/datastruct/blocking_queue.zig | 248 +
.../libghostty-vt/src/datastruct/cache_table.zig | 181 +
vendor/libghostty-vt/src/datastruct/circ_buf.zig | 866 +
vendor/libghostty-vt/src/datastruct/comparison.zig | 430 +
.../src/datastruct/intrusive_linked_list.zig | 181 +
vendor/libghostty-vt/src/datastruct/lru.zig | 349 +
vendor/libghostty-vt/src/datastruct/main.zig | 24 +
.../libghostty-vt/src/datastruct/message_data.zig | 124 +
.../src/datastruct/segmented_pool.zig | 95 +
vendor/libghostty-vt/src/datastruct/split_tree.zig | 2367 ++
vendor/libghostty-vt/src/extra/bash.zig | 337 +
vendor/libghostty-vt/src/extra/fish.zig | 202 +
vendor/libghostty-vt/src/extra/sublime.zig | 50 +
vendor/libghostty-vt/src/extra/vim.zig | 121 +
vendor/libghostty-vt/src/extra/zsh.zig | 231 +
vendor/libghostty-vt/src/fastmem.zig | 78 +
vendor/libghostty-vt/src/file_type.zig | 102 +
vendor/libghostty-vt/src/font/Atlas.zig | 889 +
vendor/libghostty-vt/src/font/CodepointMap.zig | 125 +
.../libghostty-vt/src/font/CodepointResolver.zig | 562 +
vendor/libghostty-vt/src/font/Collection.zig | 1523 +
vendor/libghostty-vt/src/font/DeferredFace.zig | 463 +
vendor/libghostty-vt/src/font/Glyph.zig | 19 +
vendor/libghostty-vt/src/font/Metrics.zig | 816 +
vendor/libghostty-vt/src/font/SharedGrid.zig | 540 +
vendor/libghostty-vt/src/font/SharedGridSet.zig | 834 +
vendor/libghostty-vt/src/font/backend.zig | 118 +
vendor/libghostty-vt/src/font/discovery.zig | 1049 +
vendor/libghostty-vt/src/font/embedded.zig | 55 +
vendor/libghostty-vt/src/font/face.zig | 707 +
vendor/libghostty-vt/src/font/face/coretext.zig | 1162 +
vendor/libghostty-vt/src/font/face/freetype.zig | 1439 +
vendor/libghostty-vt/src/font/face/web_canvas.zig | 561 +
vendor/libghostty-vt/src/font/library.zig | 63 +
vendor/libghostty-vt/src/font/main.zig | 82 +
.../src/font/nerd_font_attributes.zig | 2774 ++
vendor/libghostty-vt/src/font/nerd_font_codegen.py | 576 +
.../src/font/nerd_font_codepoint_tables.py | 10449 +++++
vendor/libghostty-vt/src/font/opentype.zig | 17 +
vendor/libghostty-vt/src/font/opentype/head.zig | 179 +
vendor/libghostty-vt/src/font/opentype/hhea.zig | 116 +
vendor/libghostty-vt/src/font/opentype/os2.zig | 583 +
vendor/libghostty-vt/src/font/opentype/post.zig | 82 +
vendor/libghostty-vt/src/font/opentype/sfnt.zig | 312 +
vendor/libghostty-vt/src/font/opentype/svg.zig | 114 +
vendor/libghostty-vt/src/font/shape.zig | 101 +
vendor/libghostty-vt/src/font/shaper/Cache.zig | 106 +
vendor/libghostty-vt/src/font/shaper/coretext.zig | 2678 ++
vendor/libghostty-vt/src/font/shaper/feature.zig | 354 +
vendor/libghostty-vt/src/font/shaper/harfbuzz.zig | 2172 ++
vendor/libghostty-vt/src/font/shaper/noop.zig | 143 +
vendor/libghostty-vt/src/font/shaper/run.zig | 409 +
.../src/font/shaper/testdata/arabic.txt | 3 +
.../libghostty-vt/src/font/shaper/web_canvas.zig | 305 +
vendor/libghostty-vt/src/font/sprite.zig | 45 +
vendor/libghostty-vt/src/font/sprite/Face.zig | 550 +
vendor/libghostty-vt/src/font/sprite/canvas.zig | 512 +
.../libghostty-vt/src/font/sprite/draw/README.md | 55 +
.../libghostty-vt/src/font/sprite/draw/block.zig | 177 +
vendor/libghostty-vt/src/font/sprite/draw/box.zig | 929 +
.../libghostty-vt/src/font/sprite/draw/braille.zig | 148 +
.../libghostty-vt/src/font/sprite/draw/branch.zig | 504 +
.../libghostty-vt/src/font/sprite/draw/common.zig | 374 +
.../src/font/sprite/draw/geometric_shapes.zig | 198 +
.../libghostty-vt/src/font/sprite/draw/octants.txt | 234 +
.../src/font/sprite/draw/powerline.zig | 394 +
.../libghostty-vt/src/font/sprite/draw/special.zig | 372 +
.../sprite/draw/symbols_for_legacy_computing.zig | 1413 +
.../symbols_for_legacy_computing_supplement.zig | 633 +
.../sprite/testdata/U+1CC00...U+1CCFF-11x21+2.png | Bin 0 -> 1032 bytes
.../sprite/testdata/U+1CC00...U+1CCFF-12x24+3.png | Bin 0 -> 1295 bytes
.../sprite/testdata/U+1CC00...U+1CCFF-18x36+4.png | Bin 0 -> 2193 bytes
.../sprite/testdata/U+1CC00...U+1CCFF-9x17+1.png | Bin 0 -> 794 bytes
.../sprite/testdata/U+1CD00...U+1CDFF-11x21+2.png | Bin 0 -> 1280 bytes
.../sprite/testdata/U+1CD00...U+1CDFF-12x24+3.png | Bin 0 -> 1870 bytes
.../sprite/testdata/U+1CD00...U+1CDFF-18x36+4.png | Bin 0 -> 3411 bytes
.../sprite/testdata/U+1CD00...U+1CDFF-9x17+1.png | Bin 0 -> 1103 bytes
.../sprite/testdata/U+1CE00...U+1CEFF-11x21+2.png | Bin 0 -> 1006 bytes
.../sprite/testdata/U+1CE00...U+1CEFF-12x24+3.png | Bin 0 -> 1255 bytes
.../sprite/testdata/U+1CE00...U+1CEFF-18x36+4.png | Bin 0 -> 2247 bytes
.../sprite/testdata/U+1CE00...U+1CEFF-9x17+1.png | Bin 0 -> 751 bytes
.../sprite/testdata/U+1FB00...U+1FBFF-11x21+2.png | Bin 0 -> 5427 bytes
.../sprite/testdata/U+1FB00...U+1FBFF-12x24+3.png | Bin 0 -> 5724 bytes
.../sprite/testdata/U+1FB00...U+1FBFF-18x36+4.png | Bin 0 -> 9975 bytes
.../sprite/testdata/U+1FB00...U+1FBFF-9x17+1.png | Bin 0 -> 4341 bytes
.../sprite/testdata/U+2500...U+25FF-11x21+2.png | Bin 0 -> 2225 bytes
.../sprite/testdata/U+2500...U+25FF-12x24+3.png | Bin 0 -> 2635 bytes
.../sprite/testdata/U+2500...U+25FF-18x36+4.png | Bin 0 -> 4570 bytes
.../sprite/testdata/U+2500...U+25FF-9x17+1.png | Bin 0 -> 1853 bytes
.../sprite/testdata/U+2800...U+28FF-11x21+2.png | Bin 0 -> 1022 bytes
.../sprite/testdata/U+2800...U+28FF-12x24+3.png | Bin 0 -> 1541 bytes
.../sprite/testdata/U+2800...U+28FF-18x36+4.png | Bin 0 -> 2501 bytes
.../sprite/testdata/U+2800...U+28FF-9x17+1.png | Bin 0 -> 917 bytes
.../sprite/testdata/U+E000...U+E0FF-11x21+2.png | Bin 0 -> 1102 bytes
.../sprite/testdata/U+E000...U+E0FF-12x24+3.png | Bin 0 -> 1255 bytes
.../sprite/testdata/U+E000...U+E0FF-18x36+4.png | Bin 0 -> 2217 bytes
.../sprite/testdata/U+E000...U+E0FF-9x17+1.png | Bin 0 -> 894 bytes
.../sprite/testdata/U+F500...U+F5FF-11x21+2.png | Bin 0 -> 1114 bytes
.../sprite/testdata/U+F500...U+F5FF-12x24+3.png | Bin 0 -> 1421 bytes
.../sprite/testdata/U+F500...U+F5FF-18x36+4.png | Bin 0 -> 2473 bytes
.../sprite/testdata/U+F500...U+F5FF-9x17+1.png | Bin 0 -> 872 bytes
.../sprite/testdata/U+F600...U+F6FF-11x21+2.png | Bin 0 -> 495 bytes
.../sprite/testdata/U+F600...U+F6FF-12x24+3.png | Bin 0 -> 637 bytes
.../sprite/testdata/U+F600...U+F6FF-18x36+4.png | Bin 0 -> 1210 bytes
.../sprite/testdata/U+F600...U+F6FF-9x17+1.png | Bin 0 -> 393 bytes
vendor/libghostty-vt/src/global.zig | 235 +
vendor/libghostty-vt/src/helpgen.zig | 190 +
vendor/libghostty-vt/src/input.zig | 48 +
vendor/libghostty-vt/src/input/Binding.zig | 4847 +++
vendor/libghostty-vt/src/input/KeymapDarwin.zig | 289 +
vendor/libghostty-vt/src/input/KeymapNoop.zig | 39 +
vendor/libghostty-vt/src/input/Link.zig | 79 +
vendor/libghostty-vt/src/input/command.zig | 739 +
vendor/libghostty-vt/src/input/config.zig | 8 +
vendor/libghostty-vt/src/input/function_keys.zig | 312 +
vendor/libghostty-vt/src/input/helpgen_actions.zig | 112 +
vendor/libghostty-vt/src/input/key.zig | 878 +
vendor/libghostty-vt/src/input/key_encode.zig | 2424 ++
vendor/libghostty-vt/src/input/key_mods.zig | 914 +
vendor/libghostty-vt/src/input/keyboard.zig | 58 +
vendor/libghostty-vt/src/input/keycodes.zig | 673 +
vendor/libghostty-vt/src/input/kitty.zig | 134 +
vendor/libghostty-vt/src/input/mouse.zig | 110 +
vendor/libghostty-vt/src/input/mouse_encode.zig | 781 +
vendor/libghostty-vt/src/input/paste.zig | 228 +
vendor/libghostty-vt/src/inspector/AGENTS.md | 12 +
vendor/libghostty-vt/src/inspector/Inspector.zig | 131 +
vendor/libghostty-vt/src/inspector/main.zig | 8 +
vendor/libghostty-vt/src/inspector/units.zig | 3 +
vendor/libghostty-vt/src/inspector/widgets.zig | 227 +
vendor/libghostty-vt/src/inspector/widgets/key.zig | 535 +
.../libghostty-vt/src/inspector/widgets/page.zig | 428 +
.../src/inspector/widgets/pagelist.zig | 852 +
.../src/inspector/widgets/renderer.zig | 123 +
.../libghostty-vt/src/inspector/widgets/screen.zig | 400 +
.../libghostty-vt/src/inspector/widgets/style.zig | 125 +
.../src/inspector/widgets/surface.zig | 503 +
.../src/inspector/widgets/terminal.zig | 726 +
.../libghostty-vt/src/inspector/widgets/termio.zig | 811 +
vendor/libghostty-vt/src/lib/allocator.zig | 264 +
.../src/lib/allocator/convenience.zig | 59 +
vendor/libghostty-vt/src/lib/enum.zig | 145 +
vendor/libghostty-vt/src/lib/main.zig | 19 +
vendor/libghostty-vt/src/lib/string.zig | 15 +
vendor/libghostty-vt/src/lib/struct.zig | 105 +
vendor/libghostty-vt/src/lib/target.zig | 6 +
vendor/libghostty-vt/src/lib/types.zig | 13 +
vendor/libghostty-vt/src/lib/union.zig | 171 +
vendor/libghostty-vt/src/lib_vt.zig | 272 +
vendor/libghostty-vt/src/main.zig | 26 +
vendor/libghostty-vt/src/main_bench.zig | 3 +
vendor/libghostty-vt/src/main_build_data.zig | 51 +
vendor/libghostty-vt/src/main_c.zig | 243 +
vendor/libghostty-vt/src/main_gen.zig | 3 +
vendor/libghostty-vt/src/main_ghostty.zig | 213 +
vendor/libghostty-vt/src/main_wasm.zig | 26 +
vendor/libghostty-vt/src/math.zig | 15 +
vendor/libghostty-vt/src/os/TempDir.zig | 95 +
vendor/libghostty-vt/src/os/args.zig | 130 +
vendor/libghostty-vt/src/os/cf_release_thread.zig | 191 +
vendor/libghostty-vt/src/os/cgroup.zig | 26 +
vendor/libghostty-vt/src/os/dbus.zig | 21 +
vendor/libghostty-vt/src/os/desktop.zig | 160 +
vendor/libghostty-vt/src/os/env.zig | 178 +
vendor/libghostty-vt/src/os/file.zig | 79 +
vendor/libghostty-vt/src/os/flatpak.zig | 507 +
vendor/libghostty-vt/src/os/homedir.zig | 189 +
vendor/libghostty-vt/src/os/hostname.zig | 147 +
vendor/libghostty-vt/src/os/i18n.zig | 193 +
vendor/libghostty-vt/src/os/i18n_locales.zig | 60 +
vendor/libghostty-vt/src/os/kernel_info.zig | 27 +
vendor/libghostty-vt/src/os/locale.c | 1 +
vendor/libghostty-vt/src/os/locale.zig | 219 +
vendor/libghostty-vt/src/os/mach.zig | 150 +
vendor/libghostty-vt/src/os/macos.zig | 177 +
vendor/libghostty-vt/src/os/main.zig | 81 +
vendor/libghostty-vt/src/os/mouse.zig | 25 +
vendor/libghostty-vt/src/os/open.zig | 97 +
vendor/libghostty-vt/src/os/passwd.zig | 157 +
vendor/libghostty-vt/src/os/path.zig | 89 +
vendor/libghostty-vt/src/os/pipe.zig | 21 +
vendor/libghostty-vt/src/os/resourcesdir.zig | 139 +
vendor/libghostty-vt/src/os/shell.zig | 196 +
vendor/libghostty-vt/src/os/string_encoding.zig | 307 +
vendor/libghostty-vt/src/os/systemd.zig | 198 +
vendor/libghostty-vt/src/os/uri.zig | 204 +
vendor/libghostty-vt/src/os/wasm.zig | 25 +
vendor/libghostty-vt/src/os/wasm/log.zig | 45 +
vendor/libghostty-vt/src/os/wasm/target.zig | 20 +
vendor/libghostty-vt/src/os/windows.zig | 133 +
vendor/libghostty-vt/src/os/xdg.zig | 312 +
vendor/libghostty-vt/src/pty.c | 40 +
vendor/libghostty-vt/src/pty.zig | 506 +
vendor/libghostty-vt/src/quirks.zig | 57 +
vendor/libghostty-vt/src/renderer.zig | 66 +
vendor/libghostty-vt/src/renderer/Metal.zig | 458 +
vendor/libghostty-vt/src/renderer/OpenGL.zig | 461 +
vendor/libghostty-vt/src/renderer/Options.zig | 24 +
vendor/libghostty-vt/src/renderer/Overlay.zig | 415 +
vendor/libghostty-vt/src/renderer/State.zig | 123 +
vendor/libghostty-vt/src/renderer/Thread.zig | 715 +
vendor/libghostty-vt/src/renderer/WebGL.zig | 2 +
vendor/libghostty-vt/src/renderer/backend.zig | 23 +
vendor/libghostty-vt/src/renderer/cell.zig | 680 +
vendor/libghostty-vt/src/renderer/cursor.zig | 154 +
vendor/libghostty-vt/src/renderer/generic.zig | 3374 ++
vendor/libghostty-vt/src/renderer/image.zig | 958 +
vendor/libghostty-vt/src/renderer/link.zig | 322 +
vendor/libghostty-vt/src/renderer/message.zig | 111 +
vendor/libghostty-vt/src/renderer/metal/Frame.zig | 131 +
.../src/renderer/metal/IOSurfaceLayer.zig | 183 +
.../libghostty-vt/src/renderer/metal/Pipeline.zig | 204 +
.../src/renderer/metal/RenderPass.zig | 229 +
.../libghostty-vt/src/renderer/metal/Sampler.zig | 64 +
vendor/libghostty-vt/src/renderer/metal/Target.zig | 108 +
.../libghostty-vt/src/renderer/metal/Texture.zig | 202 +
vendor/libghostty-vt/src/renderer/metal/api.zig | 452 +
vendor/libghostty-vt/src/renderer/metal/buffer.zig | 185 +
.../libghostty-vt/src/renderer/metal/shaders.zig | 454 +
vendor/libghostty-vt/src/renderer/opengl/Frame.zig | 71 +
.../libghostty-vt/src/renderer/opengl/Pipeline.zig | 164 +
.../src/renderer/opengl/RenderPass.zig | 144 +
.../libghostty-vt/src/renderer/opengl/Sampler.zig | 45 +
.../libghostty-vt/src/renderer/opengl/Target.zig | 60 +
.../libghostty-vt/src/renderer/opengl/Texture.zig | 104 +
.../libghostty-vt/src/renderer/opengl/buffer.zig | 126 +
.../libghostty-vt/src/renderer/opengl/shaders.zig | 376 +
vendor/libghostty-vt/src/renderer/row.zig | 63 +
.../src/renderer/shaders/glsl/bg_color.f.glsl | 13 +
.../src/renderer/shaders/glsl/bg_image.f.glsl | 63 +
.../src/renderer/shaders/glsl/bg_image.v.glsl | 145 +
.../src/renderer/shaders/glsl/cell_bg.f.glsl | 61 +
.../src/renderer/shaders/glsl/cell_text.f.glsl | 100 +
.../src/renderer/shaders/glsl/cell_text.v.glsl | 146 +
.../src/renderer/shaders/glsl/common.glsl | 156 +
.../src/renderer/shaders/glsl/full_screen.v.glsl | 24 +
.../src/renderer/shaders/glsl/image.f.glsl | 21 +
.../src/renderer/shaders/glsl/image.v.glsl | 47 +
.../src/renderer/shaders/shaders.metal | 853 +
.../src/renderer/shaders/shadertoy_prefix.glsl | 52 +
.../src/renderer/shaders/test_shadertoy_crt.glsl | 59 +
.../src/renderer/shaders/test_shadertoy_focus.glsl | 41 +
.../renderer/shaders/test_shadertoy_invalid.glsl | 12 +
vendor/libghostty-vt/src/renderer/shadertoy.zig | 427 +
vendor/libghostty-vt/src/renderer/size.zig | 458 +
.../libghostty-vt/src/shell-integration/README.md | 117 +
.../src/shell-integration/bash/bash-preexec.sh | 382 +
.../src/shell-integration/bash/ghostty.bash | 324 +
.../elvish/lib/ghostty-integration.elv | 190 +
.../vendor_conf.d/ghostty-shell-integration.fish | 245 +
.../nushell/vendor/autoload/ghostty.nu | 110 +
.../src/shell-integration/zsh/.zshenv | 61 +
.../src/shell-integration/zsh/ghostty-integration | 454 +
vendor/libghostty-vt/src/simd/base64.cpp | 20 +
vendor/libghostty-vt/src/simd/base64.zig | 87 +
vendor/libghostty-vt/src/simd/base64_scalar.zig | 147 +
vendor/libghostty-vt/src/simd/codepoint_width.cpp | 488 +
vendor/libghostty-vt/src/simd/codepoint_width.zig | 52 +
vendor/libghostty-vt/src/simd/index_of.cpp | 53 +
vendor/libghostty-vt/src/simd/index_of.h | 98 +
vendor/libghostty-vt/src/simd/index_of.zig | 35 +
vendor/libghostty-vt/src/simd/main.zig | 14 +
vendor/libghostty-vt/src/simd/vt.cpp | 169 +
vendor/libghostty-vt/src/simd/vt.h | 30 +
vendor/libghostty-vt/src/simd/vt.zig | 196 +
vendor/libghostty-vt/src/stb/main.zig | 10 +
vendor/libghostty-vt/src/stb/stb.c | 13 +
vendor/libghostty-vt/src/stb/stb_image.h | 7987 ++++
vendor/libghostty-vt/src/stb/stb_image_resize.h | 2634 ++
vendor/libghostty-vt/src/surface_mouse.zig | 336 +
vendor/libghostty-vt/src/synthetic/Bytes.zig | 119 +
vendor/libghostty-vt/src/synthetic/Generator.zig | 42 +
vendor/libghostty-vt/src/synthetic/Osc.zig | 366 +
vendor/libghostty-vt/src/synthetic/Utf8.zig | 108 +
vendor/libghostty-vt/src/synthetic/cli.zig | 115 +
vendor/libghostty-vt/src/synthetic/cli/Ascii.zig | 68 +
vendor/libghostty-vt/src/synthetic/cli/Osc.zig | 82 +
vendor/libghostty-vt/src/synthetic/cli/Utf8.zig | 58 +
vendor/libghostty-vt/src/synthetic/main.zig | 25 +
vendor/libghostty-vt/src/terminal/PageList.zig | 14645 +++++++
vendor/libghostty-vt/src/terminal/Parser.zig | 1099 +
vendor/libghostty-vt/src/terminal/Screen.zig | 10354 +++++
vendor/libghostty-vt/src/terminal/ScreenSet.zig | 107 +
vendor/libghostty-vt/src/terminal/Selection.zig | 1598 +
vendor/libghostty-vt/src/terminal/StringMap.zig | 298 +
vendor/libghostty-vt/src/terminal/Tabstops.zig | 271 +
vendor/libghostty-vt/src/terminal/Terminal.zig | 13089 +++++++
vendor/libghostty-vt/src/terminal/UTF8Decoder.zig | 142 +
vendor/libghostty-vt/src/terminal/ansi.zig | 106 +
vendor/libghostty-vt/src/terminal/apc.zig | 186 +
.../src/terminal/bitmap_allocator.zig | 1021 +
.../libghostty-vt/src/terminal/build_options.zig | 80 +
vendor/libghostty-vt/src/terminal/c/AGENTS.md | 22 +
vendor/libghostty-vt/src/terminal/c/allocator.zig | 67 +
vendor/libghostty-vt/src/terminal/c/build_info.zig | 162 +
vendor/libghostty-vt/src/terminal/c/cell.zig | 178 +
vendor/libghostty-vt/src/terminal/c/color.zig | 13 +
vendor/libghostty-vt/src/terminal/c/focus.zig | 55 +
vendor/libghostty-vt/src/terminal/c/formatter.zig | 417 +
vendor/libghostty-vt/src/terminal/c/grid_ref.zig | 156 +
vendor/libghostty-vt/src/terminal/c/key_encode.zig | 356 +
vendor/libghostty-vt/src/terminal/c/key_event.zig | 268 +
vendor/libghostty-vt/src/terminal/c/main.zig | 178 +
vendor/libghostty-vt/src/terminal/c/modes.zig | 104 +
.../libghostty-vt/src/terminal/c/mouse_encode.zig | 530 +
.../libghostty-vt/src/terminal/c/mouse_event.zig | 155 +
vendor/libghostty-vt/src/terminal/c/osc.zig | 140 +
vendor/libghostty-vt/src/terminal/c/paste.zig | 129 +
vendor/libghostty-vt/src/terminal/c/render.zig | 1382 +
vendor/libghostty-vt/src/terminal/c/result.zig | 8 +
vendor/libghostty-vt/src/terminal/c/row.zig | 132 +
vendor/libghostty-vt/src/terminal/c/sgr.zig | 179 +
.../libghostty-vt/src/terminal/c/size_report.zig | 82 +
vendor/libghostty-vt/src/terminal/c/style.zig | 134 +
vendor/libghostty-vt/src/terminal/c/terminal.zig | 2358 ++
vendor/libghostty-vt/src/terminal/c/types.zig | 215 +
vendor/libghostty-vt/src/terminal/charsets.zig | 115 +
vendor/libghostty-vt/src/terminal/color.zig | 1146 +
vendor/libghostty-vt/src/terminal/csi.zig | 55 +
vendor/libghostty-vt/src/terminal/cursor.zig | 15 +
vendor/libghostty-vt/src/terminal/dcs.zig | 430 +
.../src/terminal/device_attributes.zig | 227 +
.../libghostty-vt/src/terminal/device_status.zig | 74 +
vendor/libghostty-vt/src/terminal/focus.zig | 39 +
vendor/libghostty-vt/src/terminal/formatter.zig | 6279 +++
vendor/libghostty-vt/src/terminal/hash_map.zig | 1540 +
vendor/libghostty-vt/src/terminal/highlight.zig | 213 +
vendor/libghostty-vt/src/terminal/hyperlink.zig | 240 +
vendor/libghostty-vt/src/terminal/kitty.zig | 15 +
vendor/libghostty-vt/src/terminal/kitty/color.zig | 77 +
.../libghostty-vt/src/terminal/kitty/graphics.zig | 36 +
.../src/terminal/kitty/graphics_command.zig | 1325 +
.../src/terminal/kitty/graphics_exec.zig | 570 +
.../src/terminal/kitty/graphics_image.zig | 835 +
.../src/terminal/kitty/graphics_render.zig | 27 +
.../src/terminal/kitty/graphics_storage.zig | 1359 +
.../src/terminal/kitty/graphics_unicode.zig | 1347 +
vendor/libghostty-vt/src/terminal/kitty/key.zig | 169 +
.../src/terminal/kitty/testdata/dog.png | Bin 0 -> 237387 bytes
.../image-png-none-50x76-2147483647-raw.data | Bin 0 -> 86 bytes
.../image-rgb-none-20x15-2147483647-raw.data | Bin 0 -> 900 bytes
...age-rgb-zlib_deflate-128x96-2147483647-raw.data | Bin 0 -> 30455 bytes
vendor/libghostty-vt/src/terminal/lib.zig | 22 +
vendor/libghostty-vt/src/terminal/main.zig | 87 +
vendor/libghostty-vt/src/terminal/modes.zig | 381 +
vendor/libghostty-vt/src/terminal/mouse.zig | 168 +
vendor/libghostty-vt/src/terminal/osc.zig | 826 +
vendor/libghostty-vt/src/terminal/osc/encoding.zig | 38 +
vendor/libghostty-vt/src/terminal/osc/parsers.zig | 21 +
.../terminal/osc/parsers/change_window_icon.zig | 33 +
.../terminal/osc/parsers/change_window_title.zig | 119 +
.../terminal/osc/parsers/clipboard_operation.zig | 106 +
.../src/terminal/osc/parsers/color.zig | 780 +
.../src/terminal/osc/parsers/context_signal.zig | 541 +
.../src/terminal/osc/parsers/hyperlink.zig | 164 +
.../src/terminal/osc/parsers/iterm2.zig | 435 +
.../osc/parsers/kitty_clipboard_protocol.zig | 702 +
.../src/terminal/osc/parsers/kitty_color.zig | 212 +
.../src/terminal/osc/parsers/kitty_text_sizing.zig | 255 +
.../src/terminal/osc/parsers/mouse_shape.zig | 39 +
.../src/terminal/osc/parsers/osc9.zig | 1141 +
.../src/terminal/osc/parsers/report_pwd.zig | 48 +
.../src/terminal/osc/parsers/rxvt_extension.zig | 59 +
.../src/terminal/osc/parsers/semantic_prompt.zig | 1264 +
vendor/libghostty-vt/src/terminal/page.zig | 3918 ++
vendor/libghostty-vt/src/terminal/parse_table.zig | 388 +
vendor/libghostty-vt/src/terminal/point.zig | 94 +
.../libghostty-vt/src/terminal/ref_counted_set.zig | 714 +
vendor/libghostty-vt/src/terminal/render.zig | 1465 +
vendor/libghostty-vt/src/terminal/res/glitch.txt | 1 +
vendor/libghostty-vt/src/terminal/res/rgb.txt | 782 +
vendor/libghostty-vt/src/terminal/search.zig | 22 +
.../libghostty-vt/src/terminal/search/Thread.zig | 905 +
.../libghostty-vt/src/terminal/search/active.zig | 175 +
.../libghostty-vt/src/terminal/search/pagelist.zig | 441 +
.../libghostty-vt/src/terminal/search/screen.zig | 1552 +
.../src/terminal/search/sliding_window.zig | 1676 +
.../libghostty-vt/src/terminal/search/viewport.zig | 384 +
vendor/libghostty-vt/src/terminal/sgr.zig | 1103 +
vendor/libghostty-vt/src/terminal/size.zig | 227 +
vendor/libghostty-vt/src/terminal/size_report.zig | 160 +
vendor/libghostty-vt/src/terminal/stream.zig | 3449 ++
.../libghostty-vt/src/terminal/stream_terminal.zig | 2071 +
vendor/libghostty-vt/src/terminal/style.zig | 1078 +
vendor/libghostty-vt/src/terminal/tmux.zig | 13 +
vendor/libghostty-vt/src/terminal/tmux/control.zig | 839 +
vendor/libghostty-vt/src/terminal/tmux/layout.zig | 638 +
vendor/libghostty-vt/src/terminal/tmux/output.zig | 590 +
vendor/libghostty-vt/src/terminal/tmux/viewer.zig | 2283 ++
vendor/libghostty-vt/src/terminal/x11_color.zig | 69 +
vendor/libghostty-vt/src/terminfo/Source.zig | 243 +
vendor/libghostty-vt/src/terminfo/ghostty.zig | 397 +
vendor/libghostty-vt/src/terminfo/main.zig | 13 +
vendor/libghostty-vt/src/termio.zig | 39 +
vendor/libghostty-vt/src/termio/Exec.zig | 1761 +
vendor/libghostty-vt/src/termio/Options.zig | 41 +
vendor/libghostty-vt/src/termio/Termio.zig | 773 +
vendor/libghostty-vt/src/termio/Thread.zig | 531 +
vendor/libghostty-vt/src/termio/backend.zig | 129 +
vendor/libghostty-vt/src/termio/mailbox.zig | 106 +
vendor/libghostty-vt/src/termio/message.zig | 108 +
.../libghostty-vt/src/termio/shell_integration.zig | 1032 +
vendor/libghostty-vt/src/termio/stream_handler.zig | 1556 +
vendor/libghostty-vt/src/tripwire.zig | 288 +
vendor/libghostty-vt/src/unicode/grapheme.zig | 180 +
vendor/libghostty-vt/src/unicode/lut.zig | 188 +
vendor/libghostty-vt/src/unicode/main.zig | 10 +
vendor/libghostty-vt/src/unicode/props.zig | 53 +
vendor/libghostty-vt/src/unicode/props_table.zig | 18 +
vendor/libghostty-vt/src/unicode/props_uucode.zig | 85 +
vendor/libghostty-vt/src/unicode/symbols_table.zig | 17 +
.../libghostty-vt/src/unicode/symbols_uucode.zig | 68 +
vendor/libghostty-vt/test_align | 0
vendor/libghostty-vt/typos.toml | 85 +
vendor/libghostty-vt/valgrind.supp | 2441 ++
1202 files changed, 365783 insertions(+), 195 deletions(-)
create mode 100644 build.rs
create mode 100755 scripts/build_vendored_libghostty_vt.sh
create mode 100644 scripts/test_vendor_libghostty_vt.py
create mode 100644 scripts/vendor_libghostty_vt.py
create mode 100644 src/ghostty/bindings.rs
create mode 100644 src/ghostty/mod.rs
create mode 100644 vendor/libghostty-vt.vendor.json
create mode 100755 vendor/libghostty-vt/.agents/commands/review-branch
create mode 100644 vendor/libghostty-vt/.agents/skills/writing-commit-messages/SKILL.md
create mode 100644 vendor/libghostty-vt/.clang-format
create mode 100644 vendor/libghostty-vt/.editorconfig
create mode 100644 vendor/libghostty-vt/.envrc
create mode 100644 vendor/libghostty-vt/.gitattributes
create mode 100644 vendor/libghostty-vt/.github/DISCUSSION_TEMPLATE/issue-triage.yml
create mode 100644 vendor/libghostty-vt/.github/DISCUSSION_TEMPLATE/vouch-request.yml
create mode 100644 vendor/libghostty-vt/.github/ISSUE_TEMPLATE/config.yml
create mode 100644 vendor/libghostty-vt/.github/ISSUE_TEMPLATE/preapproved.md
create mode 100644 vendor/libghostty-vt/.github/VOUCHED.td
create mode 100644 vendor/libghostty-vt/.github/dependabot.yml
create mode 100644 vendor/libghostty-vt/.github/pinact.yml
create mode 100755 vendor/libghostty-vt/.github/scripts/check-translations.sh
create mode 100755 vendor/libghostty-vt/.github/scripts/ghostty-tip
create mode 100644 vendor/libghostty-vt/.github/workflows/clean-artifacts.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/flatpak.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/milestone.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/nix.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/publish-tag.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/release-tag.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/release-tip.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/snap.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/test.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/update-colorschemes.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/vouch-check-issue.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/vouch-check-pr.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/vouch-manage-by-discussion.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/vouch-manage-by-issue.yml
create mode 100644 vendor/libghostty-vt/.github/workflows/vouch-sync-codeowners.yml
create mode 100644 vendor/libghostty-vt/.gitignore
create mode 100644 vendor/libghostty-vt/.gitmodules
create mode 100644 vendor/libghostty-vt/.mailmap
create mode 100644 vendor/libghostty-vt/.prettierignore
create mode 100644 vendor/libghostty-vt/.shellcheckrc
create mode 100644 vendor/libghostty-vt/.swiftlint.yml
create mode 100644 vendor/libghostty-vt/AGENTS.md
create mode 100644 vendor/libghostty-vt/AI_POLICY.md
create mode 100644 vendor/libghostty-vt/CMakeLists.txt
create mode 100644 vendor/libghostty-vt/CODEOWNERS
create mode 100644 vendor/libghostty-vt/CONTRIBUTING.md
create mode 100644 vendor/libghostty-vt/Doxyfile
create mode 100644 vendor/libghostty-vt/DoxygenLayout.xml
create mode 100644 vendor/libghostty-vt/HACKING.md
create mode 100644 vendor/libghostty-vt/LICENSE
create mode 100644 vendor/libghostty-vt/Makefile
create mode 100644 vendor/libghostty-vt/PACKAGING.md
create mode 100644 vendor/libghostty-vt/README.md
create mode 100644 vendor/libghostty-vt/VERSION
create mode 100644 vendor/libghostty-vt/build.zig
create mode 100644 vendor/libghostty-vt/build.zig.zon
create mode 100644 vendor/libghostty-vt/build.zig.zon.json
create mode 100644 vendor/libghostty-vt/build.zig.zon.nix
create mode 100644 vendor/libghostty-vt/build.zig.zon.txt
create mode 100644 vendor/libghostty-vt/default.nix
create mode 100644 vendor/libghostty-vt/dist/cmake/README.md
create mode 100644 vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in
create mode 100644 vendor/libghostty-vt/flake.lock
create mode 100644 vendor/libghostty-vt/flake.nix
create mode 100644 vendor/libghostty-vt/include/ghostty.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/allocator.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/build_info.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/color.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/device.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/focus.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/formatter.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/grid_ref.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/key.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/key/encoder.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/key/event.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/modes.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/mouse.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/mouse/encoder.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/mouse/event.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/osc.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/paste.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/point.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/render.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/screen.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/sgr.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/size_report.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/style.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/terminal.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/types.h
create mode 100644 vendor/libghostty-vt/include/ghostty/vt/wasm.h
create mode 100644 vendor/libghostty-vt/include/module.modulemap
create mode 100644 vendor/libghostty-vt/nix/build-support/build-inputs.nix
create mode 100755 vendor/libghostty-vt/nix/build-support/check-blueprints.sh
create mode 100755 vendor/libghostty-vt/nix/build-support/check-zig-cache.sh
create mode 100755 vendor/libghostty-vt/nix/build-support/fetch-zig-cache.sh
create mode 100644 vendor/libghostty-vt/nix/build-support/gi-typelib-path.nix
create mode 100644 vendor/libghostty-vt/nix/build-support/ld-library-path.nix
create mode 100755 vendor/libghostty-vt/nix/build-support/update-mirror.nu
create mode 100644 vendor/libghostty-vt/nix/devShell.nix
create mode 100644 vendor/libghostty-vt/nix/libghostty-vt.nix
create mode 100644 vendor/libghostty-vt/nix/package.nix
create mode 100644 vendor/libghostty-vt/nix/pkgs/blessed.nix
create mode 100644 vendor/libghostty-vt/nix/pkgs/ucs-detect.nix
create mode 100644 vendor/libghostty-vt/nix/pkgs/wcwidth.nix
create mode 100644 vendor/libghostty-vt/nix/pkgs/wraptest.nix
create mode 100644 vendor/libghostty-vt/nix/tests.nix
create mode 100644 vendor/libghostty-vt/nix/vm/common-cinnamon.nix
create mode 100644 vendor/libghostty-vt/nix/vm/common-gnome.nix
create mode 100644 vendor/libghostty-vt/nix/vm/common-plasma6.nix
create mode 100644 vendor/libghostty-vt/nix/vm/common-xfce.nix
create mode 100644 vendor/libghostty-vt/nix/vm/common.nix
create mode 100644 vendor/libghostty-vt/nix/vm/create-cinnamon.nix
create mode 100644 vendor/libghostty-vt/nix/vm/create-gnome.nix
create mode 100644 vendor/libghostty-vt/nix/vm/create-plasma6.nix
create mode 100644 vendor/libghostty-vt/nix/vm/create-xfce.nix
create mode 100644 vendor/libghostty-vt/nix/vm/create.nix
create mode 100644 vendor/libghostty-vt/nix/vm/wayland-cinnamon.nix
create mode 100644 vendor/libghostty-vt/nix/vm/wayland-gnome.nix
create mode 100644 vendor/libghostty-vt/nix/vm/wayland-plasma6.nix
create mode 100644 vendor/libghostty-vt/nix/vm/x11-cinnamon.nix
create mode 100644 vendor/libghostty-vt/nix/vm/x11-plasma6.nix
create mode 100644 vendor/libghostty-vt/nix/vm/x11-xfce.nix
create mode 100644 vendor/libghostty-vt/nix/zigCacheHash.nix
create mode 100644 vendor/libghostty-vt/pkg/README.md
create mode 100644 vendor/libghostty-vt/pkg/afl++/LICENSE
create mode 100644 vendor/libghostty-vt/pkg/afl++/afl.c
create mode 100644 vendor/libghostty-vt/pkg/afl++/build.zig
create mode 100644 vendor/libghostty-vt/pkg/afl++/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/android-ndk/build.zig
create mode 100644 vendor/libghostty-vt/pkg/android-ndk/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/apple-sdk/build.zig
create mode 100644 vendor/libghostty-vt/pkg/apple-sdk/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/breakpad/build.zig
create mode 100644 vendor/libghostty-vt/pkg/breakpad/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/dcimgui/build.zig
create mode 100644 vendor/libghostty-vt/pkg/dcimgui/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/dcimgui/ext.cpp
create mode 100644 vendor/libghostty-vt/pkg/dcimgui/main.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/build.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/c.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/char_set.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/common.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/config.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/error.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/font_set.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/init.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/lang_set.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/main.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/matrix.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/object_set.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/override/include/fcalias.h
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/override/include/fcaliastail.h
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/override/include/fcftalias.h
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/override/include/fcftaliastail.h
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/override/include/fcobjshash.h
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/pattern.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/range.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/test.zig
create mode 100644 vendor/libghostty-vt/pkg/fontconfig/value.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/Library.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/build.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/freetype/c.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/computations.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/errors.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/face.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/freetype-zig.h
create mode 100644 vendor/libghostty-vt/pkg/freetype/main.zig
create mode 100755 vendor/libghostty-vt/pkg/freetype/res/FiraCode-Regular.ttf
create mode 100644 vendor/libghostty-vt/pkg/freetype/tag.zig
create mode 100644 vendor/libghostty-vt/pkg/freetype/test.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/build.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/glslang/c.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/init.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/main.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/override/glslang/build_info.h
create mode 100644 vendor/libghostty-vt/pkg/glslang/program.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/shader.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/test.zig
create mode 100644 vendor/libghostty-vt/pkg/glslang/test/simple.frag
create mode 100644 vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig
create mode 100644 vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/gtk4-layer-shell/src/main.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/blob.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/buffer.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/build.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/c.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/common.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/coretext.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/errors.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/face.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/font.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/freetype.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/main.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/shape.zig
create mode 100644 vendor/libghostty-vt/pkg/harfbuzz/version.zig
create mode 100644 vendor/libghostty-vt/pkg/highway/bridge.cpp
create mode 100644 vendor/libghostty-vt/pkg/highway/build.zig
create mode 100644 vendor/libghostty-vt/pkg/highway/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/highway/main.zig
create mode 100644 vendor/libghostty-vt/pkg/libintl/build.zig
create mode 100644 vendor/libghostty-vt/pkg/libintl/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/libintl/config.h
create mode 100644 vendor/libghostty-vt/pkg/libintl/libgnuintl.h
create mode 100644 vendor/libghostty-vt/pkg/libintl/libintl.h
create mode 100644 vendor/libghostty-vt/pkg/libpng/build.zig
create mode 100644 vendor/libghostty-vt/pkg/libpng/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/libpng/pnglibconf.h
create mode 100644 vendor/libghostty-vt/pkg/libxml2/build.zig
create mode 100644 vendor/libghostty-vt/pkg/libxml2/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/libxml2/override/config/posix/config.h
create mode 100644 vendor/libghostty-vt/pkg/libxml2/override/config/win32/config.h
create mode 100644 vendor/libghostty-vt/pkg/libxml2/override/include/libxml/xmlversion.h
create mode 100644 vendor/libghostty-vt/pkg/macos/animation.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/animation/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/build.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/macos/carbon.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/carbon/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/dispatch.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/dispatch/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/dispatch/data.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/dispatch/queue.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/array.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/attributed_string.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/base.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/character_set.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/data.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/dictionary.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/number.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/string.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/type.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/foundation/url.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/affine_transform.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/bitmap_context.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/color_space.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/context.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/font.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/geometry.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/image.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/graphics/path.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/iosurface.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/iosurface/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/iosurface/iosurface.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/main.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/os.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/os/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/os/log.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/os/signpost.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/os/zig_macos.c
create mode 100644 vendor/libghostty-vt/pkg/macos/text.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/ext.c
create mode 100644 vendor/libghostty-vt/pkg/macos/text/font.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/font_collection.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/font_descriptor.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/font_manager.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/frame.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/framesetter.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/line.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/paragraph_style.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/run.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/stylized_strings.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/text/typesetter.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/video.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/video/c.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/video/display_link.zig
create mode 100644 vendor/libghostty-vt/pkg/macos/video/pixel_format.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/build.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/c.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/errors.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/init.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/main.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/match_param.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/regex.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/region.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/testing.zig
create mode 100644 vendor/libghostty-vt/pkg/oniguruma/types.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/Buffer.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/Framebuffer.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/Program.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/Renderbuffer.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/Sampler.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/Shader.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/Texture.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/VertexArray.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/build.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/c.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/draw.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/errors.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/extensions.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/glad.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/main.zig
create mode 100644 vendor/libghostty-vt/pkg/opengl/primitives.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/build.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/sentry/c.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/envelope.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/level.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/main.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/transport.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/uuid.zig
create mode 100644 vendor/libghostty-vt/pkg/sentry/value.zig
create mode 100644 vendor/libghostty-vt/pkg/simdutf/build.zig
create mode 100644 vendor/libghostty-vt/pkg/simdutf/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/simdutf/vendor/simdutf.cpp
create mode 100644 vendor/libghostty-vt/pkg/simdutf/vendor/simdutf.h
create mode 100644 vendor/libghostty-vt/pkg/spirv-cross/build.zig
create mode 100644 vendor/libghostty-vt/pkg/spirv-cross/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/spirv-cross/c.zig
create mode 100644 vendor/libghostty-vt/pkg/spirv-cross/main.zig
create mode 100644 vendor/libghostty-vt/pkg/utfcpp/build.zig
create mode 100644 vendor/libghostty-vt/pkg/utfcpp/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/utfcpp/empty.cc
create mode 100644 vendor/libghostty-vt/pkg/wuffs/build.zig
create mode 100644 vendor/libghostty-vt/pkg/wuffs/build.zig.zon
create mode 100644 vendor/libghostty-vt/pkg/wuffs/src/c.zig
create mode 100644 vendor/libghostty-vt/pkg/wuffs/src/error.zig
create mode 100644 vendor/libghostty-vt/pkg/wuffs/src/jpeg.zig
create mode 100644 vendor/libghostty-vt/pkg/wuffs/src/main.zig
create mode 100644 vendor/libghostty-vt/pkg/wuffs/src/png.zig
create mode 100644 vendor/libghostty-vt/pkg/wuffs/src/swizzle.zig
create mode 100644 vendor/libghostty-vt/pkg/zlib/build.zig
create mode 100644 vendor/libghostty-vt/pkg/zlib/build.zig.zon
create mode 100644 vendor/libghostty-vt/shell.nix
create mode 100644 vendor/libghostty-vt/src/App.zig
create mode 100644 vendor/libghostty-vt/src/Command.zig
create mode 100644 vendor/libghostty-vt/src/Surface.zig
create mode 100644 vendor/libghostty-vt/src/apprt.zig
create mode 100644 vendor/libghostty-vt/src/apprt/action.zig
create mode 100644 vendor/libghostty-vt/src/apprt/browser.zig
create mode 100644 vendor/libghostty-vt/src/apprt/embedded.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/App.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/Surface.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/adw_version.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/build/blueprint.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/build/gresource.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/build/info.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/cgroup.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/application.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/clipboard_confirmation_dialog.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/close_confirmation_dialog.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/command_palette.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/config.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/config_errors_dialog.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/debug_warning.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/dialog.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/global_shortcuts.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/imgui_widget.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/inspector_widget.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/inspector_window.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/key_state_overlay.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/resize_overlay.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/search_overlay.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/split_tree.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/surface.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/surface_child_exited.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/surface_scrolled_window.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/tab.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/title_dialog.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/class/window.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/css/style-dark.css
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/css/style-hc-dark.css
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/css/style-hc.css
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/css/style.css
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ext.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ext/actions.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ext/slice.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/flatpak.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/gsettings.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/gtk_version.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ipc/DBus.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ipc/new_window.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/key.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/media.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/portal.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/portal/OpenURI.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/post_fork.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/pre_exec.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.0/clipboard-confirmation-dialog.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.2/close-confirmation-dialog.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.2/config-errors-dialog.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.2/debug-warning.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.2/key-state-overlay.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.2/resize-overlay.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.2/search-overlay.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.2/surface.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.3/debug-warning.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.3/surface-child-exited.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.4/clipboard-confirmation-dialog.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/command-palette.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/imgui-widget.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/inspector-widget.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/inspector-window.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/split-tree-split.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/split-tree.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/surface-scrolled-window.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/tab.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/title-dialog.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/ui/1.5/window.blp
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/weak_ref.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/winproto.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/winproto/BlurRegion.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/winproto/noop.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/winproto/wayland.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/winproto/wayland/Globals.zig
create mode 100644 vendor/libghostty-vt/src/apprt/gtk/winproto/x11.zig
create mode 100644 vendor/libghostty-vt/src/apprt/ipc.zig
create mode 100644 vendor/libghostty-vt/src/apprt/none.zig
create mode 100644 vendor/libghostty-vt/src/apprt/runtime.zig
create mode 100644 vendor/libghostty-vt/src/apprt/structs.zig
create mode 100644 vendor/libghostty-vt/src/apprt/surface.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/Benchmark.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/CApi.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/CodepointWidth.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/GraphemeBreak.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/IsSymbol.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/OscParser.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/ScreenClone.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/TerminalParser.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/TerminalStream.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/cli.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/main.zig
create mode 100644 vendor/libghostty-vt/src/benchmark/options.zig
create mode 100644 vendor/libghostty-vt/src/build/Config.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyBench.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyDist.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyDocs.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyExe.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyFrameData.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyI18n.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyLib.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyLibVt.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyResources.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyWebdata.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyXCFramework.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyXcodebuild.zig
create mode 100644 vendor/libghostty-vt/src/build/GhosttyZig.zig
create mode 100644 vendor/libghostty-vt/src/build/GitVersion.zig
create mode 100644 vendor/libghostty-vt/src/build/HelpStrings.zig
create mode 100644 vendor/libghostty-vt/src/build/LibtoolStep.zig
create mode 100644 vendor/libghostty-vt/src/build/LipoStep.zig
create mode 100644 vendor/libghostty-vt/src/build/MetallibStep.zig
create mode 100644 vendor/libghostty-vt/src/build/SharedDeps.zig
create mode 100644 vendor/libghostty-vt/src/build/UnicodeTables.zig
create mode 100644 vendor/libghostty-vt/src/build/XCFrameworkStep.zig
create mode 100644 vendor/libghostty-vt/src/build/docker/debian/Dockerfile
create mode 100644 vendor/libghostty-vt/src/build/docker/lib-c-docs/Dockerfile
create mode 100755 vendor/libghostty-vt/src/build/docker/lib-c-docs/entrypoint.sh
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_001.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_002.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_003.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_004.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_005.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_006.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_007.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_008.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_009.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_010.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_011.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_012.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_013.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_014.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_015.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_016.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_017.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_018.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_019.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_020.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_021.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_022.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_023.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_024.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_025.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_026.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_027.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_028.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_029.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_030.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_031.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_032.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_033.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_034.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_035.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_036.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_037.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_038.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_039.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_040.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_041.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_042.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_043.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_044.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_045.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_046.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_047.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_048.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_049.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_050.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_051.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_052.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_053.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_054.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_055.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_056.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_057.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_058.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_059.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_060.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_061.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_062.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_063.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_064.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_065.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_066.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_067.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_068.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_069.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_070.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_071.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_072.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_073.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_074.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_075.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_076.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_077.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_078.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_079.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_080.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_081.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_082.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_083.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_084.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_085.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_086.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_087.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_088.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_089.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_090.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_091.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_092.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_093.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_094.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_095.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_096.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_097.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_098.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_099.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_100.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_101.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_102.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_103.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_104.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_105.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_106.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_107.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_108.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_109.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_110.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_111.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_112.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_113.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_114.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_115.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_116.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_117.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_118.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_119.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_120.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_121.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_122.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_123.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_124.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_125.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_126.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_127.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_128.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_129.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_130.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_131.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_132.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_133.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_134.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_135.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_136.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_137.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_138.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_139.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_140.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_141.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_142.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_143.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_144.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_145.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_146.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_147.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_148.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_149.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_150.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_151.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_152.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_153.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_154.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_155.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_156.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_157.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_158.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_159.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_160.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_161.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_162.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_163.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_164.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_165.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_166.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_167.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_168.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_169.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_170.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_171.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_172.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_173.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_174.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_175.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_176.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_177.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_178.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_179.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_180.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_181.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_182.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_183.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_184.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_185.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_186.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_187.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_188.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_189.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_190.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_191.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_192.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_193.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_194.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_195.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_196.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_197.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_198.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_199.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_200.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_201.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_202.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_203.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_204.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_205.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_206.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_207.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_208.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_209.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_210.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_211.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_212.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_213.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_214.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_215.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_216.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_217.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_218.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_219.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_220.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_221.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_222.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_223.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_224.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_225.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_226.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_227.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_228.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_229.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_230.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_231.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_232.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_233.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_234.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/frames/frame_235.txt
create mode 100644 vendor/libghostty-vt/src/build/framegen/main.c
create mode 100644 vendor/libghostty-vt/src/build/gtk.zig
create mode 100644 vendor/libghostty-vt/src/build/main.zig
create mode 100644 vendor/libghostty-vt/src/build/mdgen/ghostty_1_footer.md
create mode 100644 vendor/libghostty-vt/src/build/mdgen/ghostty_1_header.md
create mode 100644 vendor/libghostty-vt/src/build/mdgen/ghostty_5_footer.md
create mode 100644 vendor/libghostty-vt/src/build/mdgen/ghostty_5_header.md
create mode 100644 vendor/libghostty-vt/src/build/mdgen/main_ghostty_1.zig
create mode 100644 vendor/libghostty-vt/src/build/mdgen/main_ghostty_5.zig
create mode 100644 vendor/libghostty-vt/src/build/mdgen/mdgen.zig
create mode 100644 vendor/libghostty-vt/src/build/uucode_config.zig
create mode 100644 vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig
create mode 100644 vendor/libghostty-vt/src/build/webgen/main_actions.zig
create mode 100644 vendor/libghostty-vt/src/build/webgen/main_commands.zig
create mode 100644 vendor/libghostty-vt/src/build/webgen/main_config.zig
create mode 100644 vendor/libghostty-vt/src/build/xcframework.zig
create mode 100644 vendor/libghostty-vt/src/build/zig.zig
create mode 100644 vendor/libghostty-vt/src/build_config.zig
create mode 100644 vendor/libghostty-vt/src/cli.zig
create mode 100644 vendor/libghostty-vt/src/cli/CommaSplitter.zig
create mode 100644 vendor/libghostty-vt/src/cli/Pager.zig
create mode 100644 vendor/libghostty-vt/src/cli/README.md
create mode 100644 vendor/libghostty-vt/src/cli/action.zig
create mode 100644 vendor/libghostty-vt/src/cli/args.zig
create mode 100644 vendor/libghostty-vt/src/cli/boo.zig
create mode 100644 vendor/libghostty-vt/src/cli/crash_report.zig
create mode 100644 vendor/libghostty-vt/src/cli/diagnostics.zig
create mode 100644 vendor/libghostty-vt/src/cli/edit_config.zig
create mode 100644 vendor/libghostty-vt/src/cli/explain_config.zig
create mode 100644 vendor/libghostty-vt/src/cli/ghostty.zig
create mode 100644 vendor/libghostty-vt/src/cli/help.zig
create mode 100644 vendor/libghostty-vt/src/cli/list_actions.zig
create mode 100644 vendor/libghostty-vt/src/cli/list_colors.zig
create mode 100644 vendor/libghostty-vt/src/cli/list_fonts.zig
create mode 100644 vendor/libghostty-vt/src/cli/list_keybinds.zig
create mode 100644 vendor/libghostty-vt/src/cli/list_themes.zig
create mode 100644 vendor/libghostty-vt/src/cli/lorem_ipsum.txt
create mode 100644 vendor/libghostty-vt/src/cli/new_window.zig
create mode 100644 vendor/libghostty-vt/src/cli/show_config.zig
create mode 100644 vendor/libghostty-vt/src/cli/show_face.zig
create mode 100644 vendor/libghostty-vt/src/cli/ssh-cache/DiskCache.zig
create mode 100644 vendor/libghostty-vt/src/cli/ssh-cache/Entry.zig
create mode 100644 vendor/libghostty-vt/src/cli/ssh_cache.zig
create mode 100644 vendor/libghostty-vt/src/cli/tui.zig
create mode 100644 vendor/libghostty-vt/src/cli/validate_config.zig
create mode 100644 vendor/libghostty-vt/src/cli/version.zig
create mode 100644 vendor/libghostty-vt/src/config.zig
create mode 100644 vendor/libghostty-vt/src/config/CApi.zig
create mode 100644 vendor/libghostty-vt/src/config/ClipboardCodepointMap.zig
create mode 100644 vendor/libghostty-vt/src/config/Config.zig
create mode 100644 vendor/libghostty-vt/src/config/ErrorList.zig
create mode 100644 vendor/libghostty-vt/src/config/RepeatableStringMap.zig
create mode 100644 vendor/libghostty-vt/src/config/Wasm.zig
create mode 100644 vendor/libghostty-vt/src/config/c_get.zig
create mode 100644 vendor/libghostty-vt/src/config/command.zig
create mode 100644 vendor/libghostty-vt/src/config/conditional.zig
create mode 100644 vendor/libghostty-vt/src/config/config-template
create mode 100644 vendor/libghostty-vt/src/config/edit.zig
create mode 100644 vendor/libghostty-vt/src/config/file_load.zig
create mode 100644 vendor/libghostty-vt/src/config/formatter.zig
create mode 100644 vendor/libghostty-vt/src/config/formatter_file.zig
create mode 100644 vendor/libghostty-vt/src/config/io.zig
create mode 100644 vendor/libghostty-vt/src/config/key.zig
create mode 100644 vendor/libghostty-vt/src/config/path.zig
create mode 100644 vendor/libghostty-vt/src/config/string.zig
create mode 100644 vendor/libghostty-vt/src/config/testdata/theme_dark
create mode 100644 vendor/libghostty-vt/src/config/testdata/theme_light
create mode 100644 vendor/libghostty-vt/src/config/testdata/theme_simple
create mode 100644 vendor/libghostty-vt/src/config/theme.zig
create mode 100644 vendor/libghostty-vt/src/config/url.zig
create mode 100644 vendor/libghostty-vt/src/crash/dir.zig
create mode 100644 vendor/libghostty-vt/src/crash/main.zig
create mode 100644 vendor/libghostty-vt/src/crash/sentry.zig
create mode 100644 vendor/libghostty-vt/src/crash/sentry_envelope.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/array_list_collection.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/blocking_queue.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/cache_table.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/circ_buf.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/comparison.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/intrusive_linked_list.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/lru.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/main.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/message_data.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/segmented_pool.zig
create mode 100644 vendor/libghostty-vt/src/datastruct/split_tree.zig
create mode 100644 vendor/libghostty-vt/src/extra/bash.zig
create mode 100644 vendor/libghostty-vt/src/extra/fish.zig
create mode 100644 vendor/libghostty-vt/src/extra/sublime.zig
create mode 100644 vendor/libghostty-vt/src/extra/vim.zig
create mode 100644 vendor/libghostty-vt/src/extra/zsh.zig
create mode 100644 vendor/libghostty-vt/src/fastmem.zig
create mode 100644 vendor/libghostty-vt/src/file_type.zig
create mode 100644 vendor/libghostty-vt/src/font/Atlas.zig
create mode 100644 vendor/libghostty-vt/src/font/CodepointMap.zig
create mode 100644 vendor/libghostty-vt/src/font/CodepointResolver.zig
create mode 100644 vendor/libghostty-vt/src/font/Collection.zig
create mode 100644 vendor/libghostty-vt/src/font/DeferredFace.zig
create mode 100644 vendor/libghostty-vt/src/font/Glyph.zig
create mode 100644 vendor/libghostty-vt/src/font/Metrics.zig
create mode 100644 vendor/libghostty-vt/src/font/SharedGrid.zig
create mode 100644 vendor/libghostty-vt/src/font/SharedGridSet.zig
create mode 100644 vendor/libghostty-vt/src/font/backend.zig
create mode 100644 vendor/libghostty-vt/src/font/discovery.zig
create mode 100644 vendor/libghostty-vt/src/font/embedded.zig
create mode 100644 vendor/libghostty-vt/src/font/face.zig
create mode 100644 vendor/libghostty-vt/src/font/face/coretext.zig
create mode 100644 vendor/libghostty-vt/src/font/face/freetype.zig
create mode 100644 vendor/libghostty-vt/src/font/face/web_canvas.zig
create mode 100644 vendor/libghostty-vt/src/font/library.zig
create mode 100644 vendor/libghostty-vt/src/font/main.zig
create mode 100644 vendor/libghostty-vt/src/font/nerd_font_attributes.zig
create mode 100644 vendor/libghostty-vt/src/font/nerd_font_codegen.py
create mode 100644 vendor/libghostty-vt/src/font/nerd_font_codepoint_tables.py
create mode 100644 vendor/libghostty-vt/src/font/opentype.zig
create mode 100644 vendor/libghostty-vt/src/font/opentype/head.zig
create mode 100644 vendor/libghostty-vt/src/font/opentype/hhea.zig
create mode 100644 vendor/libghostty-vt/src/font/opentype/os2.zig
create mode 100644 vendor/libghostty-vt/src/font/opentype/post.zig
create mode 100644 vendor/libghostty-vt/src/font/opentype/sfnt.zig
create mode 100644 vendor/libghostty-vt/src/font/opentype/svg.zig
create mode 100644 vendor/libghostty-vt/src/font/shape.zig
create mode 100644 vendor/libghostty-vt/src/font/shaper/Cache.zig
create mode 100644 vendor/libghostty-vt/src/font/shaper/coretext.zig
create mode 100644 vendor/libghostty-vt/src/font/shaper/feature.zig
create mode 100644 vendor/libghostty-vt/src/font/shaper/harfbuzz.zig
create mode 100644 vendor/libghostty-vt/src/font/shaper/noop.zig
create mode 100644 vendor/libghostty-vt/src/font/shaper/run.zig
create mode 100644 vendor/libghostty-vt/src/font/shaper/testdata/arabic.txt
create mode 100644 vendor/libghostty-vt/src/font/shaper/web_canvas.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/Face.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/canvas.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/README.md
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/block.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/box.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/braille.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/branch.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/common.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/geometric_shapes.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/octants.txt
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/powerline.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/special.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/symbols_for_legacy_computing.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/draw/symbols_for_legacy_computing_supplement.zig
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CC00...U+1CCFF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CC00...U+1CCFF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CC00...U+1CCFF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CC00...U+1CCFF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CD00...U+1CDFF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CD00...U+1CDFF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CD00...U+1CDFF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CD00...U+1CDFF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CE00...U+1CEFF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CE00...U+1CEFF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CE00...U+1CEFF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1CE00...U+1CEFF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1FB00...U+1FBFF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1FB00...U+1FBFF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1FB00...U+1FBFF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+1FB00...U+1FBFF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2500...U+25FF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2500...U+25FF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2500...U+25FF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2500...U+25FF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2800...U+28FF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2800...U+28FF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2800...U+28FF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+2800...U+28FF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+E000...U+E0FF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+E000...U+E0FF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+E000...U+E0FF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+E000...U+E0FF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F500...U+F5FF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F500...U+F5FF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F500...U+F5FF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F500...U+F5FF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F600...U+F6FF-11x21+2.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F600...U+F6FF-12x24+3.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F600...U+F6FF-18x36+4.png
create mode 100644 vendor/libghostty-vt/src/font/sprite/testdata/U+F600...U+F6FF-9x17+1.png
create mode 100644 vendor/libghostty-vt/src/global.zig
create mode 100644 vendor/libghostty-vt/src/helpgen.zig
create mode 100644 vendor/libghostty-vt/src/input.zig
create mode 100644 vendor/libghostty-vt/src/input/Binding.zig
create mode 100644 vendor/libghostty-vt/src/input/KeymapDarwin.zig
create mode 100644 vendor/libghostty-vt/src/input/KeymapNoop.zig
create mode 100644 vendor/libghostty-vt/src/input/Link.zig
create mode 100644 vendor/libghostty-vt/src/input/command.zig
create mode 100644 vendor/libghostty-vt/src/input/config.zig
create mode 100644 vendor/libghostty-vt/src/input/function_keys.zig
create mode 100644 vendor/libghostty-vt/src/input/helpgen_actions.zig
create mode 100644 vendor/libghostty-vt/src/input/key.zig
create mode 100644 vendor/libghostty-vt/src/input/key_encode.zig
create mode 100644 vendor/libghostty-vt/src/input/key_mods.zig
create mode 100644 vendor/libghostty-vt/src/input/keyboard.zig
create mode 100644 vendor/libghostty-vt/src/input/keycodes.zig
create mode 100644 vendor/libghostty-vt/src/input/kitty.zig
create mode 100644 vendor/libghostty-vt/src/input/mouse.zig
create mode 100644 vendor/libghostty-vt/src/input/mouse_encode.zig
create mode 100644 vendor/libghostty-vt/src/input/paste.zig
create mode 100644 vendor/libghostty-vt/src/inspector/AGENTS.md
create mode 100644 vendor/libghostty-vt/src/inspector/Inspector.zig
create mode 100644 vendor/libghostty-vt/src/inspector/main.zig
create mode 100644 vendor/libghostty-vt/src/inspector/units.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/key.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/page.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/pagelist.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/renderer.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/screen.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/style.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/surface.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/terminal.zig
create mode 100644 vendor/libghostty-vt/src/inspector/widgets/termio.zig
create mode 100644 vendor/libghostty-vt/src/lib/allocator.zig
create mode 100644 vendor/libghostty-vt/src/lib/allocator/convenience.zig
create mode 100644 vendor/libghostty-vt/src/lib/enum.zig
create mode 100644 vendor/libghostty-vt/src/lib/main.zig
create mode 100644 vendor/libghostty-vt/src/lib/string.zig
create mode 100644 vendor/libghostty-vt/src/lib/struct.zig
create mode 100644 vendor/libghostty-vt/src/lib/target.zig
create mode 100644 vendor/libghostty-vt/src/lib/types.zig
create mode 100644 vendor/libghostty-vt/src/lib/union.zig
create mode 100644 vendor/libghostty-vt/src/lib_vt.zig
create mode 100644 vendor/libghostty-vt/src/main.zig
create mode 100644 vendor/libghostty-vt/src/main_bench.zig
create mode 100644 vendor/libghostty-vt/src/main_build_data.zig
create mode 100644 vendor/libghostty-vt/src/main_c.zig
create mode 100644 vendor/libghostty-vt/src/main_gen.zig
create mode 100644 vendor/libghostty-vt/src/main_ghostty.zig
create mode 100644 vendor/libghostty-vt/src/main_wasm.zig
create mode 100644 vendor/libghostty-vt/src/math.zig
create mode 100644 vendor/libghostty-vt/src/os/TempDir.zig
create mode 100644 vendor/libghostty-vt/src/os/args.zig
create mode 100644 vendor/libghostty-vt/src/os/cf_release_thread.zig
create mode 100644 vendor/libghostty-vt/src/os/cgroup.zig
create mode 100644 vendor/libghostty-vt/src/os/dbus.zig
create mode 100644 vendor/libghostty-vt/src/os/desktop.zig
create mode 100644 vendor/libghostty-vt/src/os/env.zig
create mode 100644 vendor/libghostty-vt/src/os/file.zig
create mode 100644 vendor/libghostty-vt/src/os/flatpak.zig
create mode 100644 vendor/libghostty-vt/src/os/homedir.zig
create mode 100644 vendor/libghostty-vt/src/os/hostname.zig
create mode 100644 vendor/libghostty-vt/src/os/i18n.zig
create mode 100644 vendor/libghostty-vt/src/os/i18n_locales.zig
create mode 100644 vendor/libghostty-vt/src/os/kernel_info.zig
create mode 100644 vendor/libghostty-vt/src/os/locale.c
create mode 100644 vendor/libghostty-vt/src/os/locale.zig
create mode 100644 vendor/libghostty-vt/src/os/mach.zig
create mode 100644 vendor/libghostty-vt/src/os/macos.zig
create mode 100644 vendor/libghostty-vt/src/os/main.zig
create mode 100644 vendor/libghostty-vt/src/os/mouse.zig
create mode 100644 vendor/libghostty-vt/src/os/open.zig
create mode 100644 vendor/libghostty-vt/src/os/passwd.zig
create mode 100644 vendor/libghostty-vt/src/os/path.zig
create mode 100644 vendor/libghostty-vt/src/os/pipe.zig
create mode 100644 vendor/libghostty-vt/src/os/resourcesdir.zig
create mode 100644 vendor/libghostty-vt/src/os/shell.zig
create mode 100644 vendor/libghostty-vt/src/os/string_encoding.zig
create mode 100644 vendor/libghostty-vt/src/os/systemd.zig
create mode 100644 vendor/libghostty-vt/src/os/uri.zig
create mode 100644 vendor/libghostty-vt/src/os/wasm.zig
create mode 100644 vendor/libghostty-vt/src/os/wasm/log.zig
create mode 100644 vendor/libghostty-vt/src/os/wasm/target.zig
create mode 100644 vendor/libghostty-vt/src/os/windows.zig
create mode 100644 vendor/libghostty-vt/src/os/xdg.zig
create mode 100644 vendor/libghostty-vt/src/pty.c
create mode 100644 vendor/libghostty-vt/src/pty.zig
create mode 100644 vendor/libghostty-vt/src/quirks.zig
create mode 100644 vendor/libghostty-vt/src/renderer.zig
create mode 100644 vendor/libghostty-vt/src/renderer/Metal.zig
create mode 100644 vendor/libghostty-vt/src/renderer/OpenGL.zig
create mode 100644 vendor/libghostty-vt/src/renderer/Options.zig
create mode 100644 vendor/libghostty-vt/src/renderer/Overlay.zig
create mode 100644 vendor/libghostty-vt/src/renderer/State.zig
create mode 100644 vendor/libghostty-vt/src/renderer/Thread.zig
create mode 100644 vendor/libghostty-vt/src/renderer/WebGL.zig
create mode 100644 vendor/libghostty-vt/src/renderer/backend.zig
create mode 100644 vendor/libghostty-vt/src/renderer/cell.zig
create mode 100644 vendor/libghostty-vt/src/renderer/cursor.zig
create mode 100644 vendor/libghostty-vt/src/renderer/generic.zig
create mode 100644 vendor/libghostty-vt/src/renderer/image.zig
create mode 100644 vendor/libghostty-vt/src/renderer/link.zig
create mode 100644 vendor/libghostty-vt/src/renderer/message.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/Frame.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/IOSurfaceLayer.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/Pipeline.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/RenderPass.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/Sampler.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/Target.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/Texture.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/api.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/buffer.zig
create mode 100644 vendor/libghostty-vt/src/renderer/metal/shaders.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/Frame.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/Pipeline.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/RenderPass.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/Sampler.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/Target.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/Texture.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/buffer.zig
create mode 100644 vendor/libghostty-vt/src/renderer/opengl/shaders.zig
create mode 100644 vendor/libghostty-vt/src/renderer/row.zig
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/bg_color.f.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/bg_image.f.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/bg_image.v.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/cell_bg.f.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/cell_text.f.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/cell_text.v.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/common.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/full_screen.v.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/image.f.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/glsl/image.v.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/shaders.metal
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/shadertoy_prefix.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/test_shadertoy_crt.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/test_shadertoy_focus.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shaders/test_shadertoy_invalid.glsl
create mode 100644 vendor/libghostty-vt/src/renderer/shadertoy.zig
create mode 100644 vendor/libghostty-vt/src/renderer/size.zig
create mode 100644 vendor/libghostty-vt/src/shell-integration/README.md
create mode 100644 vendor/libghostty-vt/src/shell-integration/bash/bash-preexec.sh
create mode 100644 vendor/libghostty-vt/src/shell-integration/bash/ghostty.bash
create mode 100644 vendor/libghostty-vt/src/shell-integration/elvish/lib/ghostty-integration.elv
create mode 100644 vendor/libghostty-vt/src/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish
create mode 100644 vendor/libghostty-vt/src/shell-integration/nushell/vendor/autoload/ghostty.nu
create mode 100644 vendor/libghostty-vt/src/shell-integration/zsh/.zshenv
create mode 100644 vendor/libghostty-vt/src/shell-integration/zsh/ghostty-integration
create mode 100644 vendor/libghostty-vt/src/simd/base64.cpp
create mode 100644 vendor/libghostty-vt/src/simd/base64.zig
create mode 100644 vendor/libghostty-vt/src/simd/base64_scalar.zig
create mode 100644 vendor/libghostty-vt/src/simd/codepoint_width.cpp
create mode 100644 vendor/libghostty-vt/src/simd/codepoint_width.zig
create mode 100644 vendor/libghostty-vt/src/simd/index_of.cpp
create mode 100644 vendor/libghostty-vt/src/simd/index_of.h
create mode 100644 vendor/libghostty-vt/src/simd/index_of.zig
create mode 100644 vendor/libghostty-vt/src/simd/main.zig
create mode 100644 vendor/libghostty-vt/src/simd/vt.cpp
create mode 100644 vendor/libghostty-vt/src/simd/vt.h
create mode 100644 vendor/libghostty-vt/src/simd/vt.zig
create mode 100644 vendor/libghostty-vt/src/stb/main.zig
create mode 100644 vendor/libghostty-vt/src/stb/stb.c
create mode 100644 vendor/libghostty-vt/src/stb/stb_image.h
create mode 100644 vendor/libghostty-vt/src/stb/stb_image_resize.h
create mode 100644 vendor/libghostty-vt/src/surface_mouse.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/Bytes.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/Generator.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/Osc.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/Utf8.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/cli.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/cli/Ascii.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/cli/Osc.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/cli/Utf8.zig
create mode 100644 vendor/libghostty-vt/src/synthetic/main.zig
create mode 100644 vendor/libghostty-vt/src/terminal/PageList.zig
create mode 100644 vendor/libghostty-vt/src/terminal/Parser.zig
create mode 100644 vendor/libghostty-vt/src/terminal/Screen.zig
create mode 100644 vendor/libghostty-vt/src/terminal/ScreenSet.zig
create mode 100644 vendor/libghostty-vt/src/terminal/Selection.zig
create mode 100644 vendor/libghostty-vt/src/terminal/StringMap.zig
create mode 100644 vendor/libghostty-vt/src/terminal/Tabstops.zig
create mode 100644 vendor/libghostty-vt/src/terminal/Terminal.zig
create mode 100644 vendor/libghostty-vt/src/terminal/UTF8Decoder.zig
create mode 100644 vendor/libghostty-vt/src/terminal/ansi.zig
create mode 100644 vendor/libghostty-vt/src/terminal/apc.zig
create mode 100644 vendor/libghostty-vt/src/terminal/bitmap_allocator.zig
create mode 100644 vendor/libghostty-vt/src/terminal/build_options.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/AGENTS.md
create mode 100644 vendor/libghostty-vt/src/terminal/c/allocator.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/build_info.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/cell.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/color.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/focus.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/formatter.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/grid_ref.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/key_encode.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/key_event.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/main.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/modes.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/mouse_encode.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/mouse_event.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/osc.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/paste.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/render.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/result.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/row.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/sgr.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/size_report.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/style.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/terminal.zig
create mode 100644 vendor/libghostty-vt/src/terminal/c/types.zig
create mode 100644 vendor/libghostty-vt/src/terminal/charsets.zig
create mode 100644 vendor/libghostty-vt/src/terminal/color.zig
create mode 100644 vendor/libghostty-vt/src/terminal/csi.zig
create mode 100644 vendor/libghostty-vt/src/terminal/cursor.zig
create mode 100644 vendor/libghostty-vt/src/terminal/dcs.zig
create mode 100644 vendor/libghostty-vt/src/terminal/device_attributes.zig
create mode 100644 vendor/libghostty-vt/src/terminal/device_status.zig
create mode 100644 vendor/libghostty-vt/src/terminal/focus.zig
create mode 100644 vendor/libghostty-vt/src/terminal/formatter.zig
create mode 100644 vendor/libghostty-vt/src/terminal/hash_map.zig
create mode 100644 vendor/libghostty-vt/src/terminal/highlight.zig
create mode 100644 vendor/libghostty-vt/src/terminal/hyperlink.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/color.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/graphics.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/graphics_command.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/graphics_exec.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/graphics_image.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/graphics_render.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/graphics_storage.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/graphics_unicode.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/key.zig
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/testdata/dog.png
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/testdata/image-png-none-50x76-2147483647-raw.data
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/testdata/image-rgb-none-20x15-2147483647-raw.data
create mode 100644 vendor/libghostty-vt/src/terminal/kitty/testdata/image-rgb-zlib_deflate-128x96-2147483647-raw.data
create mode 100644 vendor/libghostty-vt/src/terminal/lib.zig
create mode 100644 vendor/libghostty-vt/src/terminal/main.zig
create mode 100644 vendor/libghostty-vt/src/terminal/modes.zig
create mode 100644 vendor/libghostty-vt/src/terminal/mouse.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/encoding.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/change_window_icon.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/change_window_title.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/clipboard_operation.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/color.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/context_signal.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/hyperlink.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/iterm2.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/kitty_clipboard_protocol.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/kitty_color.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/kitty_text_sizing.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/mouse_shape.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/osc9.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/report_pwd.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/rxvt_extension.zig
create mode 100644 vendor/libghostty-vt/src/terminal/osc/parsers/semantic_prompt.zig
create mode 100644 vendor/libghostty-vt/src/terminal/page.zig
create mode 100644 vendor/libghostty-vt/src/terminal/parse_table.zig
create mode 100644 vendor/libghostty-vt/src/terminal/point.zig
create mode 100644 vendor/libghostty-vt/src/terminal/ref_counted_set.zig
create mode 100644 vendor/libghostty-vt/src/terminal/render.zig
create mode 100644 vendor/libghostty-vt/src/terminal/res/glitch.txt
create mode 100644 vendor/libghostty-vt/src/terminal/res/rgb.txt
create mode 100644 vendor/libghostty-vt/src/terminal/search.zig
create mode 100644 vendor/libghostty-vt/src/terminal/search/Thread.zig
create mode 100644 vendor/libghostty-vt/src/terminal/search/active.zig
create mode 100644 vendor/libghostty-vt/src/terminal/search/pagelist.zig
create mode 100644 vendor/libghostty-vt/src/terminal/search/screen.zig
create mode 100644 vendor/libghostty-vt/src/terminal/search/sliding_window.zig
create mode 100644 vendor/libghostty-vt/src/terminal/search/viewport.zig
create mode 100644 vendor/libghostty-vt/src/terminal/sgr.zig
create mode 100644 vendor/libghostty-vt/src/terminal/size.zig
create mode 100644 vendor/libghostty-vt/src/terminal/size_report.zig
create mode 100644 vendor/libghostty-vt/src/terminal/stream.zig
create mode 100644 vendor/libghostty-vt/src/terminal/stream_terminal.zig
create mode 100644 vendor/libghostty-vt/src/terminal/style.zig
create mode 100644 vendor/libghostty-vt/src/terminal/tmux.zig
create mode 100644 vendor/libghostty-vt/src/terminal/tmux/control.zig
create mode 100644 vendor/libghostty-vt/src/terminal/tmux/layout.zig
create mode 100644 vendor/libghostty-vt/src/terminal/tmux/output.zig
create mode 100644 vendor/libghostty-vt/src/terminal/tmux/viewer.zig
create mode 100644 vendor/libghostty-vt/src/terminal/x11_color.zig
create mode 100644 vendor/libghostty-vt/src/terminfo/Source.zig
create mode 100644 vendor/libghostty-vt/src/terminfo/ghostty.zig
create mode 100644 vendor/libghostty-vt/src/terminfo/main.zig
create mode 100644 vendor/libghostty-vt/src/termio.zig
create mode 100644 vendor/libghostty-vt/src/termio/Exec.zig
create mode 100644 vendor/libghostty-vt/src/termio/Options.zig
create mode 100644 vendor/libghostty-vt/src/termio/Termio.zig
create mode 100644 vendor/libghostty-vt/src/termio/Thread.zig
create mode 100644 vendor/libghostty-vt/src/termio/backend.zig
create mode 100644 vendor/libghostty-vt/src/termio/mailbox.zig
create mode 100644 vendor/libghostty-vt/src/termio/message.zig
create mode 100644 vendor/libghostty-vt/src/termio/shell_integration.zig
create mode 100644 vendor/libghostty-vt/src/termio/stream_handler.zig
create mode 100644 vendor/libghostty-vt/src/tripwire.zig
create mode 100644 vendor/libghostty-vt/src/unicode/grapheme.zig
create mode 100644 vendor/libghostty-vt/src/unicode/lut.zig
create mode 100644 vendor/libghostty-vt/src/unicode/main.zig
create mode 100644 vendor/libghostty-vt/src/unicode/props.zig
create mode 100644 vendor/libghostty-vt/src/unicode/props_table.zig
create mode 100644 vendor/libghostty-vt/src/unicode/props_uucode.zig
create mode 100644 vendor/libghostty-vt/src/unicode/symbols_table.zig
create mode 100644 vendor/libghostty-vt/src/unicode/symbols_uucode.zig
create mode 100755 vendor/libghostty-vt/test_align
create mode 100644 vendor/libghostty-vt/typos.toml
create mode 100644 vendor/libghostty-vt/valgrind.supp
diff --git a/Cargo.toml b/Cargo.toml
index 95bc35b4..59bb5af1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,7 @@
name = "herdr"
version = "0.3.2"
edition = "2021"
+build = "build.rs"
description = "terminal workspace manager for AI coding agents"
license = "AGPL-3.0-or-later"
repository = "https://github.com/ogulcancelik/herdr"
@@ -10,6 +11,10 @@ keywords = ["terminal", "tui", "ai", "agents", "multiplexer"]
categories = ["command-line-utilities"]
include = ["src/**/*", "assets/sounds/*", "README.md", "LICENSE", "Cargo.toml"]
+[features]
+default = []
+ghostty-vt = []
+
[dependencies]
base64 = "0.22.1"
bytes = "1"
diff --git a/build.rs b/build.rs
new file mode 100644
index 00000000..faab7f06
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,43 @@
+use std::env;
+use std::path::PathBuf;
+use std::process::Command;
+
+fn main() {
+ println!("cargo:rerun-if-changed=build.rs");
+ println!("cargo:rerun-if-changed=vendor/libghostty-vt.vendor.json");
+ println!("cargo:rerun-if-changed=vendor/libghostty-vt/build.zig");
+ println!("cargo:rerun-if-changed=vendor/libghostty-vt/build.zig.zon");
+ println!("cargo:rerun-if-changed=vendor/libghostty-vt/VERSION");
+ println!("cargo:rerun-if-env-changed=LIBGHOSTTY_VT_OPTIMIZE");
+
+ if env::var_os("CARGO_FEATURE_GHOSTTY_VT").is_none() {
+ return;
+ }
+
+ let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"));
+ let vendored_dir = manifest_dir.join("vendor/libghostty-vt");
+ let optimize = env::var("LIBGHOSTTY_VT_OPTIMIZE").unwrap_or_else(|_| "ReleaseFast".into());
+
+ let status = Command::new("zig")
+ .arg("build")
+ .arg("-Demit-lib-vt")
+ .arg(format!("-Doptimize={optimize}"))
+ .current_dir(&vendored_dir)
+ .status()
+ .expect("failed to execute zig build for vendored libghostty-vt");
+ assert!(
+ status.success(),
+ "zig build for vendored libghostty-vt failed: {status}"
+ );
+
+ let lib_dir = vendored_dir.join("zig-out/lib");
+ println!("cargo:rustc-link-search=native={}", lib_dir.display());
+ println!("cargo:rustc-link-lib=dylib=ghostty-vt");
+
+ let target = env::var("TARGET").expect("TARGET");
+ if target.contains("linux") {
+ println!("cargo:rustc-link-arg=-Wl,-rpath,{}", lib_dir.display());
+ } else if target.contains("apple-darwin") {
+ println!("cargo:rustc-link-arg=-Wl,-rpath,{}", lib_dir.display());
+ }
+}
diff --git a/justfile b/justfile
index 817d9955..1105aa9e 100644
--- a/justfile
+++ b/justfile
@@ -3,13 +3,15 @@
# Run unit tests
test:
cargo test
- python3 -m unittest scripts.test_changelog
+ cargo test --features ghostty-vt ghostty::tests
+ python3 -m unittest scripts.test_changelog scripts.test_vendor_libghostty_vt
# Check formatting + run unit tests
check:
cargo fmt --check
cargo test
- python3 -m unittest scripts.test_changelog
+ cargo test --features ghostty-vt ghostty::tests
+ python3 -m unittest scripts.test_changelog scripts.test_vendor_libghostty_vt
# Run the full local test suite
test-all: check
@@ -18,6 +20,10 @@ test-all: check
build:
cargo build --release
+# Build the vendored libghostty-vt source dist
+build-libghostty-vt:
+ scripts/build_vendored_libghostty_vt.sh
+
# Finalize changelog, bump version, commit, tag, push, trigger release build (usage: just release 0.1.1)
release version:
@if [ -n "$(git status --porcelain)" ]; then \
diff --git a/scripts/build_vendored_libghostty_vt.sh b/scripts/build_vendored_libghostty_vt.sh
new file mode 100755
index 00000000..1d051810
--- /dev/null
+++ b/scripts/build_vendored_libghostty_vt.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ROOT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
+VENDORED_DIR=${VENDORED_GHOSTTY_DIR:-"$ROOT_DIR/vendor/libghostty-vt"}
+OPTIMIZE=${LIBGHOSTTY_VT_OPTIMIZE:-ReleaseFast}
+
+if [[ ! -f "$VENDORED_DIR/build.zig" ]]; then
+ echo "error: vendored libghostty-vt source not found at $VENDORED_DIR" >&2
+ exit 1
+fi
+
+cd "$VENDORED_DIR"
+zig build -Demit-lib-vt -Doptimize="$OPTIMIZE" "$@"
+
+echo
+printf 'built libghostty-vt in %s/zig-out\n' "$VENDORED_DIR"
diff --git a/scripts/test_vendor_libghostty_vt.py b/scripts/test_vendor_libghostty_vt.py
new file mode 100644
index 00000000..9a9806b3
--- /dev/null
+++ b/scripts/test_vendor_libghostty_vt.py
@@ -0,0 +1,50 @@
+from __future__ import annotations
+
+import io
+import tarfile
+import tempfile
+import unittest
+from pathlib import Path
+
+from scripts.vendor_libghostty_vt import parse_archive_root
+
+
+class VendorLibghosttyVtTests(unittest.TestCase):
+ def test_parse_archive_root_returns_single_top_level_directory(self) -> None:
+ with tempfile.TemporaryDirectory() as temp_dir:
+ archive = Path(temp_dir) / "libghostty-vt.tar.gz"
+ with tarfile.open(archive, "w:gz") as tar:
+ data = b"hello"
+ info = tarfile.TarInfo("libghostty-vt-1.0.0/README.md")
+ info.size = len(data)
+ tar.addfile(info, io.BytesIO(data))
+
+ self.assertEqual(parse_archive_root(archive), "libghostty-vt-1.0.0")
+
+ def test_vendored_tree_contains_required_upstream_files(self) -> None:
+ root = Path(__file__).resolve().parent.parent / "vendor" / "libghostty-vt"
+ required = [
+ root / "build.zig",
+ root / "build.zig.zon",
+ root / "CMakeLists.txt",
+ root / "dist" / "cmake" / "ghostty-vt-config.cmake.in",
+ root / "include" / "ghostty" / "vt.h",
+ root / "include" / "ghostty" / "vt" / "render.h",
+ root / "src" / "lib_vt.zig",
+ ]
+
+ missing = [str(path.relative_to(root)) for path in required if not path.exists()]
+ self.assertEqual(missing, [])
+
+ def test_vendor_metadata_exists_and_points_at_vendored_tree(self) -> None:
+ project_root = Path(__file__).resolve().parent.parent
+ metadata = project_root / "vendor" / "libghostty-vt.vendor.json"
+ self.assertTrue(metadata.exists())
+ text = metadata.read_text()
+ self.assertIn('"source_commit"', text)
+ self.assertIn('"dist_archive"', text)
+ self.assertIn('"extracted_dir"', text)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/scripts/vendor_libghostty_vt.py b/scripts/vendor_libghostty_vt.py
new file mode 100644
index 00000000..f53e809b
--- /dev/null
+++ b/scripts/vendor_libghostty_vt.py
@@ -0,0 +1,107 @@
+from __future__ import annotations
+
+import argparse
+import json
+import shutil
+import subprocess
+import tarfile
+import tempfile
+from dataclasses import asdict, dataclass
+from pathlib import Path
+
+
+@dataclass
+class VendorMetadata:
+ source_repo: str
+ source_commit: str
+ dist_archive: str
+ extracted_dir: str
+
+
+def parse_archive_root(archive: Path) -> str:
+ with tarfile.open(archive, "r:gz") as tar:
+ roots = {
+ member.name.split("/", 1)[0]
+ for member in tar.getmembers()
+ if member.name and member.name != "."
+ }
+ if len(roots) != 1:
+ raise ValueError(f"expected exactly one archive root in {archive}, found {sorted(roots)}")
+ return next(iter(roots))
+
+
+def git_head(repo: Path) -> str:
+ return subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=repo, text=True).strip()
+
+
+def ensure_dist_archive(source_repo: Path) -> Path:
+ subprocess.run(
+ ["zig", "build", "dist", "-Demit-lib-vt", "-Doptimize=ReleaseFast"],
+ cwd=source_repo,
+ check=True,
+ )
+ dist_dir = source_repo / "zig-out" / "dist"
+ archives = sorted(dist_dir.glob("libghostty-vt-*.tar.gz"))
+ if not archives:
+ raise FileNotFoundError(f"no libghostty-vt dist archive found in {dist_dir}")
+ return archives[-1]
+
+
+def vendor_libghostty_vt(source_repo: Path, destination: Path) -> VendorMetadata:
+ archive = ensure_dist_archive(source_repo)
+ root = parse_archive_root(archive)
+
+ with tempfile.TemporaryDirectory() as temp_dir:
+ temp_dir_path = Path(temp_dir)
+ with tarfile.open(archive, "r:gz") as tar:
+ tar.extractall(temp_dir_path)
+
+ extracted = temp_dir_path / root
+ if not extracted.exists():
+ raise FileNotFoundError(f"expected extracted root {extracted}")
+
+ if destination.exists():
+ shutil.rmtree(destination)
+ destination.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copytree(extracted, destination)
+
+ return VendorMetadata(
+ source_repo=str(source_repo),
+ source_commit=git_head(source_repo),
+ dist_archive=archive.name,
+ extracted_dir=root,
+ )
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description="Vendor the pinned libghostty-vt source dist into herdr")
+ parser.add_argument(
+ "--source-repo",
+ default="/home/can/Projects/ghostty",
+ help="Path to a local ghostty checkout",
+ )
+ parser.add_argument(
+ "--destination",
+ default="vendor/libghostty-vt",
+ help="Destination directory for the extracted libghostty-vt source dist",
+ )
+ parser.add_argument(
+ "--metadata",
+ default="vendor/libghostty-vt.vendor.json",
+ help="Path to write vendoring metadata JSON",
+ )
+ args = parser.parse_args()
+
+ repo = Path(args.source_repo).resolve()
+ destination = Path(args.destination).resolve()
+ metadata_path = Path(args.metadata).resolve()
+
+ metadata = vendor_libghostty_vt(repo, destination)
+ metadata_path.parent.mkdir(parents=True, exist_ok=True)
+ metadata_path.write_text(json.dumps(asdict(metadata), indent=2) + "\n")
+
+ print(f"vendored {metadata.extracted_dir} from {metadata.source_commit} into {destination}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/app/actions.rs b/src/app/actions.rs
index 777245da..340d3089 100644
--- a/src/app/actions.rs
+++ b/src/app/actions.rs
@@ -324,8 +324,7 @@ impl AppState {
None => return,
};
- if let Ok(parser) = rt.parser.read() {
- let text = crate::selection::extract_text(parser.screen(), sel);
+ if let Some(text) = rt.extract_selection(sel) {
if !text.is_empty() {
crate::selection::write_osc52(&text);
info!(len = text.len(), "copied selection to clipboard");
diff --git a/src/app/input.rs b/src/app/input.rs
index 513a1d48..d077909f 100644
--- a/src/app/input.rs
+++ b/src/app/input.rs
@@ -17,6 +17,7 @@ enum ScrollbarClickTarget {
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+#[cfg(test)]
enum WheelRouting {
HostScroll,
MouseReport,
@@ -123,18 +124,7 @@ impl App {
}
if let Some(ws) = self.state.active.and_then(|i| self.state.workspaces.get(i)) {
if let Some(rt) = ws.focused_runtime() {
- let bracketed = rt
- .parser
- .read()
- .map(|p| p.screen().bracketed_paste())
- .unwrap_or(false);
-
- let payload = if bracketed {
- format!("\x1b[200~{text}\x1b[201~")
- } else {
- text
- };
- let _ = rt.sender.send(Bytes::from(payload)).await;
+ let _ = rt.send_paste(text).await;
}
}
}
@@ -379,11 +369,8 @@ impl App {
if let Some(ws) = self.state.active.and_then(|i| self.state.workspaces.get(i)) {
if let Some(rt) = ws.focused_runtime() {
rt.scroll_reset();
- let flags = rt
- .kitty_keyboard_flags
- .load(std::sync::atomic::Ordering::Relaxed);
- let protocol = crate::input::KeyboardProtocol::from_kitty_flags(flags);
- let bytes = crate::input::encode_terminal_key(key, protocol);
+ let protocol = rt.keyboard_protocol();
+ let bytes = rt.encode_terminal_key(key);
if matches!(key_event.code, KeyCode::Esc)
|| key_event
.modifiers
@@ -416,7 +403,7 @@ impl App {
warn!(code = ?key_event.code, mods = ?key_event.modifiers, state = ?key_event.state, "key produced empty encoding");
}
} else {
- let _ = rt.sender.send(Bytes::from(bytes)).await;
+ let _ = rt.send_bytes(Bytes::from(bytes)).await;
}
}
}
@@ -1941,6 +1928,11 @@ impl AppState {
return None;
}
} else if let Some(info) = self.pane_at(mouse.column, mouse.row).cloned() {
+ if self.forward_pane_mouse_button(&info, mouse) {
+ self.selection = None;
+ return None;
+ }
+
let (row, col) = (
mouse.row - info.inner_rect.y,
mouse.column - info.inner_rect.x,
@@ -1974,6 +1966,13 @@ impl AppState {
}
MouseEventKind::Drag(MouseButton::Left) => {
+ if let Some(info) = self.pane_mouse_target(mouse.column, mouse.row).cloned() {
+ if self.forward_pane_mouse_button(&info, mouse) {
+ self.selection = None;
+ return None;
+ }
+ }
+
let workspace_drop_index = self.workspace_drop_index_at_row(mouse.row);
if self.drag.is_none() {
if let Some(press) = &self.workspace_press {
@@ -2044,6 +2043,15 @@ impl AppState {
}
MouseEventKind::Up(MouseButton::Left) => {
+ if let Some(info) = self.pane_mouse_target(mouse.column, mouse.row).cloned() {
+ if self.forward_pane_mouse_button(&info, mouse) {
+ self.selection = None;
+ self.workspace_press = None;
+ self.drag = None;
+ return None;
+ }
+ }
+
let workspace_press = self.workspace_press.take();
match self.drag.take() {
Some(DragState {
@@ -2072,6 +2080,14 @@ impl AppState {
}
}
+ MouseEventKind::Up(MouseButton::Middle) | MouseEventKind::Up(MouseButton::Right)
+ | MouseEventKind::Drag(MouseButton::Middle)
+ | MouseEventKind::Drag(MouseButton::Right) if !in_sidebar => {
+ if let Some(info) = self.pane_mouse_target(mouse.column, mouse.row).cloned() {
+ let _ = self.forward_pane_mouse_button(&info, mouse);
+ }
+ }
+
MouseEventKind::ScrollUp | MouseEventKind::ScrollDown if !in_sidebar => {
self.selection = None;
self.handle_terminal_wheel(mouse);
@@ -2126,7 +2142,10 @@ impl AppState {
}
MouseEventKind::Down(MouseButton::Right) if !in_sidebar => {
- if self.pane_at(mouse.column, mouse.row).is_some() {
+ if let Some(info) = self.pane_mouse_target(mouse.column, mouse.row).cloned() {
+ if self.forward_pane_mouse_button(&info, mouse) {
+ return None;
+ }
self.context_menu = Some(ContextMenuState {
kind: ContextMenuKind::Pane,
x: mouse.column,
@@ -2370,6 +2389,10 @@ impl AppState {
})
}
+ fn pane_mouse_target(&self, col: u16, row: u16) -> Option<&PaneInfo> {
+ self.pane_at(col, row).or_else(|| self.pane_frame_at(col, row))
+ }
+
fn pane_frame_at(&self, col: u16, row: u16) -> Option<&PaneInfo> {
self.view.pane_infos.iter().find(|p| {
col >= p.rect.x
@@ -2440,47 +2463,54 @@ impl AppState {
}
}
- fn forward_pane_wheel(&self, info: &PaneInfo, mouse: MouseEvent) -> bool {
+ fn forward_pane_mouse_button(&self, info: &PaneInfo, mouse: MouseEvent) -> bool {
let Some(ws) = self.active.and_then(|i| self.workspaces.get(i)) else {
return false;
};
let Some(rt) = ws.runtimes.get(&info.id) else {
return false;
};
- let Some(input_state) = rt.input_state() else {
+ let column = mouse.column.saturating_sub(info.inner_rect.x);
+ let row = mouse.row.saturating_sub(info.inner_rect.y);
+ let Some(bytes) = rt.encode_mouse_button(mouse.kind, column, row, mouse.modifiers) else {
return false;
};
+ rt.scroll_reset();
+ if let Err(err) = rt.try_send_bytes(Bytes::from(bytes)) {
+ warn!(pane = info.id.raw(), err = %err, kind = ?mouse.kind, "failed to forward mouse button event");
+ }
+ true
+ }
- match wheel_routing(input_state) {
- WheelRouting::HostScroll => false,
- WheelRouting::MouseReport => {
+ fn forward_pane_wheel(&self, info: &PaneInfo, mouse: MouseEvent) -> bool {
+ let Some(ws) = self.active.and_then(|i| self.workspaces.get(i)) else {
+ return false;
+ };
+ let Some(rt) = ws.runtimes.get(&info.id) else {
+ return false;
+ };
+ match rt.wheel_routing() {
+ Some(crate::pane::WheelRouting::HostScroll) | None => false,
+ Some(crate::pane::WheelRouting::MouseReport) => {
rt.scroll_reset();
let column = mouse.column.saturating_sub(info.inner_rect.x);
let row = mouse.row.saturating_sub(info.inner_rect.y);
- let Some(bytes) = crate::input::encode_mouse_scroll(
- mouse.kind,
- column,
- row,
- mouse.modifiers,
- input_state.mouse_protocol_encoding,
- ) else {
+ let Some(bytes) = rt.encode_mouse_wheel(mouse.kind, column, row, mouse.modifiers)
+ else {
warn!(pane = info.id.raw(), kind = ?mouse.kind, "failed to encode mouse wheel event");
return true;
};
- if let Err(err) = rt.sender.try_send(Bytes::from(bytes)) {
+ if let Err(err) = rt.try_send_bytes(Bytes::from(bytes)) {
warn!(pane = info.id.raw(), err = %err, "failed to forward mouse wheel event");
}
true
}
- WheelRouting::AlternateScroll => {
+ Some(crate::pane::WheelRouting::AlternateScroll) => {
rt.scroll_reset();
- let key = match mouse.kind {
- MouseEventKind::ScrollUp => KeyCode::Up,
- MouseEventKind::ScrollDown => KeyCode::Down,
- _ => return true,
+ let Some(bytes) = rt.encode_alternate_scroll(mouse.kind) else {
+ return true;
};
- let bytes = crate::input::encode_cursor_key(key, input_state.application_cursor);
- if let Err(err) = rt.sender.try_send(Bytes::from(bytes)) {
+ if let Err(err) = rt.try_send_bytes(Bytes::from(bytes)) {
warn!(pane = info.id.raw(), err = %err, "failed to forward alternate-scroll key");
}
true
@@ -2555,6 +2585,7 @@ impl AppState {
}
}
+#[cfg(test)]
fn wheel_routing(input_state: crate::pane::InputState) -> WheelRouting {
if input_state.mouse_protocol_mode != vt100::MouseProtocolMode::None {
WheelRouting::MouseReport
@@ -3248,11 +3279,11 @@ mod tests {
app.state.active = Some(0);
app.state.selected = 0;
- app.handle_mouse(mouse(MouseEventKind::Down(MouseButton::Left), 2, 3));
+ app.handle_mouse(mouse(MouseEventKind::Down(MouseButton::Left), 2, 2));
assert_eq!(app.state.active, Some(0));
assert!(app.state.workspace_press.is_some());
- app.handle_mouse(mouse(MouseEventKind::Up(MouseButton::Left), 2, 3));
+ app.handle_mouse(mouse(MouseEventKind::Up(MouseButton::Left), 2, 2));
assert_eq!(app.state.active, Some(1));
assert_eq!(app.state.selected, 1);
assert!(app.state.workspace_press.is_none());
@@ -3271,7 +3302,7 @@ mod tests {
app.state.active = Some(1);
app.state.selected = 2;
- app.handle_mouse(mouse(MouseEventKind::Down(MouseButton::Left), 2, 3));
+ app.handle_mouse(mouse(MouseEventKind::Down(MouseButton::Left), 2, 2));
app.handle_mouse(mouse(MouseEventKind::Drag(MouseButton::Left), 2, 0));
assert!(matches!(
app.state.drag.as_ref().map(|drag| &drag.target),
@@ -3334,6 +3365,7 @@ mod tests {
let input_state = crate::pane::InputState {
alternate_screen: true,
application_cursor: false,
+ bracketed_paste: false,
mouse_protocol_mode: vt100::MouseProtocolMode::ButtonMotion,
mouse_protocol_encoding: vt100::MouseProtocolEncoding::Sgr,
mouse_alternate_scroll: true,
@@ -3347,6 +3379,7 @@ mod tests {
let input_state = crate::pane::InputState {
alternate_screen: true,
application_cursor: false,
+ bracketed_paste: false,
mouse_protocol_mode: vt100::MouseProtocolMode::None,
mouse_protocol_encoding: vt100::MouseProtocolEncoding::Default,
mouse_alternate_scroll: true,
@@ -3360,6 +3393,7 @@ mod tests {
let input_state = crate::pane::InputState {
alternate_screen: false,
application_cursor: false,
+ bracketed_paste: false,
mouse_protocol_mode: vt100::MouseProtocolMode::None,
mouse_protocol_encoding: vt100::MouseProtocolEncoding::Default,
mouse_alternate_scroll: true,
diff --git a/src/app/mod.rs b/src/app/mod.rs
index 460e5780..914c6ca4 100644
--- a/src/app/mod.rs
+++ b/src/app/mod.rs
@@ -1582,7 +1582,7 @@ impl App {
})
.unwrap();
};
- if let Err(err) = runtime.0.try_send(Bytes::from(params.text)) {
+ if let Err(err) = runtime.try_send_bytes(Bytes::from(params.text)) {
return serde_json::to_string(&ErrorResponse {
id: request.id,
error: ErrorBody {
@@ -1681,15 +1681,8 @@ impl App {
})
.unwrap();
};
- let flags = runtime
- .1
- .kitty_keyboard_flags
- .load(std::sync::atomic::Ordering::Relaxed);
- let bytes = crate::input::encode_key(
- key_event,
- crate::input::KeyboardProtocol::from_kitty_flags(flags),
- );
- if let Err(err) = runtime.0.try_send(Bytes::from(bytes)) {
+ let bytes = runtime.encode_terminal_key(key_event.into());
+ if let Err(err) = runtime.try_send_bytes(Bytes::from(bytes)) {
return serde_json::to_string(&ErrorResponse {
id: request.id,
error: ErrorBody {
@@ -2023,13 +2016,9 @@ impl App {
&self,
ws_idx: usize,
pane_id: crate::layout::PaneId,
- ) -> Option<(
- &tokio::sync::mpsc::Sender,
- &crate::pane::PaneRuntime,
- )> {
+ ) -> Option<&crate::pane::PaneRuntime> {
let ws = self.state.workspaces.get(ws_idx)?;
- let runtime = ws.runtime(pane_id)?;
- Some((&runtime.sender, runtime))
+ ws.runtime(pane_id)
}
fn workspace_info(&self, index: usize) -> crate::api::schema::WorkspaceInfo {
diff --git a/src/ghostty/bindings.rs b/src/ghostty/bindings.rs
new file mode 100644
index 00000000..db2d412d
--- /dev/null
+++ b/src/ghostty/bindings.rs
@@ -0,0 +1,2472 @@
+/* automatically generated by rust-bindgen 0.72.1 */
+
+pub const GHOSTTY_COLOR_NAMED_BLACK: u32 = 0;
+pub const GHOSTTY_COLOR_NAMED_RED: u32 = 1;
+pub const GHOSTTY_COLOR_NAMED_GREEN: u32 = 2;
+pub const GHOSTTY_COLOR_NAMED_YELLOW: u32 = 3;
+pub const GHOSTTY_COLOR_NAMED_BLUE: u32 = 4;
+pub const GHOSTTY_COLOR_NAMED_MAGENTA: u32 = 5;
+pub const GHOSTTY_COLOR_NAMED_CYAN: u32 = 6;
+pub const GHOSTTY_COLOR_NAMED_WHITE: u32 = 7;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_BLACK: u32 = 8;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_RED: u32 = 9;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_GREEN: u32 = 10;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_YELLOW: u32 = 11;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_BLUE: u32 = 12;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_MAGENTA: u32 = 13;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_CYAN: u32 = 14;
+pub const GHOSTTY_COLOR_NAMED_BRIGHT_WHITE: u32 = 15;
+pub const GHOSTTY_DA_CONFORMANCE_VT100: u32 = 1;
+pub const GHOSTTY_DA_CONFORMANCE_VT101: u32 = 1;
+pub const GHOSTTY_DA_CONFORMANCE_VT102: u32 = 6;
+pub const GHOSTTY_DA_CONFORMANCE_VT125: u32 = 12;
+pub const GHOSTTY_DA_CONFORMANCE_VT131: u32 = 7;
+pub const GHOSTTY_DA_CONFORMANCE_VT132: u32 = 4;
+pub const GHOSTTY_DA_CONFORMANCE_VT220: u32 = 62;
+pub const GHOSTTY_DA_CONFORMANCE_VT240: u32 = 62;
+pub const GHOSTTY_DA_CONFORMANCE_VT320: u32 = 63;
+pub const GHOSTTY_DA_CONFORMANCE_VT340: u32 = 63;
+pub const GHOSTTY_DA_CONFORMANCE_VT420: u32 = 64;
+pub const GHOSTTY_DA_CONFORMANCE_VT510: u32 = 65;
+pub const GHOSTTY_DA_CONFORMANCE_VT520: u32 = 65;
+pub const GHOSTTY_DA_CONFORMANCE_VT525: u32 = 65;
+pub const GHOSTTY_DA_CONFORMANCE_LEVEL_2: u32 = 62;
+pub const GHOSTTY_DA_CONFORMANCE_LEVEL_3: u32 = 63;
+pub const GHOSTTY_DA_CONFORMANCE_LEVEL_4: u32 = 64;
+pub const GHOSTTY_DA_CONFORMANCE_LEVEL_5: u32 = 65;
+pub const GHOSTTY_DA_FEATURE_COLUMNS_132: u32 = 1;
+pub const GHOSTTY_DA_FEATURE_PRINTER: u32 = 2;
+pub const GHOSTTY_DA_FEATURE_REGIS: u32 = 3;
+pub const GHOSTTY_DA_FEATURE_SIXEL: u32 = 4;
+pub const GHOSTTY_DA_FEATURE_SELECTIVE_ERASE: u32 = 6;
+pub const GHOSTTY_DA_FEATURE_USER_DEFINED_KEYS: u32 = 8;
+pub const GHOSTTY_DA_FEATURE_NATIONAL_REPLACEMENT: u32 = 9;
+pub const GHOSTTY_DA_FEATURE_TECHNICAL_CHARACTERS: u32 = 15;
+pub const GHOSTTY_DA_FEATURE_LOCATOR: u32 = 16;
+pub const GHOSTTY_DA_FEATURE_TERMINAL_STATE: u32 = 17;
+pub const GHOSTTY_DA_FEATURE_WINDOWING: u32 = 18;
+pub const GHOSTTY_DA_FEATURE_HORIZONTAL_SCROLLING: u32 = 21;
+pub const GHOSTTY_DA_FEATURE_ANSI_COLOR: u32 = 22;
+pub const GHOSTTY_DA_FEATURE_RECTANGULAR_EDITING: u32 = 28;
+pub const GHOSTTY_DA_FEATURE_ANSI_TEXT_LOCATOR: u32 = 29;
+pub const GHOSTTY_DA_FEATURE_CLIPBOARD: u32 = 52;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT100: u32 = 0;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT220: u32 = 1;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT240: u32 = 2;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT330: u32 = 18;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT340: u32 = 19;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT320: u32 = 24;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT382: u32 = 32;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT420: u32 = 41;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT510: u32 = 61;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT520: u32 = 64;
+pub const GHOSTTY_DA_DEVICE_TYPE_VT525: u32 = 65;
+pub const GHOSTTY_MODS_SHIFT: u32 = 1;
+pub const GHOSTTY_MODS_CTRL: u32 = 2;
+pub const GHOSTTY_MODS_ALT: u32 = 4;
+pub const GHOSTTY_MODS_SUPER: u32 = 8;
+pub const GHOSTTY_MODS_CAPS_LOCK: u32 = 16;
+pub const GHOSTTY_MODS_NUM_LOCK: u32 = 32;
+pub const GHOSTTY_MODS_SHIFT_SIDE: u32 = 64;
+pub const GHOSTTY_MODS_CTRL_SIDE: u32 = 128;
+pub const GHOSTTY_MODS_ALT_SIDE: u32 = 256;
+pub const GHOSTTY_MODS_SUPER_SIDE: u32 = 512;
+pub const GHOSTTY_KITTY_KEY_DISABLED: u32 = 0;
+pub const GHOSTTY_KITTY_KEY_DISAMBIGUATE: u32 = 1;
+pub const GHOSTTY_KITTY_KEY_REPORT_EVENTS: u32 = 2;
+pub const GHOSTTY_KITTY_KEY_REPORT_ALTERNATES: u32 = 4;
+pub const GHOSTTY_KITTY_KEY_REPORT_ALL: u32 = 8;
+pub const GHOSTTY_KITTY_KEY_REPORT_ASSOCIATED: u32 = 16;
+pub const GHOSTTY_KITTY_KEY_ALL: u32 = 31;
+#[doc = " Operation completed successfully"]
+pub const GhosttyResult_GHOSTTY_SUCCESS: GhosttyResult = 0;
+#[doc = " Operation failed due to failed allocation"]
+pub const GhosttyResult_GHOSTTY_OUT_OF_MEMORY: GhosttyResult = -1;
+#[doc = " Operation failed due to invalid value"]
+pub const GhosttyResult_GHOSTTY_INVALID_VALUE: GhosttyResult = -2;
+#[doc = " Operation failed because the provided buffer was too small"]
+pub const GhosttyResult_GHOSTTY_OUT_OF_SPACE: GhosttyResult = -3;
+#[doc = " Result codes for libghostty-vt operations."]
+pub type GhosttyResult = ::std::os::raw::c_int;
+#[doc = " A borrowed byte string (pointer + length).\n\n The memory is not owned by this struct. The pointer is only valid\n for the lifetime documented by the API that produces or consumes it."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyString {
+ #[doc = " Pointer to the string bytes."]
+ pub ptr: *const u8,
+ #[doc = " Length of the string in bytes."]
+ pub len: usize,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyString"][::std::mem::size_of::() - 16usize];
+ ["Alignment of GhosttyString"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyString::ptr"][::std::mem::offset_of!(GhosttyString, ptr) - 0usize];
+ ["Offset of field: GhosttyString::len"][::std::mem::offset_of!(GhosttyString, len) - 8usize];
+};
+impl Default for GhosttyString {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " Function table for custom memory allocator operations.\n\n This vtable defines the interface for a custom memory allocator. All\n function pointers must be valid and non-NULL.\n\n @ingroup allocator\n\n If you're not going to use a custom allocator, you can ignore all of\n this. All functions that take an allocator pointer allow NULL to use a\n default allocator.\n\n The interface is based on the Zig allocator interface. I'll say up front\n that it is easy to look at this interface and think \"wow, this is really\n overcomplicated\". The reason for this complexity is well thought out by\n the Zig folks, and it enables a diverse set of allocation strategies\n as shown by the Zig ecosystem. As a consolation, please note that many\n of the arguments are only needed for advanced use cases and can be\n safely ignored in simple implementations. For example, if you look at\n the Zig implementation of the libc allocator in `lib/std/heap.zig`\n (search for CAllocator), you'll see it is very simple.\n\n We chose to align with the Zig allocator interface because:\n\n 1. It is a proven interface that serves a wide variety of use cases\n in the real world via the Zig ecosystem. It's shown to work.\n\n 2. Our core implementation itself is Zig, and this lets us very\n cheaply and easily convert between C and Zig allocators.\n\n NOTE(mitchellh): In the future, we can have default implementations of\n resize/remap and allow those to be null."]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyAllocatorVtable {
+ #[doc = " Return a pointer to `len` bytes with specified `alignment`, or return\n `NULL` indicating the allocation failed.\n\n @param ctx The allocator context\n @param len Number of bytes to allocate\n @param alignment Required alignment for the allocation. Guaranteed to\n be a power of two between 1 and 16 inclusive.\n @param ret_addr First return address of the allocation call stack (0 if not provided)\n @return Pointer to allocated memory, or NULL if allocation failed"]
+ pub alloc: ::std::option::Option<
+ unsafe extern "C" fn(
+ ctx: *mut ::std::os::raw::c_void,
+ len: usize,
+ alignment: u8,
+ ret_addr: usize,
+ ) -> *mut ::std::os::raw::c_void,
+ >,
+ #[doc = " Attempt to expand or shrink memory in place.\n\n `memory_len` must equal the length requested from the most recent\n successful call to `alloc`, `resize`, or `remap`. `alignment` must\n equal the same value that was passed as the `alignment` parameter to\n the original `alloc` call.\n\n `new_len` must be greater than zero.\n\n @param ctx The allocator context\n @param memory Pointer to the memory block to resize\n @param memory_len Current size of the memory block\n @param alignment Alignment (must match original allocation)\n @param new_len New requested size\n @param ret_addr First return address of the allocation call stack (0 if not provided)\n @return true if resize was successful in-place, false if relocation would be required"]
+ pub resize: ::std::option::Option<
+ unsafe extern "C" fn(
+ ctx: *mut ::std::os::raw::c_void,
+ memory: *mut ::std::os::raw::c_void,
+ memory_len: usize,
+ alignment: u8,
+ new_len: usize,
+ ret_addr: usize,
+ ) -> bool,
+ >,
+ #[doc = " Attempt to expand or shrink memory, allowing relocation.\n\n `memory_len` must equal the length requested from the most recent\n successful call to `alloc`, `resize`, or `remap`. `alignment` must\n equal the same value that was passed as the `alignment` parameter to\n the original `alloc` call.\n\n A non-`NULL` return value indicates the resize was successful. The\n allocation may have same address, or may have been relocated. In either\n case, the allocation now has size of `new_len`. A `NULL` return value\n indicates that the resize would be equivalent to allocating new memory,\n copying the bytes from the old memory, and then freeing the old memory.\n In such case, it is more efficient for the caller to perform the copy.\n\n `new_len` must be greater than zero.\n\n @param ctx The allocator context\n @param memory Pointer to the memory block to remap\n @param memory_len Current size of the memory block\n @param alignment Alignment (must match original allocation)\n @param new_len New requested size\n @param ret_addr First return address of the allocation call stack (0 if not provided)\n @return Pointer to resized memory (may be relocated), or NULL if manual copy is needed"]
+ pub remap: ::std::option::Option<
+ unsafe extern "C" fn(
+ ctx: *mut ::std::os::raw::c_void,
+ memory: *mut ::std::os::raw::c_void,
+ memory_len: usize,
+ alignment: u8,
+ new_len: usize,
+ ret_addr: usize,
+ ) -> *mut ::std::os::raw::c_void,
+ >,
+ #[doc = " Free and invalidate a region of memory.\n\n `memory_len` must equal the length requested from the most recent\n successful call to `alloc`, `resize`, or `remap`. `alignment` must\n equal the same value that was passed as the `alignment` parameter to\n the original `alloc` call.\n\n @param ctx The allocator context\n @param memory Pointer to the memory block to free\n @param memory_len Size of the memory block\n @param alignment Alignment (must match original allocation)\n @param ret_addr First return address of the allocation call stack (0 if not provided)"]
+ pub free: ::std::option::Option<
+ unsafe extern "C" fn(
+ ctx: *mut ::std::os::raw::c_void,
+ memory: *mut ::std::os::raw::c_void,
+ memory_len: usize,
+ alignment: u8,
+ ret_addr: usize,
+ ),
+ >,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyAllocatorVtable"][::std::mem::size_of::() - 32usize];
+ ["Alignment of GhosttyAllocatorVtable"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyAllocatorVtable::alloc"]
+ [::std::mem::offset_of!(GhosttyAllocatorVtable, alloc) - 0usize];
+ ["Offset of field: GhosttyAllocatorVtable::resize"]
+ [::std::mem::offset_of!(GhosttyAllocatorVtable, resize) - 8usize];
+ ["Offset of field: GhosttyAllocatorVtable::remap"]
+ [::std::mem::offset_of!(GhosttyAllocatorVtable, remap) - 16usize];
+ ["Offset of field: GhosttyAllocatorVtable::free"]
+ [::std::mem::offset_of!(GhosttyAllocatorVtable, free) - 24usize];
+};
+#[doc = " Custom memory allocator.\n\n For functions that take an allocator pointer, a NULL pointer indicates\n that the default allocator should be used. The default allocator will\n be libc malloc/free if we're linking to libc. If libc isn't linked,\n a custom allocator is used (currently Zig's SMP allocator).\n\n @ingroup allocator\n\n Usage example:\n @code\n GhosttyAllocator allocator = {\n .vtable = &my_allocator_vtable,\n .ctx = my_allocator_state\n };\n @endcode"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyAllocator {
+ #[doc = " Opaque context pointer passed to all vtable functions.\n This allows the allocator implementation to maintain state\n or reference external resources needed for memory management."]
+ pub ctx: *mut ::std::os::raw::c_void,
+ #[doc = " Pointer to the allocator's vtable containing function pointers\n for memory operations (alloc, resize, remap, free)."]
+ pub vtable: *const GhosttyAllocatorVtable,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyAllocator"][::std::mem::size_of::() - 16usize];
+ ["Alignment of GhosttyAllocator"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyAllocator::ctx"]
+ [::std::mem::offset_of!(GhosttyAllocator, ctx) - 0usize];
+ ["Offset of field: GhosttyAllocator::vtable"]
+ [::std::mem::offset_of!(GhosttyAllocator, vtable) - 8usize];
+};
+impl Default for GhosttyAllocator {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+unsafe extern "C" {
+ #[doc = " Allocate a buffer of `len` bytes.\n\n Uses the provided allocator, or the default allocator if NULL is passed.\n The returned buffer must be freed with ghostty_free() using the same\n allocator.\n\n @param allocator Pointer to the allocator to use, or NULL for the default\n @param len Number of bytes to allocate\n @return Pointer to the allocated buffer, or NULL if allocation failed\n\n @ingroup allocator"]
+ pub fn ghostty_alloc(allocator: *const GhosttyAllocator, len: usize) -> *mut u8;
+}
+unsafe extern "C" {
+ #[doc = " Free memory that was allocated by a libghostty-vt function.\n\n Use this to free buffers returned by functions such as\n ghostty_formatter_format_alloc(). Pass the same allocator that was\n used for the allocation, or NULL if the default allocator was used.\n\n On platforms where the library's internal allocator differs from the\n consumer's C runtime (e.g. Windows, where Zig's libc and MSVC's CRT\n maintain separate heaps), calling the standard C free() on memory\n allocated by the library causes undefined behavior. This function\n guarantees the correct allocator is used regardless of platform.\n\n It is safe to pass a NULL pointer; the call is a no-op in that case.\n\n @param allocator Pointer to the allocator that was used to allocate the\n memory, or NULL if the default allocator was used\n @param ptr Pointer to the memory to free (may be NULL)\n @param len Length of the allocation in bytes (must match the original\n allocation size)\n\n @ingroup allocator"]
+ pub fn ghostty_free(allocator: *const GhosttyAllocator, ptr: *mut u8, len: usize);
+}
+pub const GhosttyOptimizeMode_GHOSTTY_OPTIMIZE_DEBUG: GhosttyOptimizeMode = 0;
+pub const GhosttyOptimizeMode_GHOSTTY_OPTIMIZE_RELEASE_SAFE: GhosttyOptimizeMode = 1;
+pub const GhosttyOptimizeMode_GHOSTTY_OPTIMIZE_RELEASE_SMALL: GhosttyOptimizeMode = 2;
+pub const GhosttyOptimizeMode_GHOSTTY_OPTIMIZE_RELEASE_FAST: GhosttyOptimizeMode = 3;
+#[doc = " Build optimization mode."]
+pub type GhosttyOptimizeMode = ::std::os::raw::c_uint;
+#[doc = " Invalid data type. Never results in any data extraction."]
+pub const GhosttyBuildInfo_GHOSTTY_BUILD_INFO_INVALID: GhosttyBuildInfo = 0;
+#[doc = " Whether SIMD-accelerated code paths are enabled.\n\n Output type: bool *"]
+pub const GhosttyBuildInfo_GHOSTTY_BUILD_INFO_SIMD: GhosttyBuildInfo = 1;
+#[doc = " Whether Kitty graphics protocol support is available.\n\n Output type: bool *"]
+pub const GhosttyBuildInfo_GHOSTTY_BUILD_INFO_KITTY_GRAPHICS: GhosttyBuildInfo = 2;
+#[doc = " Whether tmux control mode support is available.\n\n Output type: bool *"]
+pub const GhosttyBuildInfo_GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE: GhosttyBuildInfo = 3;
+#[doc = " The optimization mode the library was built with.\n\n Output type: GhosttyOptimizeMode *"]
+pub const GhosttyBuildInfo_GHOSTTY_BUILD_INFO_OPTIMIZE: GhosttyBuildInfo = 4;
+#[doc = " Build info data types that can be queried.\n\n Each variant documents the expected output pointer type."]
+pub type GhosttyBuildInfo = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Query a compile-time build configuration value.\n\n The caller must pass a pointer to the correct output type for the\n requested data (see GhosttyBuildInfo variants for types).\n\n @param data The build info field to query\n @param out Pointer to store the result (type depends on data parameter)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the\n data type is invalid\n\n @ingroup build_info"]
+ pub fn ghostty_build_info(
+ data: GhosttyBuildInfo,
+ out: *mut ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+#[doc = " RGB color value.\n\n @ingroup sgr"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyColorRgb {
+ #[doc = "< Red component (0-255)"]
+ pub r: u8,
+ #[doc = "< Green component (0-255)"]
+ pub g: u8,
+ #[doc = "< Blue component (0-255)"]
+ pub b: u8,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyColorRgb"][::std::mem::size_of::() - 3usize];
+ ["Alignment of GhosttyColorRgb"][::std::mem::align_of::() - 1usize];
+ ["Offset of field: GhosttyColorRgb::r"][::std::mem::offset_of!(GhosttyColorRgb, r) - 0usize];
+ ["Offset of field: GhosttyColorRgb::g"][::std::mem::offset_of!(GhosttyColorRgb, g) - 1usize];
+ ["Offset of field: GhosttyColorRgb::b"][::std::mem::offset_of!(GhosttyColorRgb, b) - 2usize];
+};
+#[doc = " Palette color index (0-255).\n\n @ingroup sgr"]
+pub type GhosttyColorPaletteIndex = u8;
+unsafe extern "C" {
+ #[doc = " Get the RGB color components.\n\n This function extracts the individual red, green, and blue components\n from a GhosttyColorRgb value. Primarily useful in WebAssembly environments\n where accessing struct fields directly is difficult.\n\n @param color The RGB color value\n @param r Pointer to store the red component (0-255)\n @param g Pointer to store the green component (0-255)\n @param b Pointer to store the blue component (0-255)\n\n @ingroup sgr"]
+ pub fn ghostty_color_rgb_get(color: GhosttyColorRgb, r: *mut u8, g: *mut u8, b: *mut u8);
+}
+pub const GhosttyColorScheme_GHOSTTY_COLOR_SCHEME_LIGHT: GhosttyColorScheme = 0;
+pub const GhosttyColorScheme_GHOSTTY_COLOR_SCHEME_DARK: GhosttyColorScheme = 1;
+#[doc = " Color scheme reported in response to a CSI ? 996 n query.\n\n @ingroup terminal"]
+pub type GhosttyColorScheme = ::std::os::raw::c_uint;
+#[doc = " Primary device attributes (DA1) response data.\n\n Returned as part of GhosttyDeviceAttributes in response to a CSI c query.\n The conformance_level is the Pp parameter and features contains the Ps\n feature codes.\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyDeviceAttributesPrimary {
+ #[doc = " Conformance level (Pp parameter). E.g. 62 for VT220."]
+ pub conformance_level: u16,
+ #[doc = " DA1 feature codes. Only the first num_features entries are valid."]
+ pub features: [u16; 64usize],
+ #[doc = " Number of valid entries in the features array."]
+ pub num_features: usize,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyDeviceAttributesPrimary"]
+ [::std::mem::size_of::() - 144usize];
+ ["Alignment of GhosttyDeviceAttributesPrimary"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyDeviceAttributesPrimary::conformance_level"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributesPrimary, conformance_level) - 0usize];
+ ["Offset of field: GhosttyDeviceAttributesPrimary::features"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributesPrimary, features) - 2usize];
+ ["Offset of field: GhosttyDeviceAttributesPrimary::num_features"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributesPrimary, num_features) - 136usize];
+};
+impl Default for GhosttyDeviceAttributesPrimary {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " Secondary device attributes (DA2) response data.\n\n Returned as part of GhosttyDeviceAttributes in response to a CSI > c query.\n Response format: CSI > Pp ; Pv ; Pc c\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyDeviceAttributesSecondary {
+ #[doc = " Terminal type identifier (Pp). E.g. 1 for VT220."]
+ pub device_type: u16,
+ #[doc = " Firmware/patch version number (Pv)."]
+ pub firmware_version: u16,
+ #[doc = " ROM cartridge registration number (Pc). Always 0 for emulators."]
+ pub rom_cartridge: u16,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyDeviceAttributesSecondary"]
+ [::std::mem::size_of::() - 6usize];
+ ["Alignment of GhosttyDeviceAttributesSecondary"]
+ [::std::mem::align_of::() - 2usize];
+ ["Offset of field: GhosttyDeviceAttributesSecondary::device_type"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributesSecondary, device_type) - 0usize];
+ ["Offset of field: GhosttyDeviceAttributesSecondary::firmware_version"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributesSecondary, firmware_version) - 2usize];
+ ["Offset of field: GhosttyDeviceAttributesSecondary::rom_cartridge"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributesSecondary, rom_cartridge) - 4usize];
+};
+#[doc = " Tertiary device attributes (DA3) response data.\n\n Returned as part of GhosttyDeviceAttributes in response to a CSI = c query.\n Response format: DCS ! | D...D ST (DECRPTUI).\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyDeviceAttributesTertiary {
+ #[doc = " Unit ID encoded as 8 uppercase hex digits in the response."]
+ pub unit_id: u32,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyDeviceAttributesTertiary"]
+ [::std::mem::size_of::() - 4usize];
+ ["Alignment of GhosttyDeviceAttributesTertiary"]
+ [::std::mem::align_of::() - 4usize];
+ ["Offset of field: GhosttyDeviceAttributesTertiary::unit_id"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributesTertiary, unit_id) - 0usize];
+};
+#[doc = " Device attributes response data for all three DA levels.\n\n Filled by the device_attributes callback in response to CSI c,\n CSI > c, or CSI = c queries. The terminal uses whichever sub-struct\n matches the request type.\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyDeviceAttributes {
+ pub primary: GhosttyDeviceAttributesPrimary,
+ pub secondary: GhosttyDeviceAttributesSecondary,
+ pub tertiary: GhosttyDeviceAttributesTertiary,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyDeviceAttributes"]
+ [::std::mem::size_of::() - 160usize];
+ ["Alignment of GhosttyDeviceAttributes"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyDeviceAttributes::primary"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributes, primary) - 0usize];
+ ["Offset of field: GhosttyDeviceAttributes::secondary"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributes, secondary) - 144usize];
+ ["Offset of field: GhosttyDeviceAttributes::tertiary"]
+ [::std::mem::offset_of!(GhosttyDeviceAttributes, tertiary) - 152usize];
+};
+impl Default for GhosttyDeviceAttributes {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " Terminal window gained focus"]
+pub const GhosttyFocusEvent_GHOSTTY_FOCUS_GAINED: GhosttyFocusEvent = 0;
+#[doc = " Terminal window lost focus"]
+pub const GhosttyFocusEvent_GHOSTTY_FOCUS_LOST: GhosttyFocusEvent = 1;
+#[doc = " Focus event types for focus reporting mode (mode 1004)."]
+pub type GhosttyFocusEvent = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Encode a focus event into a terminal escape sequence.\n\n Encodes a focus gained (CSI I) or focus lost (CSI O) report into the\n provided buffer.\n\n If the buffer is too small, the function returns GHOSTTY_OUT_OF_SPACE\n and writes the required buffer size to @p out_written. The caller can\n then retry with a sufficiently sized buffer.\n\n @param event The focus event to encode\n @param buf Output buffer to write the encoded sequence into (may be NULL)\n @param buf_len Size of the output buffer in bytes\n @param[out] out_written On success, the number of bytes written. On\n GHOSTTY_OUT_OF_SPACE, the required buffer size.\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer\n is too small"]
+ pub fn ghostty_focus_encode(
+ event: GhosttyFocusEvent,
+ buf: *mut ::std::os::raw::c_char,
+ buf_len: usize,
+ out_written: *mut usize,
+ ) -> GhosttyResult;
+}
+#[doc = " A packed 16-bit terminal mode.\n\n Encodes a mode value (bits 0–14) and an ANSI flag (bit 15) into a\n single 16-bit integer. Use the inline helper functions to construct\n and inspect modes rather than manipulating bits directly."]
+pub type GhosttyMode = u16;
+#[doc = " Mode is not recognized"]
+pub const GhosttyModeReportState_GHOSTTY_MODE_REPORT_NOT_RECOGNIZED: GhosttyModeReportState = 0;
+#[doc = " Mode is set (enabled)"]
+pub const GhosttyModeReportState_GHOSTTY_MODE_REPORT_SET: GhosttyModeReportState = 1;
+#[doc = " Mode is reset (disabled)"]
+pub const GhosttyModeReportState_GHOSTTY_MODE_REPORT_RESET: GhosttyModeReportState = 2;
+#[doc = " Mode is permanently set"]
+pub const GhosttyModeReportState_GHOSTTY_MODE_REPORT_PERMANENTLY_SET: GhosttyModeReportState = 3;
+#[doc = " Mode is permanently reset"]
+pub const GhosttyModeReportState_GHOSTTY_MODE_REPORT_PERMANENTLY_RESET: GhosttyModeReportState = 4;
+#[doc = " DECRPM report state values.\n\n These correspond to the Ps2 parameter in a DECRPM response\n sequence (CSI ? Ps1 ; Ps2 $ y)."]
+pub type GhosttyModeReportState = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Encode a DECRPM (DEC Private Mode Report) response sequence.\n\n Writes a mode report escape sequence into the provided buffer.\n The generated sequence has the form:\n - DEC private mode: CSI ? Ps1 ; Ps2 $ y\n - ANSI mode: CSI Ps1 ; Ps2 $ y\n\n If the buffer is too small, the function returns GHOSTTY_OUT_OF_SPACE\n and writes the required buffer size to @p out_written. The caller can\n then retry with a sufficiently sized buffer.\n\n @param mode The mode identifying the mode to report on\n @param state The report state for this mode\n @param buf Output buffer to write the encoded sequence into (may be NULL)\n @param buf_len Size of the output buffer in bytes\n @param[out] out_written On success, the number of bytes written. On\n GHOSTTY_OUT_OF_SPACE, the required buffer size.\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer\n is too small"]
+ pub fn ghostty_mode_report_encode(
+ mode: GhosttyMode,
+ state: GhosttyModeReportState,
+ buf: *mut ::std::os::raw::c_char,
+ buf_len: usize,
+ out_written: *mut usize,
+ ) -> GhosttyResult;
+}
+#[doc = " In-band size report (mode 2048): ESC [ 48 ; rows ; cols ; height ; width t"]
+pub const GhosttySizeReportStyle_GHOSTTY_SIZE_REPORT_MODE_2048: GhosttySizeReportStyle = 0;
+#[doc = " XTWINOPS text area size in pixels: ESC [ 4 ; height ; width t"]
+pub const GhosttySizeReportStyle_GHOSTTY_SIZE_REPORT_CSI_14_T: GhosttySizeReportStyle = 1;
+#[doc = " XTWINOPS cell size in pixels: ESC [ 6 ; height ; width t"]
+pub const GhosttySizeReportStyle_GHOSTTY_SIZE_REPORT_CSI_16_T: GhosttySizeReportStyle = 2;
+#[doc = " XTWINOPS text area size in characters: ESC [ 8 ; rows ; cols t"]
+pub const GhosttySizeReportStyle_GHOSTTY_SIZE_REPORT_CSI_18_T: GhosttySizeReportStyle = 3;
+#[doc = " Size report style.\n\n Determines the output format for the terminal size report."]
+pub type GhosttySizeReportStyle = ::std::os::raw::c_uint;
+#[doc = " Terminal size information for encoding size reports."]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttySizeReportSize {
+ #[doc = " Terminal row count in cells."]
+ pub rows: u16,
+ #[doc = " Terminal column count in cells."]
+ pub columns: u16,
+ #[doc = " Width of a single terminal cell in pixels."]
+ pub cell_width: u32,
+ #[doc = " Height of a single terminal cell in pixels."]
+ pub cell_height: u32,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttySizeReportSize"][::std::mem::size_of::() - 12usize];
+ ["Alignment of GhosttySizeReportSize"]
+ [::std::mem::align_of::() - 4usize];
+ ["Offset of field: GhosttySizeReportSize::rows"]
+ [::std::mem::offset_of!(GhosttySizeReportSize, rows) - 0usize];
+ ["Offset of field: GhosttySizeReportSize::columns"]
+ [::std::mem::offset_of!(GhosttySizeReportSize, columns) - 2usize];
+ ["Offset of field: GhosttySizeReportSize::cell_width"]
+ [::std::mem::offset_of!(GhosttySizeReportSize, cell_width) - 4usize];
+ ["Offset of field: GhosttySizeReportSize::cell_height"]
+ [::std::mem::offset_of!(GhosttySizeReportSize, cell_height) - 8usize];
+};
+unsafe extern "C" {
+ #[doc = " Encode a terminal size report into an escape sequence.\n\n Encodes a size report in the format specified by @p style into the\n provided buffer.\n\n If the buffer is too small, the function returns GHOSTTY_OUT_OF_SPACE\n and writes the required buffer size to @p out_written. The caller can\n then retry with a sufficiently sized buffer.\n\n @param style The size report format to encode\n @param size Terminal size information\n @param buf Output buffer to write the encoded sequence into (may be NULL)\n @param buf_len Size of the output buffer in bytes\n @param[out] out_written On success, the number of bytes written. On\n GHOSTTY_OUT_OF_SPACE, the required buffer size.\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer\n is too small"]
+ pub fn ghostty_size_report_encode(
+ style: GhosttySizeReportStyle,
+ size: GhosttySizeReportSize,
+ buf: *mut ::std::os::raw::c_char,
+ buf_len: usize,
+ out_written: *mut usize,
+ ) -> GhosttyResult;
+}
+#[doc = " Opaque cell value.\n\n Represents a single terminal cell. The internal layout is opaque and\n must be queried via ghostty_cell_get(). Obtain cell values from\n terminal query APIs.\n\n @ingroup screen"]
+pub type GhosttyCell = u64;
+#[doc = " Opaque row value.\n\n Represents a single terminal row. The internal layout is opaque and\n must be queried via ghostty_row_get(). Obtain row values from\n terminal query APIs.\n\n @ingroup screen"]
+pub type GhosttyRow = u64;
+#[doc = " A single codepoint (may be zero for empty)."]
+pub const GhosttyCellContentTag_GHOSTTY_CELL_CONTENT_CODEPOINT: GhosttyCellContentTag = 0;
+#[doc = " A codepoint that is part of a multi-codepoint grapheme cluster."]
+pub const GhosttyCellContentTag_GHOSTTY_CELL_CONTENT_CODEPOINT_GRAPHEME: GhosttyCellContentTag = 1;
+#[doc = " No text; background color from palette."]
+pub const GhosttyCellContentTag_GHOSTTY_CELL_CONTENT_BG_COLOR_PALETTE: GhosttyCellContentTag = 2;
+#[doc = " No text; background color as RGB."]
+pub const GhosttyCellContentTag_GHOSTTY_CELL_CONTENT_BG_COLOR_RGB: GhosttyCellContentTag = 3;
+#[doc = " Cell content tag.\n\n Describes what kind of content a cell holds.\n\n @ingroup screen"]
+pub type GhosttyCellContentTag = ::std::os::raw::c_uint;
+#[doc = " Not a wide character, cell width 1."]
+pub const GhosttyCellWide_GHOSTTY_CELL_WIDE_NARROW: GhosttyCellWide = 0;
+#[doc = " Wide character, cell width 2."]
+pub const GhosttyCellWide_GHOSTTY_CELL_WIDE_WIDE: GhosttyCellWide = 1;
+#[doc = " Spacer after wide character. Do not render."]
+pub const GhosttyCellWide_GHOSTTY_CELL_WIDE_SPACER_TAIL: GhosttyCellWide = 2;
+#[doc = " Spacer at end of soft-wrapped line for a wide character."]
+pub const GhosttyCellWide_GHOSTTY_CELL_WIDE_SPACER_HEAD: GhosttyCellWide = 3;
+#[doc = " Cell wide property.\n\n Describes the width behavior of a cell.\n\n @ingroup screen"]
+pub type GhosttyCellWide = ::std::os::raw::c_uint;
+#[doc = " Regular output content, such as command output."]
+pub const GhosttyCellSemanticContent_GHOSTTY_CELL_SEMANTIC_OUTPUT: GhosttyCellSemanticContent = 0;
+#[doc = " Content that is part of user input."]
+pub const GhosttyCellSemanticContent_GHOSTTY_CELL_SEMANTIC_INPUT: GhosttyCellSemanticContent = 1;
+#[doc = " Content that is part of a shell prompt."]
+pub const GhosttyCellSemanticContent_GHOSTTY_CELL_SEMANTIC_PROMPT: GhosttyCellSemanticContent = 2;
+#[doc = " Semantic content type of a cell.\n\n Set by semantic prompt sequences (OSC 133) to distinguish between\n command output, user input, and shell prompt text.\n\n @ingroup screen"]
+pub type GhosttyCellSemanticContent = ::std::os::raw::c_uint;
+#[doc = " Invalid data type. Never results in any data extraction."]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_INVALID: GhosttyCellData = 0;
+#[doc = " The codepoint of the cell (0 if empty or bg-color-only).\n\n Output type: uint32_t *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_CODEPOINT: GhosttyCellData = 1;
+#[doc = " The content tag describing what kind of content is in the cell.\n\n Output type: GhosttyCellContentTag *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_CONTENT_TAG: GhosttyCellData = 2;
+#[doc = " The wide property of the cell.\n\n Output type: GhosttyCellWide *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_WIDE: GhosttyCellData = 3;
+#[doc = " Whether the cell has text to render.\n\n Output type: bool *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_HAS_TEXT: GhosttyCellData = 4;
+#[doc = " Whether the cell has non-default styling.\n\n Output type: bool *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_HAS_STYLING: GhosttyCellData = 5;
+#[doc = " The style ID for the cell (for use with style lookups).\n\n Output type: uint16_t *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_STYLE_ID: GhosttyCellData = 6;
+#[doc = " Whether the cell has a hyperlink.\n\n Output type: bool *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_HAS_HYPERLINK: GhosttyCellData = 7;
+#[doc = " Whether the cell is protected.\n\n Output type: bool *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_PROTECTED: GhosttyCellData = 8;
+#[doc = " The semantic content type of the cell (from OSC 133).\n\n Output type: GhosttyCellSemanticContent *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_SEMANTIC_CONTENT: GhosttyCellData = 9;
+#[doc = " The palette index for the cell's background color.\n Only valid when content_tag is GHOSTTY_CELL_CONTENT_BG_COLOR_PALETTE.\n\n Output type: GhosttyColorPaletteIndex *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_COLOR_PALETTE: GhosttyCellData = 10;
+#[doc = " The RGB value for the cell's background color.\n Only valid when content_tag is GHOSTTY_CELL_CONTENT_BG_COLOR_RGB.\n\n Output type: GhosttyColorRgb *"]
+pub const GhosttyCellData_GHOSTTY_CELL_DATA_COLOR_RGB: GhosttyCellData = 11;
+#[doc = " Cell data types.\n\n These values specify what type of data to extract from a cell\n using `ghostty_cell_get`.\n\n @ingroup screen"]
+pub type GhosttyCellData = ::std::os::raw::c_uint;
+#[doc = " No prompt cells in this row."]
+pub const GhosttyRowSemanticPrompt_GHOSTTY_ROW_SEMANTIC_NONE: GhosttyRowSemanticPrompt = 0;
+#[doc = " Prompt cells exist and this is a primary prompt line."]
+pub const GhosttyRowSemanticPrompt_GHOSTTY_ROW_SEMANTIC_PROMPT: GhosttyRowSemanticPrompt = 1;
+#[doc = " Prompt cells exist and this is a continuation line."]
+pub const GhosttyRowSemanticPrompt_GHOSTTY_ROW_SEMANTIC_PROMPT_CONTINUATION:
+ GhosttyRowSemanticPrompt = 2;
+#[doc = " Row semantic prompt state.\n\n Indicates whether any cells in a row are part of a shell prompt,\n as reported by OSC 133 sequences.\n\n @ingroup screen"]
+pub type GhosttyRowSemanticPrompt = ::std::os::raw::c_uint;
+#[doc = " Invalid data type. Never results in any data extraction."]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_INVALID: GhosttyRowData = 0;
+#[doc = " Whether this row is soft-wrapped.\n\n Output type: bool *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_WRAP: GhosttyRowData = 1;
+#[doc = " Whether this row is a continuation of a soft-wrapped row.\n\n Output type: bool *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_WRAP_CONTINUATION: GhosttyRowData = 2;
+#[doc = " Whether any cells in this row have grapheme clusters.\n\n Output type: bool *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_GRAPHEME: GhosttyRowData = 3;
+#[doc = " Whether any cells in this row have styling (may have false positives).\n\n Output type: bool *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_STYLED: GhosttyRowData = 4;
+#[doc = " Whether any cells in this row have hyperlinks (may have false positives).\n\n Output type: bool *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_HYPERLINK: GhosttyRowData = 5;
+#[doc = " The semantic prompt state of this row.\n\n Output type: GhosttyRowSemanticPrompt *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_SEMANTIC_PROMPT: GhosttyRowData = 6;
+#[doc = " Whether this row contains a Kitty virtual placeholder.\n\n Output type: bool *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_KITTY_VIRTUAL_PLACEHOLDER: GhosttyRowData = 7;
+#[doc = " Whether this row is dirty and requires a redraw.\n\n Output type: bool *"]
+pub const GhosttyRowData_GHOSTTY_ROW_DATA_DIRTY: GhosttyRowData = 8;
+#[doc = " Row data types.\n\n These values specify what type of data to extract from a row\n using `ghostty_row_get`.\n\n @ingroup screen"]
+pub type GhosttyRowData = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Get data from a cell.\n\n Extracts typed data from the given cell based on the specified\n data type. The output pointer must be of the appropriate type for the\n requested data kind. Valid data types and output types are documented\n in the `GhosttyCellData` enum.\n\n @param cell The cell value\n @param data The type of data to extract\n @param out Pointer to store the extracted data (type depends on data parameter)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the\n data type is invalid\n\n @ingroup screen"]
+ pub fn ghostty_cell_get(
+ cell: GhosttyCell,
+ data: GhosttyCellData,
+ out: *mut ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get data from a row.\n\n Extracts typed data from the given row based on the specified\n data type. The output pointer must be of the appropriate type for the\n requested data kind. Valid data types and output types are documented\n in the `GhosttyRowData` enum.\n\n @param row The row value\n @param data The type of data to extract\n @param out Pointer to store the extracted data (type depends on data parameter)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the\n data type is invalid\n\n @ingroup screen"]
+ pub fn ghostty_row_get(
+ row: GhosttyRow,
+ data: GhosttyRowData,
+ out: *mut ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+#[doc = " Style identifier type.\n\n Used to look up the full style from a grid reference.\n Obtain this from a cell via GHOSTTY_CELL_DATA_STYLE_ID.\n\n @ingroup style"]
+pub type GhosttyStyleId = u16;
+pub const GhosttyStyleColorTag_GHOSTTY_STYLE_COLOR_NONE: GhosttyStyleColorTag = 0;
+pub const GhosttyStyleColorTag_GHOSTTY_STYLE_COLOR_PALETTE: GhosttyStyleColorTag = 1;
+pub const GhosttyStyleColorTag_GHOSTTY_STYLE_COLOR_RGB: GhosttyStyleColorTag = 2;
+#[doc = " Style color tags.\n\n These values identify the type of color in a style color.\n Use the tag to determine which field in the color value union to access.\n\n @ingroup style"]
+pub type GhosttyStyleColorTag = ::std::os::raw::c_uint;
+#[doc = " Style color value union.\n\n Use the tag to determine which field is active.\n\n @ingroup style"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union GhosttyStyleColorValue {
+ pub palette: GhosttyColorPaletteIndex,
+ pub rgb: GhosttyColorRgb,
+ pub _padding: u64,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyStyleColorValue"][::std::mem::size_of::() - 8usize];
+ ["Alignment of GhosttyStyleColorValue"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyStyleColorValue::palette"]
+ [::std::mem::offset_of!(GhosttyStyleColorValue, palette) - 0usize];
+ ["Offset of field: GhosttyStyleColorValue::rgb"]
+ [::std::mem::offset_of!(GhosttyStyleColorValue, rgb) - 0usize];
+ ["Offset of field: GhosttyStyleColorValue::_padding"]
+ [::std::mem::offset_of!(GhosttyStyleColorValue, _padding) - 0usize];
+};
+impl Default for GhosttyStyleColorValue {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " Style color (tagged union).\n\n A color used in a style attribute. Can be unset (none), a palette\n index, or a direct RGB value.\n\n @ingroup style"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct GhosttyStyleColor {
+ pub tag: GhosttyStyleColorTag,
+ pub value: GhosttyStyleColorValue,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyStyleColor"][::std::mem::size_of::() - 16usize];
+ ["Alignment of GhosttyStyleColor"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyStyleColor::tag"]
+ [::std::mem::offset_of!(GhosttyStyleColor, tag) - 0usize];
+ ["Offset of field: GhosttyStyleColor::value"]
+ [::std::mem::offset_of!(GhosttyStyleColor, value) - 8usize];
+};
+impl Default for GhosttyStyleColor {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " Terminal cell style.\n\n Describes the complete visual style for a terminal cell, including\n foreground, background, and underline colors, as well as text\n decoration flags. The underline field uses the same values as\n GhosttySgrUnderline.\n\n This is a sized struct. Use GHOSTTY_INIT_SIZED() to initialize it.\n\n @ingroup style"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct GhosttyStyle {
+ pub size: usize,
+ pub fg_color: GhosttyStyleColor,
+ pub bg_color: GhosttyStyleColor,
+ pub underline_color: GhosttyStyleColor,
+ pub bold: bool,
+ pub italic: bool,
+ pub faint: bool,
+ pub blink: bool,
+ pub inverse: bool,
+ pub invisible: bool,
+ pub strikethrough: bool,
+ pub overline: bool,
+ #[doc = "< One of GHOSTTY_SGR_UNDERLINE_* values"]
+ pub underline: ::std::os::raw::c_int,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyStyle"][::std::mem::size_of::() - 72usize];
+ ["Alignment of GhosttyStyle"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyStyle::size"][::std::mem::offset_of!(GhosttyStyle, size) - 0usize];
+ ["Offset of field: GhosttyStyle::fg_color"]
+ [::std::mem::offset_of!(GhosttyStyle, fg_color) - 8usize];
+ ["Offset of field: GhosttyStyle::bg_color"]
+ [::std::mem::offset_of!(GhosttyStyle, bg_color) - 24usize];
+ ["Offset of field: GhosttyStyle::underline_color"]
+ [::std::mem::offset_of!(GhosttyStyle, underline_color) - 40usize];
+ ["Offset of field: GhosttyStyle::bold"][::std::mem::offset_of!(GhosttyStyle, bold) - 56usize];
+ ["Offset of field: GhosttyStyle::italic"]
+ [::std::mem::offset_of!(GhosttyStyle, italic) - 57usize];
+ ["Offset of field: GhosttyStyle::faint"][::std::mem::offset_of!(GhosttyStyle, faint) - 58usize];
+ ["Offset of field: GhosttyStyle::blink"][::std::mem::offset_of!(GhosttyStyle, blink) - 59usize];
+ ["Offset of field: GhosttyStyle::inverse"]
+ [::std::mem::offset_of!(GhosttyStyle, inverse) - 60usize];
+ ["Offset of field: GhosttyStyle::invisible"]
+ [::std::mem::offset_of!(GhosttyStyle, invisible) - 61usize];
+ ["Offset of field: GhosttyStyle::strikethrough"]
+ [::std::mem::offset_of!(GhosttyStyle, strikethrough) - 62usize];
+ ["Offset of field: GhosttyStyle::overline"]
+ [::std::mem::offset_of!(GhosttyStyle, overline) - 63usize];
+ ["Offset of field: GhosttyStyle::underline"]
+ [::std::mem::offset_of!(GhosttyStyle, underline) - 64usize];
+};
+impl Default for GhosttyStyle {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+unsafe extern "C" {
+ #[doc = " Get the default style.\n\n Initializes the style to the default values (no colors, no flags).\n\n @param style Pointer to the style to initialize\n\n @ingroup style"]
+ pub fn ghostty_style_default(style: *mut GhosttyStyle);
+}
+unsafe extern "C" {
+ #[doc = " Check if a style is the default style.\n\n Returns true if all colors are unset and all flags are off.\n\n @param style Pointer to the style to check\n @return true if the style is the default style\n\n @ingroup style"]
+ pub fn ghostty_style_is_default(style: *const GhosttyStyle) -> bool;
+}
+#[doc = " A resolved reference to a terminal cell position.\n\n This is a sized struct. Use GHOSTTY_INIT_SIZED() to initialize it.\n\n @ingroup grid_ref"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyGridRef {
+ pub size: usize,
+ pub node: *mut ::std::os::raw::c_void,
+ pub x: u16,
+ pub y: u16,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyGridRef"][::std::mem::size_of::() - 24usize];
+ ["Alignment of GhosttyGridRef"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyGridRef::size"]
+ [::std::mem::offset_of!(GhosttyGridRef, size) - 0usize];
+ ["Offset of field: GhosttyGridRef::node"]
+ [::std::mem::offset_of!(GhosttyGridRef, node) - 8usize];
+ ["Offset of field: GhosttyGridRef::x"][::std::mem::offset_of!(GhosttyGridRef, x) - 16usize];
+ ["Offset of field: GhosttyGridRef::y"][::std::mem::offset_of!(GhosttyGridRef, y) - 18usize];
+};
+impl Default for GhosttyGridRef {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+unsafe extern "C" {
+ #[doc = " Get the cell from a grid reference.\n\n @param ref Pointer to the grid reference\n @param[out] out_cell On success, set to the cell at the ref's position (may be NULL)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's\n node is NULL\n\n @ingroup grid_ref"]
+ pub fn ghostty_grid_ref_cell(
+ ref_: *const GhosttyGridRef,
+ out_cell: *mut GhosttyCell,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get the row from a grid reference.\n\n @param ref Pointer to the grid reference\n @param[out] out_row On success, set to the row at the ref's position (may be NULL)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's\n node is NULL\n\n @ingroup grid_ref"]
+ pub fn ghostty_grid_ref_row(
+ ref_: *const GhosttyGridRef,
+ out_row: *mut GhosttyRow,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get the grapheme cluster codepoints for the cell at the grid reference's\n position.\n\n Writes the full grapheme cluster (the cell's primary codepoint followed by\n any combining codepoints) into the provided buffer. If the cell has no text,\n out_len is set to 0 and GHOSTTY_SUCCESS is returned.\n\n If the buffer is too small (or NULL), the function returns\n GHOSTTY_OUT_OF_SPACE and writes the required number of codepoints to\n out_len. The caller can then retry with a sufficiently sized buffer.\n\n @param ref Pointer to the grid reference\n @param buf Output buffer of uint32_t codepoints (may be NULL)\n @param buf_len Number of uint32_t elements in the buffer\n @param[out] out_len On success, the number of codepoints written. On\n GHOSTTY_OUT_OF_SPACE, the required buffer size in codepoints.\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's\n node is NULL, GHOSTTY_OUT_OF_SPACE if the buffer is too small\n\n @ingroup grid_ref"]
+ pub fn ghostty_grid_ref_graphemes(
+ ref_: *const GhosttyGridRef,
+ buf: *mut u32,
+ buf_len: usize,
+ out_len: *mut usize,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get the style of the cell at the grid reference's position.\n\n @param ref Pointer to the grid reference\n @param[out] out_style On success, set to the cell's style (may be NULL)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's\n node is NULL\n\n @ingroup grid_ref"]
+ pub fn ghostty_grid_ref_style(
+ ref_: *const GhosttyGridRef,
+ out_style: *mut GhosttyStyle,
+ ) -> GhosttyResult;
+}
+#[doc = " A coordinate in the terminal grid.\n\n @ingroup point"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyPointCoordinate {
+ #[doc = " Column (0-indexed)."]
+ pub x: u16,
+ #[doc = " Row (0-indexed). May exceed page size for screen/history tags."]
+ pub y: u32,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyPointCoordinate"][::std::mem::size_of::() - 8usize];
+ ["Alignment of GhosttyPointCoordinate"]
+ [::std::mem::align_of::() - 4usize];
+ ["Offset of field: GhosttyPointCoordinate::x"]
+ [::std::mem::offset_of!(GhosttyPointCoordinate, x) - 0usize];
+ ["Offset of field: GhosttyPointCoordinate::y"]
+ [::std::mem::offset_of!(GhosttyPointCoordinate, y) - 4usize];
+};
+#[doc = " Active area where the cursor can move."]
+pub const GhosttyPointTag_GHOSTTY_POINT_TAG_ACTIVE: GhosttyPointTag = 0;
+#[doc = " Visible viewport (changes when scrolled)."]
+pub const GhosttyPointTag_GHOSTTY_POINT_TAG_VIEWPORT: GhosttyPointTag = 1;
+#[doc = " Full screen including scrollback."]
+pub const GhosttyPointTag_GHOSTTY_POINT_TAG_SCREEN: GhosttyPointTag = 2;
+#[doc = " Scrollback history only (before active area)."]
+pub const GhosttyPointTag_GHOSTTY_POINT_TAG_HISTORY: GhosttyPointTag = 3;
+#[doc = " Point reference tag.\n\n Determines which coordinate system a point uses.\n\n @ingroup point"]
+pub type GhosttyPointTag = ::std::os::raw::c_uint;
+#[doc = " Point value union.\n\n @ingroup point"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union GhosttyPointValue {
+ #[doc = " Coordinate (used for all tag variants)."]
+ pub coordinate: GhosttyPointCoordinate,
+ #[doc = " Padding for ABI compatibility. Do not use."]
+ pub _padding: [u64; 2usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyPointValue"][::std::mem::size_of::() - 16usize];
+ ["Alignment of GhosttyPointValue"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyPointValue::coordinate"]
+ [::std::mem::offset_of!(GhosttyPointValue, coordinate) - 0usize];
+ ["Offset of field: GhosttyPointValue::_padding"]
+ [::std::mem::offset_of!(GhosttyPointValue, _padding) - 0usize];
+};
+impl Default for GhosttyPointValue {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " Tagged union for a point in the terminal grid.\n\n @ingroup point"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct GhosttyPoint {
+ pub tag: GhosttyPointTag,
+ pub value: GhosttyPointValue,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyPoint"][::std::mem::size_of::() - 24usize];
+ ["Alignment of GhosttyPoint"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyPoint::tag"][::std::mem::offset_of!(GhosttyPoint, tag) - 0usize];
+ ["Offset of field: GhosttyPoint::value"][::std::mem::offset_of!(GhosttyPoint, value) - 8usize];
+};
+impl Default for GhosttyPoint {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyTerminal {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a terminal instance.\n\n @ingroup terminal"]
+pub type GhosttyTerminal_ptr = *mut GhosttyTerminal;
+#[doc = " Terminal initialization options.\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyTerminalOptions {
+ #[doc = " Terminal width in cells. Must be greater than zero."]
+ pub cols: u16,
+ #[doc = " Terminal height in cells. Must be greater than zero."]
+ pub rows: u16,
+ #[doc = " Maximum number of lines to keep in scrollback history."]
+ pub max_scrollback: usize,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyTerminalOptions"][::std::mem::size_of::() - 16usize];
+ ["Alignment of GhosttyTerminalOptions"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyTerminalOptions::cols"]
+ [::std::mem::offset_of!(GhosttyTerminalOptions, cols) - 0usize];
+ ["Offset of field: GhosttyTerminalOptions::rows"]
+ [::std::mem::offset_of!(GhosttyTerminalOptions, rows) - 2usize];
+ ["Offset of field: GhosttyTerminalOptions::max_scrollback"]
+ [::std::mem::offset_of!(GhosttyTerminalOptions, max_scrollback) - 8usize];
+};
+#[doc = " Scroll to the top of the scrollback."]
+pub const GhosttyTerminalScrollViewportTag_GHOSTTY_SCROLL_VIEWPORT_TOP:
+ GhosttyTerminalScrollViewportTag = 0;
+#[doc = " Scroll to the bottom (active area)."]
+pub const GhosttyTerminalScrollViewportTag_GHOSTTY_SCROLL_VIEWPORT_BOTTOM:
+ GhosttyTerminalScrollViewportTag = 1;
+#[doc = " Scroll by a delta amount (up is negative)."]
+pub const GhosttyTerminalScrollViewportTag_GHOSTTY_SCROLL_VIEWPORT_DELTA:
+ GhosttyTerminalScrollViewportTag = 2;
+#[doc = " Scroll viewport behavior tag.\n\n @ingroup terminal"]
+pub type GhosttyTerminalScrollViewportTag = ::std::os::raw::c_uint;
+#[doc = " Scroll viewport value.\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union GhosttyTerminalScrollViewportValue {
+ #[doc = " Scroll delta (only used with GHOSTTY_SCROLL_VIEWPORT_DELTA). Up is negative."]
+ pub delta: isize,
+ #[doc = " Padding for ABI compatibility. Do not use."]
+ pub _padding: [u64; 2usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyTerminalScrollViewportValue"]
+ [::std::mem::size_of::() - 16usize];
+ ["Alignment of GhosttyTerminalScrollViewportValue"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyTerminalScrollViewportValue::delta"]
+ [::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, delta) - 0usize];
+ ["Offset of field: GhosttyTerminalScrollViewportValue::_padding"]
+ [::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, _padding) - 0usize];
+};
+impl Default for GhosttyTerminalScrollViewportValue {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " Tagged union for scroll viewport behavior.\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct GhosttyTerminalScrollViewport {
+ pub tag: GhosttyTerminalScrollViewportTag,
+ pub value: GhosttyTerminalScrollViewportValue,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyTerminalScrollViewport"]
+ [::std::mem::size_of::() - 24usize];
+ ["Alignment of GhosttyTerminalScrollViewport"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyTerminalScrollViewport::tag"]
+ [::std::mem::offset_of!(GhosttyTerminalScrollViewport, tag) - 0usize];
+ ["Offset of field: GhosttyTerminalScrollViewport::value"]
+ [::std::mem::offset_of!(GhosttyTerminalScrollViewport, value) - 8usize];
+};
+impl Default for GhosttyTerminalScrollViewport {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " The primary (normal) screen."]
+pub const GhosttyTerminalScreen_GHOSTTY_TERMINAL_SCREEN_PRIMARY: GhosttyTerminalScreen = 0;
+#[doc = " The alternate screen."]
+pub const GhosttyTerminalScreen_GHOSTTY_TERMINAL_SCREEN_ALTERNATE: GhosttyTerminalScreen = 1;
+#[doc = " Terminal screen identifier.\n\n Identifies which screen buffer is active in the terminal.\n\n @ingroup terminal"]
+pub type GhosttyTerminalScreen = ::std::os::raw::c_uint;
+#[doc = " Scrollbar state for the terminal viewport.\n\n Represents the scrollable area dimensions needed to render a scrollbar.\n\n @ingroup terminal"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyTerminalScrollbar {
+ #[doc = " Total size of the scrollable area in rows."]
+ pub total: u64,
+ #[doc = " Offset into the total area that the viewport is at."]
+ pub offset: u64,
+ #[doc = " Length of the visible area in rows."]
+ pub len: u64,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyTerminalScrollbar"]
+ [::std::mem::size_of::() - 24usize];
+ ["Alignment of GhosttyTerminalScrollbar"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyTerminalScrollbar::total"]
+ [::std::mem::offset_of!(GhosttyTerminalScrollbar, total) - 0usize];
+ ["Offset of field: GhosttyTerminalScrollbar::offset"]
+ [::std::mem::offset_of!(GhosttyTerminalScrollbar, offset) - 8usize];
+ ["Offset of field: GhosttyTerminalScrollbar::len"]
+ [::std::mem::offset_of!(GhosttyTerminalScrollbar, len) - 16usize];
+};
+#[doc = " Callback function type for bell.\n\n Called when the terminal receives a BEL character (0x07).\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n\n @ingroup terminal"]
+pub type GhosttyTerminalBellFn = ::std::option::Option<
+ unsafe extern "C" fn(terminal: GhosttyTerminal_ptr, userdata: *mut ::std::os::raw::c_void),
+>;
+#[doc = " Callback function type for color scheme queries (CSI ? 996 n).\n\n Called when the terminal receives a color scheme device status report\n query. Return true and fill *out_scheme with the current color scheme,\n or return false to silently ignore the query.\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n @param[out] out_scheme Pointer to store the current color scheme\n @return true if the color scheme was filled, false to ignore the query\n\n @ingroup terminal"]
+pub type GhosttyTerminalColorSchemeFn = ::std::option::Option<
+ unsafe extern "C" fn(
+ terminal: GhosttyTerminal_ptr,
+ userdata: *mut ::std::os::raw::c_void,
+ out_scheme: *mut GhosttyColorScheme,
+ ) -> bool,
+>;
+#[doc = " Callback function type for device attributes queries (DA1/DA2/DA3).\n\n Called when the terminal receives a device attributes query (CSI c,\n CSI > c, or CSI = c). Return true and fill *out_attrs with the\n response data, or return false to silently ignore the query.\n\n The terminal uses whichever sub-struct (primary, secondary, tertiary)\n matches the request type, but all three should be filled for simplicity.\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n @param[out] out_attrs Pointer to store the device attributes response\n @return true if attributes were filled, false to ignore the query\n\n @ingroup terminal"]
+pub type GhosttyTerminalDeviceAttributesFn = ::std::option::Option<
+ unsafe extern "C" fn(
+ terminal: GhosttyTerminal_ptr,
+ userdata: *mut ::std::os::raw::c_void,
+ out_attrs: *mut GhosttyDeviceAttributes,
+ ) -> bool,
+>;
+#[doc = " Callback function type for enquiry (ENQ, 0x05).\n\n Called when the terminal receives an ENQ character. Return the\n response bytes as a GhosttyString. The memory must remain valid\n until the callback returns. Return a zero-length string to send\n no response.\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n @return The response bytes to write back to the pty\n\n @ingroup terminal"]
+pub type GhosttyTerminalEnquiryFn = ::std::option::Option<
+ unsafe extern "C" fn(
+ terminal: GhosttyTerminal_ptr,
+ userdata: *mut ::std::os::raw::c_void,
+ ) -> GhosttyString,
+>;
+#[doc = " Callback function type for size queries (XTWINOPS).\n\n Called in response to XTWINOPS size queries (CSI 14/16/18 t).\n Return true and fill *out_size with the current terminal geometry,\n or return false to silently ignore the query.\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n @param[out] out_size Pointer to store the terminal size information\n @return true if size was filled, false to ignore the query\n\n @ingroup terminal"]
+pub type GhosttyTerminalSizeFn = ::std::option::Option<
+ unsafe extern "C" fn(
+ terminal: GhosttyTerminal_ptr,
+ userdata: *mut ::std::os::raw::c_void,
+ out_size: *mut GhosttySizeReportSize,
+ ) -> bool,
+>;
+#[doc = " Callback function type for title_changed.\n\n Called when the terminal title changes via escape sequences\n (e.g. OSC 0 or OSC 2). The new title can be queried from the\n terminal after the callback returns.\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n\n @ingroup terminal"]
+pub type GhosttyTerminalTitleChangedFn = ::std::option::Option<
+ unsafe extern "C" fn(terminal: GhosttyTerminal_ptr, userdata: *mut ::std::os::raw::c_void),
+>;
+#[doc = " Callback function type for write_pty.\n\n Called when the terminal needs to write data back to the pty, for\n example in response to a device status report or mode query. The\n data is only valid for the duration of the call; callers must copy\n it if it needs to persist.\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n @param data Pointer to the response bytes\n @param len Length of the response in bytes\n\n @ingroup terminal"]
+pub type GhosttyTerminalWritePtyFn = ::std::option::Option<
+ unsafe extern "C" fn(
+ terminal: GhosttyTerminal_ptr,
+ userdata: *mut ::std::os::raw::c_void,
+ data: *const u8,
+ len: usize,
+ ),
+>;
+#[doc = " Callback function type for XTVERSION.\n\n Called when the terminal receives an XTVERSION query (CSI > q).\n Return the version string (e.g. \"myterm 1.0\") as a GhosttyString.\n The memory must remain valid until the callback returns. Return a\n zero-length string to report the default \"libghostty\" version.\n\n @param terminal The terminal handle\n @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA\n @return The version string to report\n\n @ingroup terminal"]
+pub type GhosttyTerminalXtversionFn = ::std::option::Option<
+ unsafe extern "C" fn(
+ terminal: GhosttyTerminal_ptr,
+ userdata: *mut ::std::os::raw::c_void,
+ ) -> GhosttyString,
+>;
+#[doc = " Opaque userdata pointer passed to all callbacks.\n\n Input type: void*"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_USERDATA: GhosttyTerminalOption = 0;
+#[doc = " Callback invoked when the terminal needs to write data back\n to the pty (e.g. in response to a DECRQM query or device\n status report). Set to NULL to ignore such sequences.\n\n Input type: GhosttyTerminalWritePtyFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_WRITE_PTY: GhosttyTerminalOption = 1;
+#[doc = " Callback invoked when the terminal receives a BEL character\n (0x07). Set to NULL to ignore bell events.\n\n Input type: GhosttyTerminalBellFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_BELL: GhosttyTerminalOption = 2;
+#[doc = " Callback invoked when the terminal receives an ENQ character\n (0x05). Set to NULL to send no response.\n\n Input type: GhosttyTerminalEnquiryFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_ENQUIRY: GhosttyTerminalOption = 3;
+#[doc = " Callback invoked when the terminal receives an XTVERSION query\n (CSI > q). Set to NULL to report the default \"libghostty\" string.\n\n Input type: GhosttyTerminalXtversionFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_XTVERSION: GhosttyTerminalOption = 4;
+#[doc = " Callback invoked when the terminal title changes via escape\n sequences (e.g. OSC 0 or OSC 2). Set to NULL to ignore title\n change events.\n\n Input type: GhosttyTerminalTitleChangedFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_TITLE_CHANGED: GhosttyTerminalOption = 5;
+#[doc = " Callback invoked in response to XTWINOPS size queries\n (CSI 14/16/18 t). Set to NULL to silently ignore size queries.\n\n Input type: GhosttyTerminalSizeFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_SIZE: GhosttyTerminalOption = 6;
+#[doc = " Callback invoked in response to a color scheme device status\n report query (CSI ? 996 n). Return true and fill the out pointer\n to report the current scheme, or return false to silently ignore.\n Set to NULL to ignore color scheme queries.\n\n Input type: GhosttyTerminalColorSchemeFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_COLOR_SCHEME: GhosttyTerminalOption = 7;
+#[doc = " Callback invoked in response to a device attributes query\n (CSI c, CSI > c, or CSI = c). Return true and fill the out\n pointer with response data, or return false to silently ignore.\n Set to NULL to ignore device attributes queries.\n\n Input type: GhosttyTerminalDeviceAttributesFn"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_DEVICE_ATTRIBUTES: GhosttyTerminalOption = 8;
+#[doc = " Set the terminal title manually.\n\n The string data is copied into the terminal. A NULL value pointer\n clears the title (equivalent to setting an empty string).\n\n Input type: GhosttyString*"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_TITLE: GhosttyTerminalOption = 9;
+#[doc = " Set the terminal working directory manually.\n\n The string data is copied into the terminal. A NULL value pointer\n clears the pwd (equivalent to setting an empty string).\n\n Input type: GhosttyString*"]
+pub const GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_PWD: GhosttyTerminalOption = 10;
+#[doc = " Terminal option identifiers.\n\n These values are used with ghostty_terminal_set() to configure\n terminal callbacks and associated state.\n\n @ingroup terminal"]
+pub type GhosttyTerminalOption = ::std::os::raw::c_uint;
+#[doc = " Invalid data type. Never results in any data extraction."]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_INVALID: GhosttyTerminalData = 0;
+#[doc = " Terminal width in cells.\n\n Output type: uint16_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_COLS: GhosttyTerminalData = 1;
+#[doc = " Terminal height in cells.\n\n Output type: uint16_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_ROWS: GhosttyTerminalData = 2;
+#[doc = " Cursor column position (0-indexed).\n\n Output type: uint16_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_CURSOR_X: GhosttyTerminalData = 3;
+#[doc = " Cursor row position within the active area (0-indexed).\n\n Output type: uint16_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_CURSOR_Y: GhosttyTerminalData = 4;
+#[doc = " Whether the cursor has a pending wrap (next print will soft-wrap).\n\n Output type: bool *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_CURSOR_PENDING_WRAP: GhosttyTerminalData = 5;
+#[doc = " The currently active screen.\n\n Output type: GhosttyTerminalScreen *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_ACTIVE_SCREEN: GhosttyTerminalData = 6;
+#[doc = " Whether the cursor is visible (DEC mode 25).\n\n Output type: bool *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_CURSOR_VISIBLE: GhosttyTerminalData = 7;
+#[doc = " Current Kitty keyboard protocol flags.\n\n Output type: GhosttyKittyKeyFlags * (uint8_t *)"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_KITTY_KEYBOARD_FLAGS: GhosttyTerminalData = 8;
+#[doc = " Scrollbar state for the terminal viewport.\n\n This may be expensive to calculate depending on where the viewport\n is (arbitrary pins are expensive). The caller should take care to only\n call this as needed and not too frequently.\n\n Output type: GhosttyTerminalScrollbar *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_SCROLLBAR: GhosttyTerminalData = 9;
+#[doc = " The current SGR style of the cursor.\n\n This is the style that will be applied to newly printed characters.\n\n Output type: GhosttyStyle *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_CURSOR_STYLE: GhosttyTerminalData = 10;
+#[doc = " Whether any mouse tracking mode is active.\n\n Returns true if any of the mouse tracking modes (X10, normal, button,\n or any-event) are enabled.\n\n Output type: bool *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_MOUSE_TRACKING: GhosttyTerminalData = 11;
+#[doc = " The terminal title as set by escape sequences (e.g. OSC 0/2).\n\n Returns a borrowed string. The pointer is valid until the next call\n to ghostty_terminal_vt_write() or ghostty_terminal_reset(). An empty\n string (len=0) is returned when no title has been set.\n\n Output type: GhosttyString *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_TITLE: GhosttyTerminalData = 12;
+#[doc = " The terminal's current working directory as set by escape sequences\n (e.g. OSC 7).\n\n Returns a borrowed string. The pointer is valid until the next call\n to ghostty_terminal_vt_write() or ghostty_terminal_reset(). An empty\n string (len=0) is returned when no pwd has been set.\n\n Output type: GhosttyString *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_PWD: GhosttyTerminalData = 13;
+#[doc = " The total number of rows in the active screen including scrollback.\n\n Output type: size_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_TOTAL_ROWS: GhosttyTerminalData = 14;
+#[doc = " The number of scrollback rows (total rows minus viewport rows).\n\n Output type: size_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_SCROLLBACK_ROWS: GhosttyTerminalData = 15;
+#[doc = " The total width of the terminal in pixels.\n\n This is cols * cell_width_px as set by ghostty_terminal_resize().\n\n Output type: uint32_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_WIDTH_PX: GhosttyTerminalData = 16;
+#[doc = " The total height of the terminal in pixels.\n\n This is rows * cell_height_px as set by ghostty_terminal_resize().\n\n Output type: uint32_t *"]
+pub const GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_HEIGHT_PX: GhosttyTerminalData = 17;
+#[doc = " Terminal data types.\n\n These values specify what type of data to extract from a terminal\n using `ghostty_terminal_get`.\n\n @ingroup terminal"]
+pub type GhosttyTerminalData = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Create a new terminal instance.\n\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param terminal Pointer to store the created terminal handle\n @param options Terminal initialization options\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_new(
+ allocator: *const GhosttyAllocator,
+ terminal: *mut GhosttyTerminal_ptr,
+ options: GhosttyTerminalOptions,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a terminal instance.\n\n Releases all resources associated with the terminal. After this call,\n the terminal handle becomes invalid and must not be used.\n\n @param terminal The terminal handle to free (may be NULL)\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_free(terminal: GhosttyTerminal_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Perform a full reset of the terminal (RIS).\n\n Resets all terminal state back to its initial configuration, including\n modes, scrollback, scrolling region, and screen contents. The terminal\n dimensions are preserved.\n\n @param terminal The terminal handle (may be NULL, in which case this is a no-op)\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_reset(terminal: GhosttyTerminal_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Resize the terminal to the given dimensions.\n\n Changes the number of columns and rows in the terminal. The primary\n screen will reflow content if wraparound mode is enabled; the alternate\n screen does not reflow. If the dimensions are unchanged, this is a no-op.\n\n This also updates the terminal's pixel dimensions (used for image\n protocols and size reports), disables synchronized output mode (allowed\n by the spec so that resize results are shown immediately), and sends an\n in-band size report if mode 2048 is enabled.\n\n @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param cols New width in cells (must be greater than zero)\n @param rows New height in cells (must be greater than zero)\n @param cell_width_px Width of a single cell in pixels\n @param cell_height_px Height of a single cell in pixels\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_resize(
+ terminal: GhosttyTerminal_ptr,
+ cols: u16,
+ rows: u16,
+ cell_width_px: u32,
+ cell_height_px: u32,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Set an option on the terminal.\n\n Configures terminal callbacks and associated state such as the\n write_pty callback and userdata pointer. The value is passed\n directly for pointer types (callbacks, userdata) or as a pointer\n to the value for non-pointer types (e.g. GhosttyString*).\n NULL clears the option to its default.\n\n Callbacks are invoked synchronously during ghostty_terminal_vt_write().\n Callbacks must not call ghostty_terminal_vt_write() on the same\n terminal (no reentrancy).\n\n @param terminal The terminal handle (may be NULL, in which case this is a no-op)\n @param option The option to set\n @param value Pointer to the value to set (type depends on the option),\n or NULL to clear the option\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_set(
+ terminal: GhosttyTerminal_ptr,
+ option: GhosttyTerminalOption,
+ value: *const ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Write VT-encoded data to the terminal for processing.\n\n Feeds raw bytes through the terminal's VT stream parser, updating\n terminal state accordingly. By default, sequences that require output\n (queries, device status reports) are silently ignored. Use\n ghostty_terminal_set() with GHOSTTY_TERMINAL_OPT_WRITE_PTY to install\n a callback that receives response data.\n\n This never fails. Any erroneous input or errors in processing the\n input are logged internally but do not cause this function to fail\n because this input is assumed to be untrusted and from an external\n source; so the primary goal is to keep the terminal state consistent and\n not allow malformed input to corrupt or crash.\n\n @param terminal The terminal handle\n @param data Pointer to the data to write\n @param len Length of the data in bytes\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_vt_write(terminal: GhosttyTerminal_ptr, data: *const u8, len: usize);
+}
+unsafe extern "C" {
+ #[doc = " Scroll the terminal viewport.\n\n Scrolls the terminal's viewport according to the given behavior.\n When using GHOSTTY_SCROLL_VIEWPORT_DELTA, set the delta field in\n the value union to specify the number of rows to scroll (negative\n for up, positive for down). For other behaviors, the value is ignored.\n\n @param terminal The terminal handle (may be NULL, in which case this is a no-op)\n @param behavior The scroll behavior as a tagged union\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_scroll_viewport(
+ terminal: GhosttyTerminal_ptr,
+ behavior: GhosttyTerminalScrollViewport,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Get the current value of a terminal mode.\n\n Returns the value of the mode identified by the given mode.\n\n @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param mode The mode identifying the mode to query\n @param[out] out_value On success, set to true if the mode is set, false\n if it is reset\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal\n is NULL or the mode does not correspond to a known mode\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_mode_get(
+ terminal: GhosttyTerminal_ptr,
+ mode: GhosttyMode,
+ out_value: *mut bool,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Set the value of a terminal mode.\n\n Sets the mode identified by the given mode to the specified value.\n\n @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param mode The mode identifying the mode to set\n @param value true to set the mode, false to reset it\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal\n is NULL or the mode does not correspond to a known mode\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_mode_set(
+ terminal: GhosttyTerminal_ptr,
+ mode: GhosttyMode,
+ value: bool,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get data from a terminal instance.\n\n Extracts typed data from the given terminal based on the specified\n data type. The output pointer must be of the appropriate type for the\n requested data kind. Valid data types and output types are documented\n in the `GhosttyTerminalData` enum.\n\n @param terminal The terminal handle (may be NULL)\n @param data The type of data to extract\n @param out Pointer to store the extracted data (type depends on data parameter)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal\n is NULL or the data type is invalid\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_get(
+ terminal: GhosttyTerminal_ptr,
+ data: GhosttyTerminalData,
+ out: *mut ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Resolve a point in the terminal grid to a grid reference.\n\n Resolves the given point (which can be in active, viewport, screen,\n or history coordinates) to a grid reference for that location. Use\n ghostty_grid_ref_cell() and ghostty_grid_ref_row() to extract the cell\n and row.\n\n Lookups using the `active` and `viewport` tags are fast. The `screen`\n and `history` tags may require traversing the full scrollback page list\n to resolve the y coordinate, so they can be expensive for large\n scrollback buffers.\n\n This function isn't meant to be used as the core of render loop. It\n isn't built to sustain the framerates needed for rendering large screens.\n Use the render state API for that. This API is instead meant for less\n strictly performance-sensitive use cases.\n\n @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param point The point specifying which cell to look up\n @param[out] out_ref On success, set to the grid reference at the given point (may be NULL)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal\n is NULL or the point is out of bounds\n\n @ingroup terminal"]
+ pub fn ghostty_terminal_grid_ref(
+ terminal: GhosttyTerminal_ptr,
+ point: GhosttyPoint,
+ out_ref: *mut GhosttyGridRef,
+ ) -> GhosttyResult;
+}
+#[doc = " Plain text (no escape sequences)."]
+pub const GhosttyFormatterFormat_GHOSTTY_FORMATTER_FORMAT_PLAIN: GhosttyFormatterFormat = 0;
+#[doc = " VT sequences preserving colors, styles, URLs, etc."]
+pub const GhosttyFormatterFormat_GHOSTTY_FORMATTER_FORMAT_VT: GhosttyFormatterFormat = 1;
+#[doc = " HTML with inline styles."]
+pub const GhosttyFormatterFormat_GHOSTTY_FORMATTER_FORMAT_HTML: GhosttyFormatterFormat = 2;
+#[doc = " Output format.\n\n @ingroup formatter"]
+pub type GhosttyFormatterFormat = ::std::os::raw::c_uint;
+#[doc = " Extra screen state to include in styled output.\n\n @ingroup formatter"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyFormatterScreenExtra {
+ #[doc = " Size of this struct in bytes. Must be set to sizeof(GhosttyFormatterScreenExtra)."]
+ pub size: usize,
+ #[doc = " Emit cursor position using CUP (CSI H)."]
+ pub cursor: bool,
+ #[doc = " Emit current SGR style state based on the cursor's active style_id."]
+ pub style: bool,
+ #[doc = " Emit current hyperlink state using OSC 8 sequences."]
+ pub hyperlink: bool,
+ #[doc = " Emit character protection mode using DECSCA."]
+ pub protection: bool,
+ #[doc = " Emit Kitty keyboard protocol state using CSI > u and CSI = sequences."]
+ pub kitty_keyboard: bool,
+ #[doc = " Emit character set designations and invocations."]
+ pub charsets: bool,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyFormatterScreenExtra"]
+ [::std::mem::size_of::() - 16usize];
+ ["Alignment of GhosttyFormatterScreenExtra"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyFormatterScreenExtra::size"]
+ [::std::mem::offset_of!(GhosttyFormatterScreenExtra, size) - 0usize];
+ ["Offset of field: GhosttyFormatterScreenExtra::cursor"]
+ [::std::mem::offset_of!(GhosttyFormatterScreenExtra, cursor) - 8usize];
+ ["Offset of field: GhosttyFormatterScreenExtra::style"]
+ [::std::mem::offset_of!(GhosttyFormatterScreenExtra, style) - 9usize];
+ ["Offset of field: GhosttyFormatterScreenExtra::hyperlink"]
+ [::std::mem::offset_of!(GhosttyFormatterScreenExtra, hyperlink) - 10usize];
+ ["Offset of field: GhosttyFormatterScreenExtra::protection"]
+ [::std::mem::offset_of!(GhosttyFormatterScreenExtra, protection) - 11usize];
+ ["Offset of field: GhosttyFormatterScreenExtra::kitty_keyboard"]
+ [::std::mem::offset_of!(GhosttyFormatterScreenExtra, kitty_keyboard) - 12usize];
+ ["Offset of field: GhosttyFormatterScreenExtra::charsets"]
+ [::std::mem::offset_of!(GhosttyFormatterScreenExtra, charsets) - 13usize];
+};
+#[doc = " Extra terminal state to include in styled output.\n\n @ingroup formatter"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyFormatterTerminalExtra {
+ #[doc = " Size of this struct in bytes. Must be set to sizeof(GhosttyFormatterTerminalExtra)."]
+ pub size: usize,
+ #[doc = " Emit the palette using OSC 4 sequences."]
+ pub palette: bool,
+ #[doc = " Emit terminal modes that differ from their defaults using CSI h/l."]
+ pub modes: bool,
+ #[doc = " Emit scrolling region state using DECSTBM and DECSLRM sequences."]
+ pub scrolling_region: bool,
+ #[doc = " Emit tabstop positions by clearing all tabs and setting each one."]
+ pub tabstops: bool,
+ #[doc = " Emit the present working directory using OSC 7."]
+ pub pwd: bool,
+ #[doc = " Emit keyboard modes such as ModifyOtherKeys."]
+ pub keyboard: bool,
+ #[doc = " Screen-level extras."]
+ pub screen: GhosttyFormatterScreenExtra,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyFormatterTerminalExtra"]
+ [::std::mem::size_of::() - 32usize];
+ ["Alignment of GhosttyFormatterTerminalExtra"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::size"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, size) - 0usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::palette"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, palette) - 8usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::modes"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, modes) - 9usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::scrolling_region"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, scrolling_region) - 10usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::tabstops"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, tabstops) - 11usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::pwd"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, pwd) - 12usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::keyboard"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, keyboard) - 13usize];
+ ["Offset of field: GhosttyFormatterTerminalExtra::screen"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalExtra, screen) - 16usize];
+};
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyFormatter {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a formatter instance.\n\n @ingroup formatter"]
+pub type GhosttyFormatter_ptr = *mut GhosttyFormatter;
+#[doc = " Options for creating a terminal formatter.\n\n @ingroup formatter"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyFormatterTerminalOptions {
+ #[doc = " Size of this struct in bytes. Must be set to sizeof(GhosttyFormatterTerminalOptions)."]
+ pub size: usize,
+ #[doc = " Output format to emit."]
+ pub emit: GhosttyFormatterFormat,
+ #[doc = " Whether to unwrap soft-wrapped lines."]
+ pub unwrap: bool,
+ #[doc = " Whether to trim trailing whitespace on non-blank lines."]
+ pub trim: bool,
+ #[doc = " Extra terminal state to include in styled output."]
+ pub extra: GhosttyFormatterTerminalExtra,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyFormatterTerminalOptions"]
+ [::std::mem::size_of::() - 48usize];
+ ["Alignment of GhosttyFormatterTerminalOptions"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyFormatterTerminalOptions::size"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalOptions, size) - 0usize];
+ ["Offset of field: GhosttyFormatterTerminalOptions::emit"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalOptions, emit) - 8usize];
+ ["Offset of field: GhosttyFormatterTerminalOptions::unwrap"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalOptions, unwrap) - 12usize];
+ ["Offset of field: GhosttyFormatterTerminalOptions::trim"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalOptions, trim) - 13usize];
+ ["Offset of field: GhosttyFormatterTerminalOptions::extra"]
+ [::std::mem::offset_of!(GhosttyFormatterTerminalOptions, extra) - 16usize];
+};
+impl Default for GhosttyFormatterTerminalOptions {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+unsafe extern "C" {
+ #[doc = " Create a formatter for a terminal's active screen.\n\n The terminal must outlive the formatter. The formatter stores a borrowed\n reference to the terminal and reads its current state on each format call.\n\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param formatter Pointer to store the created formatter handle\n @param terminal The terminal to format (must not be NULL)\n @param options Formatting options\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup formatter"]
+ pub fn ghostty_formatter_terminal_new(
+ allocator: *const GhosttyAllocator,
+ formatter: *mut GhosttyFormatter_ptr,
+ terminal: GhosttyTerminal_ptr,
+ options: GhosttyFormatterTerminalOptions,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Run the formatter and produce output into the caller-provided buffer.\n\n Each call formats the current terminal state. Pass NULL for buf to\n query the required buffer size without writing any output; in that case\n out_written receives the required size and the return value is\n GHOSTTY_OUT_OF_SPACE.\n\n If the buffer is too small, returns GHOSTTY_OUT_OF_SPACE and sets\n out_written to the required size. The caller can then retry with a\n larger buffer.\n\n @param formatter The formatter handle (must not be NULL)\n @param buf Pointer to the output buffer, or NULL to query size\n @param buf_len Length of the output buffer in bytes\n @param out_written Pointer to receive the number of bytes written,\n or the required size on failure\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup formatter"]
+ pub fn ghostty_formatter_format_buf(
+ formatter: GhosttyFormatter_ptr,
+ buf: *mut u8,
+ buf_len: usize,
+ out_written: *mut usize,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Run the formatter and return an allocated buffer with the output.\n\n Each call formats the current terminal state. The buffer is allocated\n using the provided allocator (or the default allocator if NULL).\n The caller is responsible for freeing the returned buffer with\n ghostty_free(), passing the same allocator (or NULL for the default)\n that was used for the allocation.\n\n @param formatter The formatter handle (must not be NULL)\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param out_ptr Pointer to receive the allocated buffer\n @param out_len Pointer to receive the length of the output in bytes\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation\n failure\n\n @ingroup formatter"]
+ pub fn ghostty_formatter_format_alloc(
+ formatter: GhosttyFormatter_ptr,
+ allocator: *const GhosttyAllocator,
+ out_ptr: *mut *mut u8,
+ out_len: *mut usize,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a formatter instance.\n\n Releases all resources associated with the formatter. After this call,\n the formatter handle becomes invalid.\n\n @param formatter The formatter handle to free (may be NULL)\n\n @ingroup formatter"]
+ pub fn ghostty_formatter_free(formatter: GhosttyFormatter_ptr);
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyRenderState {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a render state instance.\n\n @ingroup render"]
+pub type GhosttyRenderState_ptr = *mut GhosttyRenderState;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyRenderStateRowIterator {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a render-state row iterator.\n\n @ingroup render"]
+pub type GhosttyRenderStateRowIterator_ptr = *mut GhosttyRenderStateRowIterator;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyRenderStateRowCells {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to render-state row cells.\n\n @ingroup render"]
+pub type GhosttyRenderStateRowCells_ptr = *mut GhosttyRenderStateRowCells;
+#[doc = " Not dirty at all; rendering can be skipped."]
+pub const GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_FALSE: GhosttyRenderStateDirty = 0;
+#[doc = " Some rows changed; renderer can redraw incrementally."]
+pub const GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_PARTIAL: GhosttyRenderStateDirty = 1;
+#[doc = " Global state changed; renderer should redraw everything."]
+pub const GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_FULL: GhosttyRenderStateDirty = 2;
+#[doc = " Dirty state of a render state after update.\n\n @ingroup render"]
+pub type GhosttyRenderStateDirty = ::std::os::raw::c_uint;
+#[doc = " Bar cursor (DECSCUSR 5, 6)."]
+pub const GhosttyRenderStateCursorVisualStyle_GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR:
+ GhosttyRenderStateCursorVisualStyle = 0;
+#[doc = " Block cursor (DECSCUSR 1, 2)."]
+pub const GhosttyRenderStateCursorVisualStyle_GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK:
+ GhosttyRenderStateCursorVisualStyle = 1;
+#[doc = " Underline cursor (DECSCUSR 3, 4)."]
+pub const GhosttyRenderStateCursorVisualStyle_GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE:
+ GhosttyRenderStateCursorVisualStyle = 2;
+#[doc = " Hollow block cursor."]
+pub const GhosttyRenderStateCursorVisualStyle_GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW : GhosttyRenderStateCursorVisualStyle = 3 ;
+#[doc = " Visual style of the cursor.\n\n @ingroup render"]
+pub type GhosttyRenderStateCursorVisualStyle = ::std::os::raw::c_uint;
+#[doc = " Invalid / sentinel value."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_INVALID: GhosttyRenderStateData = 0;
+#[doc = " Viewport width in cells (uint16_t)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_COLS: GhosttyRenderStateData = 1;
+#[doc = " Viewport height in cells (uint16_t)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_ROWS: GhosttyRenderStateData = 2;
+#[doc = " Current dirty state (GhosttyRenderStateDirty)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_DIRTY: GhosttyRenderStateData = 3;
+#[doc = " Populate a pre-allocated GhosttyRenderStateRowIterator with row data\n from the render state (GhosttyRenderStateRowIterator). Row data is\n only valid as long as the underlying render state is not updated.\n It is unsafe to use row data after updating the render state."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR: GhosttyRenderStateData = 4;
+#[doc = " Default/current background color (GhosttyColorRgb)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND:
+ GhosttyRenderStateData = 5;
+#[doc = " Default/current foreground color (GhosttyColorRgb)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND:
+ GhosttyRenderStateData = 6;
+#[doc = " Cursor color when explicitly set by terminal state (GhosttyColorRgb).\n Returns GHOSTTY_INVALID_VALUE if no explicit cursor color is set;\n use COLOR_CURSOR_HAS_VALUE to check first."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR: GhosttyRenderStateData = 7;
+#[doc = " Whether an explicit cursor color is set (bool)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE:
+ GhosttyRenderStateData = 8;
+#[doc = " The active 256-color palette (GhosttyColorRgb[256])."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE: GhosttyRenderStateData =
+ 9;
+#[doc = " The visual style of the cursor (GhosttyRenderStateCursorVisualStyle)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE:
+ GhosttyRenderStateData = 10;
+#[doc = " Whether the cursor is visible based on terminal modes (bool)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE: GhosttyRenderStateData =
+ 11;
+#[doc = " Whether the cursor should blink based on terminal modes (bool)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING: GhosttyRenderStateData =
+ 12;
+#[doc = " Whether the cursor is at a password input field (bool)."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT:
+ GhosttyRenderStateData = 13;
+#[doc = " Whether the cursor is visible within the viewport (bool).\n If false, the cursor viewport position values are undefined."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE:
+ GhosttyRenderStateData = 14;
+#[doc = " Cursor viewport x position in cells (uint16_t).\n Only valid when CURSOR_VIEWPORT_HAS_VALUE is true."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X:
+ GhosttyRenderStateData = 15;
+#[doc = " Cursor viewport y position in cells (uint16_t).\n Only valid when CURSOR_VIEWPORT_HAS_VALUE is true."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y:
+ GhosttyRenderStateData = 16;
+#[doc = " Whether the cursor is on the tail of a wide character (bool).\n Only valid when CURSOR_VIEWPORT_HAS_VALUE is true."]
+pub const GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL:
+ GhosttyRenderStateData = 17;
+#[doc = " Queryable data kinds for ghostty_render_state_get().\n\n @ingroup render"]
+pub type GhosttyRenderStateData = ::std::os::raw::c_uint;
+#[doc = " Set dirty state (GhosttyRenderStateDirty)."]
+pub const GhosttyRenderStateOption_GHOSTTY_RENDER_STATE_OPTION_DIRTY: GhosttyRenderStateOption = 0;
+#[doc = " Settable options for ghostty_render_state_set().\n\n @ingroup render"]
+pub type GhosttyRenderStateOption = ::std::os::raw::c_uint;
+#[doc = " Invalid / sentinel value."]
+pub const GhosttyRenderStateRowData_GHOSTTY_RENDER_STATE_ROW_DATA_INVALID:
+ GhosttyRenderStateRowData = 0;
+#[doc = " Whether the current row is dirty (bool)."]
+pub const GhosttyRenderStateRowData_GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY: GhosttyRenderStateRowData =
+ 1;
+#[doc = " The raw row value (GhosttyRow)."]
+pub const GhosttyRenderStateRowData_GHOSTTY_RENDER_STATE_ROW_DATA_RAW: GhosttyRenderStateRowData =
+ 2;
+#[doc = " Populate a pre-allocated GhosttyRenderStateRowCells with cell data for\n the current row (GhosttyRenderStateRowCells). Cell data is only\n valid as long as the underlying render state is not updated.\n It is unsafe to use cell data after updating the render state."]
+pub const GhosttyRenderStateRowData_GHOSTTY_RENDER_STATE_ROW_DATA_CELLS: GhosttyRenderStateRowData =
+ 3;
+#[doc = " Queryable data kinds for ghostty_render_state_row_get().\n\n @ingroup render"]
+pub type GhosttyRenderStateRowData = ::std::os::raw::c_uint;
+#[doc = " Set dirty state for the current row (bool)."]
+pub const GhosttyRenderStateRowOption_GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY:
+ GhosttyRenderStateRowOption = 0;
+#[doc = " Settable options for ghostty_render_state_row_set().\n\n @ingroup render"]
+pub type GhosttyRenderStateRowOption = ::std::os::raw::c_uint;
+#[doc = " Render-state color information.\n\n This struct uses the sized-struct ABI pattern. Initialize with\n GHOSTTY_INIT_SIZED(GhosttyRenderStateColors) before calling\n ghostty_render_state_colors_get().\n\n Example:\n @code\n GhosttyRenderStateColors colors = GHOSTTY_INIT_SIZED(GhosttyRenderStateColors);\n GhosttyResult result = ghostty_render_state_colors_get(state, &colors);\n @endcode\n\n @ingroup render"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyRenderStateColors {
+ #[doc = " Size of this struct in bytes. Must be set to sizeof(GhosttyRenderStateColors)."]
+ pub size: usize,
+ #[doc = " The default/current background color for the render state."]
+ pub background: GhosttyColorRgb,
+ #[doc = " The default/current foreground color for the render state."]
+ pub foreground: GhosttyColorRgb,
+ #[doc = " The cursor color when explicitly set by terminal state."]
+ pub cursor: GhosttyColorRgb,
+ #[doc = " True when cursor contains a valid explicit cursor color value.\n If this is false, the cursor color should be ignored; it will\n contain undefined data."]
+ pub cursor_has_value: bool,
+ #[doc = " The active 256-color palette for this render state."]
+ pub palette: [GhosttyColorRgb; 256usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyRenderStateColors"]
+ [::std::mem::size_of::() - 792usize];
+ ["Alignment of GhosttyRenderStateColors"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyRenderStateColors::size"]
+ [::std::mem::offset_of!(GhosttyRenderStateColors, size) - 0usize];
+ ["Offset of field: GhosttyRenderStateColors::background"]
+ [::std::mem::offset_of!(GhosttyRenderStateColors, background) - 8usize];
+ ["Offset of field: GhosttyRenderStateColors::foreground"]
+ [::std::mem::offset_of!(GhosttyRenderStateColors, foreground) - 11usize];
+ ["Offset of field: GhosttyRenderStateColors::cursor"]
+ [::std::mem::offset_of!(GhosttyRenderStateColors, cursor) - 14usize];
+ ["Offset of field: GhosttyRenderStateColors::cursor_has_value"]
+ [::std::mem::offset_of!(GhosttyRenderStateColors, cursor_has_value) - 17usize];
+ ["Offset of field: GhosttyRenderStateColors::palette"]
+ [::std::mem::offset_of!(GhosttyRenderStateColors, palette) - 18usize];
+};
+impl Default for GhosttyRenderStateColors {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+unsafe extern "C" {
+ #[doc = " Create a new render state instance.\n\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param state Pointer to store the created render state handle\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation\n failure\n\n @ingroup render"]
+ pub fn ghostty_render_state_new(
+ allocator: *const GhosttyAllocator,
+ state: *mut GhosttyRenderState_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a render state instance.\n\n Releases all resources associated with the render state. After this call,\n the render state handle becomes invalid.\n\n @param state The render state handle to free (may be NULL)\n\n @ingroup render"]
+ pub fn ghostty_render_state_free(state: GhosttyRenderState_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Update a render state instance from a terminal.\n\n This consumes terminal/screen dirty state in the same way as the internal\n render state update path.\n\n @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param terminal The terminal handle to read from (NULL returns GHOSTTY_INVALID_VALUE)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` or\n `terminal` is NULL, GHOSTTY_OUT_OF_MEMORY if updating the state requires\n allocation and that allocation fails\n\n @ingroup render"]
+ pub fn ghostty_render_state_update(
+ state: GhosttyRenderState_ptr,
+ terminal: GhosttyTerminal_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get a value from a render state.\n\n The `out` pointer must point to a value of the type corresponding to the\n requested data kind (see GhosttyRenderStateData).\n\n @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param data The data kind to query\n @param[out] out Pointer to receive the queried value\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` is\n NULL or `data` is not a recognized enum value\n\n @ingroup render"]
+ pub fn ghostty_render_state_get(
+ state: GhosttyRenderState_ptr,
+ data: GhosttyRenderStateData,
+ out: *mut ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Set an option on a render state.\n\n The `value` pointer must point to a value of the type corresponding to the\n requested option kind (see GhosttyRenderStateOption).\n\n @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param option The option to set\n @param[in] value Pointer to the value to set (NULL returns\n GHOSTTY_INVALID_VALUE)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` or\n `value` is NULL\n\n @ingroup render"]
+ pub fn ghostty_render_state_set(
+ state: GhosttyRenderState_ptr,
+ option: GhosttyRenderStateOption,
+ value: *const ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get the current color information from a render state.\n\n This writes as many fields as fit in the caller-provided sized struct.\n `out_colors->size` must be set by the caller (typically via\n GHOSTTY_INIT_SIZED(GhosttyRenderStateColors)).\n\n @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)\n @param[out] out_colors Sized output struct to receive render-state colors\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` or\n `out_colors` is NULL, or if `out_colors->size` is smaller than\n `sizeof(size_t)`\n\n @ingroup render"]
+ pub fn ghostty_render_state_colors_get(
+ state: GhosttyRenderState_ptr,
+ out_colors: *mut GhosttyRenderStateColors,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Create a new row iterator instance.\n\n All fields except the allocator are left undefined until populated\n via ghostty_render_state_get() with\n GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR.\n\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param[out] out_iterator On success, receives the created iterator handle\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation\n failure\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_iterator_new(
+ allocator: *const GhosttyAllocator,
+ out_iterator: *mut GhosttyRenderStateRowIterator_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a render-state row iterator.\n\n @param iterator The iterator handle to free (may be NULL)\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_iterator_free(iterator: GhosttyRenderStateRowIterator_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Move a render-state row iterator to the next row.\n\n Returns true if the iterator moved successfully and row data is\n available to read at the new position.\n\n @param iterator The iterator handle to advance (may be NULL)\n @return true if advanced to the next row, false if `iterator` is\n NULL or if the iterator has reached the end\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_iterator_next(
+ iterator: GhosttyRenderStateRowIterator_ptr,
+ ) -> bool;
+}
+unsafe extern "C" {
+ #[doc = " Get a value from the current row in a render-state row iterator.\n\n The `out` pointer must point to a value of the type corresponding to the\n requested data kind (see GhosttyRenderStateRowData).\n Call ghostty_render_state_row_iterator_next() at least once before\n calling this function.\n\n @param iterator The iterator handle to query (NULL returns GHOSTTY_INVALID_VALUE)\n @param data The data kind to query\n @param[out] out Pointer to receive the queried value\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if\n `iterator` is NULL or the iterator is not positioned on a row\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_get(
+ iterator: GhosttyRenderStateRowIterator_ptr,
+ data: GhosttyRenderStateRowData,
+ out: *mut ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Set an option on the current row in a render-state row iterator.\n\n The `value` pointer must point to a value of the type corresponding to the\n requested option kind (see GhosttyRenderStateRowOption).\n Call ghostty_render_state_row_iterator_next() at least once before\n calling this function.\n\n @param iterator The iterator handle to update (NULL returns GHOSTTY_INVALID_VALUE)\n @param option The option to set\n @param[in] value Pointer to the value to set (NULL returns\n GHOSTTY_INVALID_VALUE)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if\n `iterator` is NULL or the iterator is not positioned on a row\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_set(
+ iterator: GhosttyRenderStateRowIterator_ptr,
+ option: GhosttyRenderStateRowOption,
+ value: *const ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Create a new row cells instance.\n\n All fields except the allocator are left undefined until populated\n via ghostty_render_state_row_get() with\n GHOSTTY_RENDER_STATE_ROW_DATA_CELLS.\n\n You can reuse this value repeatedly with ghostty_render_state_row_get() to\n avoid allocating a new cells container for every row.\n\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param[out] out_cells On success, receives the created row cells handle\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation\n failure\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_cells_new(
+ allocator: *const GhosttyAllocator,
+ out_cells: *mut GhosttyRenderStateRowCells_ptr,
+ ) -> GhosttyResult;
+}
+#[doc = " Invalid / sentinel value."]
+pub const GhosttyRenderStateRowCellsData_GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID:
+ GhosttyRenderStateRowCellsData = 0;
+#[doc = " The raw cell value (GhosttyCell)."]
+pub const GhosttyRenderStateRowCellsData_GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW:
+ GhosttyRenderStateRowCellsData = 1;
+#[doc = " The style for the current cell (GhosttyStyle)."]
+pub const GhosttyRenderStateRowCellsData_GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE:
+ GhosttyRenderStateRowCellsData = 2;
+#[doc = " The total number of grapheme codepoints including the base codepoint\n (uint32_t). Returns 0 if the cell has no text."]
+pub const GhosttyRenderStateRowCellsData_GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN:
+ GhosttyRenderStateRowCellsData = 3;
+#[doc = " Write grapheme codepoints into a caller-provided buffer (uint32_t*).\n The buffer must be at least graphemes_len elements. The base codepoint\n is written first, followed by any extra codepoints."]
+pub const GhosttyRenderStateRowCellsData_GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF:
+ GhosttyRenderStateRowCellsData = 4;
+#[doc = " The resolved background color of the cell (GhosttyColorRgb).\n Flattens the three possible sources: content-tag bg_color_rgb,\n content-tag bg_color_palette (looked up in the palette), or the\n style's bg_color. Returns GHOSTTY_INVALID_VALUE if the cell has\n no background color, in which case the caller should use whatever\n default background color it wants (e.g. the terminal background)."]
+pub const GhosttyRenderStateRowCellsData_GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR:
+ GhosttyRenderStateRowCellsData = 5;
+#[doc = " The resolved foreground color of the cell (GhosttyColorRgb).\n Resolves palette indices through the palette. Bold color handling\n is not applied; the caller should handle bold styling separately.\n Returns GHOSTTY_INVALID_VALUE if the cell has no explicit foreground\n color, in which case the caller should use whatever default foreground\n color it wants (e.g. the terminal foreground)."]
+pub const GhosttyRenderStateRowCellsData_GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR:
+ GhosttyRenderStateRowCellsData = 6;
+#[doc = " Queryable data kinds for ghostty_render_state_row_cells_get().\n\n @ingroup render"]
+pub type GhosttyRenderStateRowCellsData = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Move a render-state row cells iterator to the next cell.\n\n Returns true if the iterator moved successfully and cell data is\n available to read at the new position.\n\n @param cells The row cells handle to advance (may be NULL)\n @return true if advanced to the next cell, false if `cells` is\n NULL or if the iterator has reached the end\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_cells_next(cells: GhosttyRenderStateRowCells_ptr) -> bool;
+}
+unsafe extern "C" {
+ #[doc = " Move a render-state row cells iterator to a specific column.\n\n Positions the iterator at the given x (column) index so that\n subsequent reads return data for that cell.\n\n @param cells The row cells handle to reposition (NULL returns\n GHOSTTY_INVALID_VALUE)\n @param x The zero-based column index to select\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `cells`\n is NULL or `x` is out of range\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_cells_select(
+ cells: GhosttyRenderStateRowCells_ptr,
+ x: u16,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get a value from the current cell in a render-state row cells iterator.\n\n The `out` pointer must point to a value of the type corresponding to the\n requested data kind (see GhosttyRenderStateRowCellsData).\n Call ghostty_render_state_row_cells_next() or\n ghostty_render_state_row_cells_select() at least once before\n calling this function.\n\n @param cells The row cells handle to query (NULL returns GHOSTTY_INVALID_VALUE)\n @param data The data kind to query\n @param[out] out Pointer to receive the queried value\n @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if\n `cells` is NULL or the iterator is not positioned on a cell\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_cells_get(
+ cells: GhosttyRenderStateRowCells_ptr,
+ data: GhosttyRenderStateRowCellsData,
+ out: *mut ::std::os::raw::c_void,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a row cells instance.\n\n @param cells The row cells handle to free (may be NULL)\n\n @ingroup render"]
+ pub fn ghostty_render_state_row_cells_free(cells: GhosttyRenderStateRowCells_ptr);
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyOscParser {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to an OSC parser instance.\n\n This handle represents an OSC (Operating System Command) parser that can\n be used to parse the contents of OSC sequences.\n\n @ingroup osc"]
+pub type GhosttyOscParser_ptr = *mut GhosttyOscParser;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyOscCommand {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a single OSC command.\n\n This handle represents a parsed OSC (Operating System Command) command.\n The command can be queried for its type and associated data.\n\n @ingroup osc"]
+pub type GhosttyOscCommand_ptr = *mut GhosttyOscCommand;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_INVALID: GhosttyOscCommandType = 0;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_TITLE: GhosttyOscCommandType = 1;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_ICON: GhosttyOscCommandType = 2;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_SEMANTIC_PROMPT: GhosttyOscCommandType = 3;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CLIPBOARD_CONTENTS: GhosttyOscCommandType = 4;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_REPORT_PWD: GhosttyOscCommandType = 5;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_MOUSE_SHAPE: GhosttyOscCommandType = 6;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_COLOR_OPERATION: GhosttyOscCommandType = 7;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_KITTY_COLOR_PROTOCOL: GhosttyOscCommandType = 8;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_SHOW_DESKTOP_NOTIFICATION:
+ GhosttyOscCommandType = 9;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_HYPERLINK_START: GhosttyOscCommandType = 10;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_HYPERLINK_END: GhosttyOscCommandType = 11;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_SLEEP: GhosttyOscCommandType = 12;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_SHOW_MESSAGE_BOX: GhosttyOscCommandType =
+ 13;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_CHANGE_TAB_TITLE: GhosttyOscCommandType =
+ 14;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_PROGRESS_REPORT: GhosttyOscCommandType =
+ 15;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_WAIT_INPUT: GhosttyOscCommandType = 16;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_GUIMACRO: GhosttyOscCommandType = 17;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_RUN_PROCESS: GhosttyOscCommandType = 18;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_OUTPUT_ENVIRONMENT_VARIABLE:
+ GhosttyOscCommandType = 19;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_XTERM_EMULATION: GhosttyOscCommandType =
+ 20;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_CONEMU_COMMENT: GhosttyOscCommandType = 21;
+pub const GhosttyOscCommandType_GHOSTTY_OSC_COMMAND_KITTY_TEXT_SIZING: GhosttyOscCommandType = 22;
+#[doc = " OSC command types.\n\n @ingroup osc"]
+pub type GhosttyOscCommandType = ::std::os::raw::c_uint;
+#[doc = " Invalid data type. Never results in any data extraction."]
+pub const GhosttyOscCommandData_GHOSTTY_OSC_DATA_INVALID: GhosttyOscCommandData = 0;
+#[doc = " Window title string data.\n\n Valid for: GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_TITLE\n\n Output type: const char ** (pointer to null-terminated string)\n\n Lifetime: Valid until the next call to any ghostty_osc_* function with\n the same parser instance. Memory is owned by the parser."]
+pub const GhosttyOscCommandData_GHOSTTY_OSC_DATA_CHANGE_WINDOW_TITLE_STR: GhosttyOscCommandData = 1;
+#[doc = " OSC command data types.\n\n These values specify what type of data to extract from an OSC command\n using `ghostty_osc_command_data`.\n\n @ingroup osc"]
+pub type GhosttyOscCommandData = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Create a new OSC parser instance.\n\n Creates a new OSC (Operating System Command) parser using the provided\n allocator. The parser must be freed using ghostty_vt_osc_free() when\n no longer needed.\n\n @param allocator Pointer to the allocator to use for memory management, or NULL to use the default allocator\n @param parser Pointer to store the created parser handle\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup osc"]
+ pub fn ghostty_osc_new(
+ allocator: *const GhosttyAllocator,
+ parser: *mut GhosttyOscParser_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free an OSC parser instance.\n\n Releases all resources associated with the OSC parser. After this call,\n the parser handle becomes invalid and must not be used.\n\n @param parser The parser handle to free (may be NULL)\n\n @ingroup osc"]
+ pub fn ghostty_osc_free(parser: GhosttyOscParser_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Reset an OSC parser instance to its initial state.\n\n Resets the parser state, clearing any partially parsed OSC sequences\n and returning the parser to its initial state. This is useful for\n reusing a parser instance or recovering from parse errors.\n\n @param parser The parser handle to reset, must not be null.\n\n @ingroup osc"]
+ pub fn ghostty_osc_reset(parser: GhosttyOscParser_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Parse the next byte in an OSC sequence.\n\n Processes a single byte as part of an OSC sequence. The parser maintains\n internal state to track the progress through the sequence. Call this\n function for each byte in the sequence data.\n\n When finished pumping the parser with bytes, call ghostty_osc_end\n to get the final result.\n\n @param parser The parser handle, must not be null.\n @param byte The next byte to parse\n\n @ingroup osc"]
+ pub fn ghostty_osc_next(parser: GhosttyOscParser_ptr, byte: u8);
+}
+unsafe extern "C" {
+ #[doc = " Finalize OSC parsing and retrieve the parsed command.\n\n Call this function after feeding all bytes of an OSC sequence to the parser\n using ghostty_osc_next() with the exception of the terminating character\n (ESC or ST). This function finalizes the parsing process and returns the\n parsed OSC command.\n\n The return value is never NULL. Invalid commands will return a command\n with type GHOSTTY_OSC_COMMAND_INVALID.\n\n The terminator parameter specifies the byte that terminated the OSC sequence\n (typically 0x07 for BEL or 0x5C for ST after ESC). This information is\n preserved in the parsed command so that responses can use the same terminator\n format for better compatibility with the calling program. For commands that\n do not require a response, this parameter is ignored and the resulting\n command will not retain the terminator information.\n\n The returned command handle is valid until the next call to any\n `ghostty_osc_*` function with the same parser instance with the exception\n of command introspection functions such as `ghostty_osc_command_type`.\n\n @param parser The parser handle, must not be null.\n @param terminator The terminating byte of the OSC sequence (0x07 for BEL, 0x5C for ST)\n @return Handle to the parsed OSC command\n\n @ingroup osc"]
+ pub fn ghostty_osc_end(parser: GhosttyOscParser_ptr, terminator: u8) -> GhosttyOscCommand_ptr;
+}
+unsafe extern "C" {
+ #[doc = " Get the type of an OSC command.\n\n Returns the type identifier for the given OSC command. This can be used\n to determine what kind of command was parsed and what data might be\n available from it.\n\n @param command The OSC command handle to query (may be NULL)\n @return The command type, or GHOSTTY_OSC_COMMAND_INVALID if command is NULL\n\n @ingroup osc"]
+ pub fn ghostty_osc_command_type(command: GhosttyOscCommand_ptr) -> GhosttyOscCommandType;
+}
+unsafe extern "C" {
+ #[doc = " Extract data from an OSC command.\n\n Extracts typed data from the given OSC command based on the specified\n data type. The output pointer must be of the appropriate type for the\n requested data kind. Valid command types, output types, and memory\n safety information are documented in the `GhosttyOscCommandData` enum.\n\n @param command The OSC command handle to query (may be NULL)\n @param data The type of data to extract\n @param out Pointer to store the extracted data (type depends on data parameter)\n @return true if data extraction was successful, false otherwise\n\n @ingroup osc"]
+ pub fn ghostty_osc_command_data(
+ command: GhosttyOscCommand_ptr,
+ data: GhosttyOscCommandData,
+ out: *mut ::std::os::raw::c_void,
+ ) -> bool;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttySgrParser {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to an SGR parser instance.\n\n This handle represents an SGR (Select Graphic Rendition) parser that can\n be used to parse SGR sequences and extract individual text attributes.\n\n @ingroup sgr"]
+pub type GhosttySgrParser_ptr = *mut GhosttySgrParser;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_UNSET: GhosttySgrAttributeTag = 0;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_UNKNOWN: GhosttySgrAttributeTag = 1;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_BOLD: GhosttySgrAttributeTag = 2;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_BOLD: GhosttySgrAttributeTag = 3;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_ITALIC: GhosttySgrAttributeTag = 4;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_ITALIC: GhosttySgrAttributeTag = 5;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_FAINT: GhosttySgrAttributeTag = 6;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_UNDERLINE: GhosttySgrAttributeTag = 7;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_UNDERLINE_COLOR: GhosttySgrAttributeTag = 8;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_UNDERLINE_COLOR_256: GhosttySgrAttributeTag = 9;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_UNDERLINE_COLOR: GhosttySgrAttributeTag =
+ 10;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_OVERLINE: GhosttySgrAttributeTag = 11;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_OVERLINE: GhosttySgrAttributeTag = 12;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_BLINK: GhosttySgrAttributeTag = 13;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_BLINK: GhosttySgrAttributeTag = 14;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_INVERSE: GhosttySgrAttributeTag = 15;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_INVERSE: GhosttySgrAttributeTag = 16;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_INVISIBLE: GhosttySgrAttributeTag = 17;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_INVISIBLE: GhosttySgrAttributeTag = 18;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_STRIKETHROUGH: GhosttySgrAttributeTag = 19;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_STRIKETHROUGH: GhosttySgrAttributeTag = 20;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_DIRECT_COLOR_FG: GhosttySgrAttributeTag = 21;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_DIRECT_COLOR_BG: GhosttySgrAttributeTag = 22;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_BG_8: GhosttySgrAttributeTag = 23;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_FG_8: GhosttySgrAttributeTag = 24;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_FG: GhosttySgrAttributeTag = 25;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_RESET_BG: GhosttySgrAttributeTag = 26;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_BRIGHT_BG_8: GhosttySgrAttributeTag = 27;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_BRIGHT_FG_8: GhosttySgrAttributeTag = 28;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_BG_256: GhosttySgrAttributeTag = 29;
+pub const GhosttySgrAttributeTag_GHOSTTY_SGR_ATTR_FG_256: GhosttySgrAttributeTag = 30;
+#[doc = " SGR attribute tags.\n\n These values identify the type of an SGR attribute in a tagged union.\n Use the tag to determine which field in the attribute value union to access.\n\n @ingroup sgr"]
+pub type GhosttySgrAttributeTag = ::std::os::raw::c_uint;
+pub const GhosttySgrUnderline_GHOSTTY_SGR_UNDERLINE_NONE: GhosttySgrUnderline = 0;
+pub const GhosttySgrUnderline_GHOSTTY_SGR_UNDERLINE_SINGLE: GhosttySgrUnderline = 1;
+pub const GhosttySgrUnderline_GHOSTTY_SGR_UNDERLINE_DOUBLE: GhosttySgrUnderline = 2;
+pub const GhosttySgrUnderline_GHOSTTY_SGR_UNDERLINE_CURLY: GhosttySgrUnderline = 3;
+pub const GhosttySgrUnderline_GHOSTTY_SGR_UNDERLINE_DOTTED: GhosttySgrUnderline = 4;
+pub const GhosttySgrUnderline_GHOSTTY_SGR_UNDERLINE_DASHED: GhosttySgrUnderline = 5;
+#[doc = " Underline style types.\n\n @ingroup sgr"]
+pub type GhosttySgrUnderline = ::std::os::raw::c_uint;
+#[doc = " Unknown SGR attribute data.\n\n Contains the full parameter list and the partial list where parsing\n encountered an unknown or invalid sequence.\n\n @ingroup sgr"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttySgrUnknown {
+ pub full_ptr: *const u16,
+ pub full_len: usize,
+ pub partial_ptr: *const u16,
+ pub partial_len: usize,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttySgrUnknown"][::std::mem::size_of::() - 32usize];
+ ["Alignment of GhosttySgrUnknown"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttySgrUnknown::full_ptr"]
+ [::std::mem::offset_of!(GhosttySgrUnknown, full_ptr) - 0usize];
+ ["Offset of field: GhosttySgrUnknown::full_len"]
+ [::std::mem::offset_of!(GhosttySgrUnknown, full_len) - 8usize];
+ ["Offset of field: GhosttySgrUnknown::partial_ptr"]
+ [::std::mem::offset_of!(GhosttySgrUnknown, partial_ptr) - 16usize];
+ ["Offset of field: GhosttySgrUnknown::partial_len"]
+ [::std::mem::offset_of!(GhosttySgrUnknown, partial_len) - 24usize];
+};
+impl Default for GhosttySgrUnknown {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " SGR attribute value union.\n\n This union contains all possible attribute values. Use the tag field\n to determine which union member is active. Attributes without associated\n data (like bold, italic) don't use the union value.\n\n @ingroup sgr"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union GhosttySgrAttributeValue {
+ pub unknown: GhosttySgrUnknown,
+ pub underline: GhosttySgrUnderline,
+ pub underline_color: GhosttyColorRgb,
+ pub underline_color_256: GhosttyColorPaletteIndex,
+ pub direct_color_fg: GhosttyColorRgb,
+ pub direct_color_bg: GhosttyColorRgb,
+ pub bg_8: GhosttyColorPaletteIndex,
+ pub fg_8: GhosttyColorPaletteIndex,
+ pub bright_bg_8: GhosttyColorPaletteIndex,
+ pub bright_fg_8: GhosttyColorPaletteIndex,
+ pub bg_256: GhosttyColorPaletteIndex,
+ pub fg_256: GhosttyColorPaletteIndex,
+ pub _padding: [u64; 8usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttySgrAttributeValue"]
+ [::std::mem::size_of::() - 64usize];
+ ["Alignment of GhosttySgrAttributeValue"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttySgrAttributeValue::unknown"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, unknown) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::underline"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, underline) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::underline_color"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, underline_color) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::underline_color_256"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, underline_color_256) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::direct_color_fg"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, direct_color_fg) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::direct_color_bg"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, direct_color_bg) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::bg_8"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, bg_8) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::fg_8"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, fg_8) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::bright_bg_8"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, bright_bg_8) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::bright_fg_8"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, bright_fg_8) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::bg_256"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, bg_256) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::fg_256"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, fg_256) - 0usize];
+ ["Offset of field: GhosttySgrAttributeValue::_padding"]
+ [::std::mem::offset_of!(GhosttySgrAttributeValue, _padding) - 0usize];
+};
+impl Default for GhosttySgrAttributeValue {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[doc = " SGR attribute (tagged union).\n\n A complete SGR attribute with both its type tag and associated value.\n Always check the tag field to determine which value union member is valid.\n\n Attributes without associated data (e.g., GHOSTTY_SGR_ATTR_BOLD) can be\n identified by tag alone; the value union is not used for these and\n the memory in the value field is undefined.\n\n @ingroup sgr"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct GhosttySgrAttribute {
+ pub tag: GhosttySgrAttributeTag,
+ pub value: GhosttySgrAttributeValue,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttySgrAttribute"][::std::mem::size_of::() - 72usize];
+ ["Alignment of GhosttySgrAttribute"][::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttySgrAttribute::tag"]
+ [::std::mem::offset_of!(GhosttySgrAttribute, tag) - 0usize];
+ ["Offset of field: GhosttySgrAttribute::value"]
+ [::std::mem::offset_of!(GhosttySgrAttribute, value) - 8usize];
+};
+impl Default for GhosttySgrAttribute {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+unsafe extern "C" {
+ #[doc = " Create a new SGR parser instance.\n\n Creates a new SGR (Select Graphic Rendition) parser using the provided\n allocator. The parser must be freed using ghostty_sgr_free() when\n no longer needed.\n\n @param allocator Pointer to the allocator to use for memory management, or\n NULL to use the default allocator\n @param parser Pointer to store the created parser handle\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_new(
+ allocator: *const GhosttyAllocator,
+ parser: *mut GhosttySgrParser_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free an SGR parser instance.\n\n Releases all resources associated with the SGR parser. After this call,\n the parser handle becomes invalid and must not be used. This includes\n any attributes previously returned by ghostty_sgr_next().\n\n @param parser The parser handle to free (may be NULL)\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_free(parser: GhosttySgrParser_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Reset an SGR parser instance to the beginning of the parameter list.\n\n Resets the parser's iteration state without clearing the parameters.\n After calling this, ghostty_sgr_next() will start from the beginning\n of the parameter list again.\n\n @param parser The parser handle to reset, must not be NULL\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_reset(parser: GhosttySgrParser_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Set SGR parameters for parsing.\n\n Sets the SGR parameter list to parse. Parameters are the numeric values\n from a CSI SGR sequence (e.g., for `ESC[1;31m`, params would be {1, 31}).\n\n The separators array optionally specifies the separator type for each\n parameter position. Each byte should be either ';' for semicolon or ':'\n for colon. This is needed for certain color formats that use colon\n separators (e.g., `ESC[4:3m` for curly underline). Any invalid separator\n values are treated as semicolons. The separators array must have the same\n length as the params array, if it is not NULL.\n\n If separators is NULL, all parameters are assumed to be semicolon-separated.\n\n This function makes an internal copy of the parameter and separator data,\n so the caller can safely free or modify the input arrays after this call.\n\n After calling this function, the parser is automatically reset and ready\n to iterate from the beginning.\n\n @param parser The parser handle, must not be NULL\n @param params Array of SGR parameter values\n @param separators Optional array of separator characters (';' or ':'), or\n NULL\n @param len Number of parameters (and separators if provided)\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_set_params(
+ parser: GhosttySgrParser_ptr,
+ params: *const u16,
+ separators: *const ::std::os::raw::c_char,
+ len: usize,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Get the next SGR attribute.\n\n Parses and returns the next attribute from the parameter list.\n Call this function repeatedly until it returns false to process\n all attributes in the sequence.\n\n @param parser The parser handle, must not be NULL\n @param attr Pointer to store the next attribute\n @return true if an attribute was returned, false if no more attributes\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_next(parser: GhosttySgrParser_ptr, attr: *mut GhosttySgrAttribute) -> bool;
+}
+unsafe extern "C" {
+ #[doc = " Get the full parameter list from an unknown SGR attribute.\n\n This function retrieves the full parameter list that was provided to the\n parser when an unknown attribute was encountered. Primarily useful in\n WebAssembly environments where accessing struct fields directly is difficult.\n\n @param unknown The unknown attribute data\n @param ptr Pointer to store the pointer to the parameter array (may be NULL)\n @return The length of the full parameter array\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_unknown_full(unknown: GhosttySgrUnknown, ptr: *mut *const u16) -> usize;
+}
+unsafe extern "C" {
+ #[doc = " Get the partial parameter list from an unknown SGR attribute.\n\n This function retrieves the partial parameter list where parsing stopped\n when an unknown attribute was encountered. Primarily useful in WebAssembly\n environments where accessing struct fields directly is difficult.\n\n @param unknown The unknown attribute data\n @param ptr Pointer to store the pointer to the parameter array (may be NULL)\n @return The length of the partial parameter array\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_unknown_partial(unknown: GhosttySgrUnknown, ptr: *mut *const u16) -> usize;
+}
+unsafe extern "C" {
+ #[doc = " Get the tag from an SGR attribute.\n\n This function extracts the tag that identifies which type of attribute\n this is. Primarily useful in WebAssembly environments where accessing\n struct fields directly is difficult.\n\n @param attr The SGR attribute\n @return The attribute tag\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_attribute_tag(attr: GhosttySgrAttribute) -> GhosttySgrAttributeTag;
+}
+unsafe extern "C" {
+ #[doc = " Get the value from an SGR attribute.\n\n This function returns a pointer to the value union from an SGR attribute. Use\n the tag to determine which field of the union is valid. Primarily useful in\n WebAssembly environments where accessing struct fields directly is difficult.\n\n @param attr Pointer to the SGR attribute\n @return Pointer to the attribute value union\n\n @ingroup sgr"]
+ pub fn ghostty_sgr_attribute_value(
+ attr: *mut GhosttySgrAttribute,
+ ) -> *mut GhosttySgrAttributeValue;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyKeyEvent {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a key event.\n\n This handle represents a keyboard input event containing information about\n the physical key pressed, modifiers, and generated text.\n\n @ingroup key"]
+pub type GhosttyKeyEvent_ptr = *mut GhosttyKeyEvent;
+#[doc = " Key was released"]
+pub const GhosttyKeyAction_GHOSTTY_KEY_ACTION_RELEASE: GhosttyKeyAction = 0;
+#[doc = " Key was pressed"]
+pub const GhosttyKeyAction_GHOSTTY_KEY_ACTION_PRESS: GhosttyKeyAction = 1;
+#[doc = " Key is being repeated (held down)"]
+pub const GhosttyKeyAction_GHOSTTY_KEY_ACTION_REPEAT: GhosttyKeyAction = 2;
+#[doc = " Keyboard input event types.\n\n @ingroup key"]
+pub type GhosttyKeyAction = ::std::os::raw::c_uint;
+#[doc = " Keyboard modifier keys bitmask.\n\n A bitmask representing all keyboard modifiers. This tracks which modifier keys\n are pressed and, where supported by the platform, which side (left or right)\n of each modifier is active.\n\n Use the GHOSTTY_MODS_* constants to test and set individual modifiers.\n\n Modifier side bits are only meaningful when the corresponding modifier bit is set.\n Not all platforms support distinguishing between left and right modifier\n keys and Ghostty is built to expect that some platforms may not provide this\n information.\n\n @ingroup key"]
+pub type GhosttyMods = u16;
+pub const GhosttyKey_GHOSTTY_KEY_UNIDENTIFIED: GhosttyKey = 0;
+pub const GhosttyKey_GHOSTTY_KEY_BACKQUOTE: GhosttyKey = 1;
+pub const GhosttyKey_GHOSTTY_KEY_BACKSLASH: GhosttyKey = 2;
+pub const GhosttyKey_GHOSTTY_KEY_BRACKET_LEFT: GhosttyKey = 3;
+pub const GhosttyKey_GHOSTTY_KEY_BRACKET_RIGHT: GhosttyKey = 4;
+pub const GhosttyKey_GHOSTTY_KEY_COMMA: GhosttyKey = 5;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_0: GhosttyKey = 6;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_1: GhosttyKey = 7;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_2: GhosttyKey = 8;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_3: GhosttyKey = 9;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_4: GhosttyKey = 10;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_5: GhosttyKey = 11;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_6: GhosttyKey = 12;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_7: GhosttyKey = 13;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_8: GhosttyKey = 14;
+pub const GhosttyKey_GHOSTTY_KEY_DIGIT_9: GhosttyKey = 15;
+pub const GhosttyKey_GHOSTTY_KEY_EQUAL: GhosttyKey = 16;
+pub const GhosttyKey_GHOSTTY_KEY_INTL_BACKSLASH: GhosttyKey = 17;
+pub const GhosttyKey_GHOSTTY_KEY_INTL_RO: GhosttyKey = 18;
+pub const GhosttyKey_GHOSTTY_KEY_INTL_YEN: GhosttyKey = 19;
+pub const GhosttyKey_GHOSTTY_KEY_A: GhosttyKey = 20;
+pub const GhosttyKey_GHOSTTY_KEY_B: GhosttyKey = 21;
+pub const GhosttyKey_GHOSTTY_KEY_C: GhosttyKey = 22;
+pub const GhosttyKey_GHOSTTY_KEY_D: GhosttyKey = 23;
+pub const GhosttyKey_GHOSTTY_KEY_E: GhosttyKey = 24;
+pub const GhosttyKey_GHOSTTY_KEY_F: GhosttyKey = 25;
+pub const GhosttyKey_GHOSTTY_KEY_G: GhosttyKey = 26;
+pub const GhosttyKey_GHOSTTY_KEY_H: GhosttyKey = 27;
+pub const GhosttyKey_GHOSTTY_KEY_I: GhosttyKey = 28;
+pub const GhosttyKey_GHOSTTY_KEY_J: GhosttyKey = 29;
+pub const GhosttyKey_GHOSTTY_KEY_K: GhosttyKey = 30;
+pub const GhosttyKey_GHOSTTY_KEY_L: GhosttyKey = 31;
+pub const GhosttyKey_GHOSTTY_KEY_M: GhosttyKey = 32;
+pub const GhosttyKey_GHOSTTY_KEY_N: GhosttyKey = 33;
+pub const GhosttyKey_GHOSTTY_KEY_O: GhosttyKey = 34;
+pub const GhosttyKey_GHOSTTY_KEY_P: GhosttyKey = 35;
+pub const GhosttyKey_GHOSTTY_KEY_Q: GhosttyKey = 36;
+pub const GhosttyKey_GHOSTTY_KEY_R: GhosttyKey = 37;
+pub const GhosttyKey_GHOSTTY_KEY_S: GhosttyKey = 38;
+pub const GhosttyKey_GHOSTTY_KEY_T: GhosttyKey = 39;
+pub const GhosttyKey_GHOSTTY_KEY_U: GhosttyKey = 40;
+pub const GhosttyKey_GHOSTTY_KEY_V: GhosttyKey = 41;
+pub const GhosttyKey_GHOSTTY_KEY_W: GhosttyKey = 42;
+pub const GhosttyKey_GHOSTTY_KEY_X: GhosttyKey = 43;
+pub const GhosttyKey_GHOSTTY_KEY_Y: GhosttyKey = 44;
+pub const GhosttyKey_GHOSTTY_KEY_Z: GhosttyKey = 45;
+pub const GhosttyKey_GHOSTTY_KEY_MINUS: GhosttyKey = 46;
+pub const GhosttyKey_GHOSTTY_KEY_PERIOD: GhosttyKey = 47;
+pub const GhosttyKey_GHOSTTY_KEY_QUOTE: GhosttyKey = 48;
+pub const GhosttyKey_GHOSTTY_KEY_SEMICOLON: GhosttyKey = 49;
+pub const GhosttyKey_GHOSTTY_KEY_SLASH: GhosttyKey = 50;
+pub const GhosttyKey_GHOSTTY_KEY_ALT_LEFT: GhosttyKey = 51;
+pub const GhosttyKey_GHOSTTY_KEY_ALT_RIGHT: GhosttyKey = 52;
+pub const GhosttyKey_GHOSTTY_KEY_BACKSPACE: GhosttyKey = 53;
+pub const GhosttyKey_GHOSTTY_KEY_CAPS_LOCK: GhosttyKey = 54;
+pub const GhosttyKey_GHOSTTY_KEY_CONTEXT_MENU: GhosttyKey = 55;
+pub const GhosttyKey_GHOSTTY_KEY_CONTROL_LEFT: GhosttyKey = 56;
+pub const GhosttyKey_GHOSTTY_KEY_CONTROL_RIGHT: GhosttyKey = 57;
+pub const GhosttyKey_GHOSTTY_KEY_ENTER: GhosttyKey = 58;
+pub const GhosttyKey_GHOSTTY_KEY_META_LEFT: GhosttyKey = 59;
+pub const GhosttyKey_GHOSTTY_KEY_META_RIGHT: GhosttyKey = 60;
+pub const GhosttyKey_GHOSTTY_KEY_SHIFT_LEFT: GhosttyKey = 61;
+pub const GhosttyKey_GHOSTTY_KEY_SHIFT_RIGHT: GhosttyKey = 62;
+pub const GhosttyKey_GHOSTTY_KEY_SPACE: GhosttyKey = 63;
+pub const GhosttyKey_GHOSTTY_KEY_TAB: GhosttyKey = 64;
+pub const GhosttyKey_GHOSTTY_KEY_CONVERT: GhosttyKey = 65;
+pub const GhosttyKey_GHOSTTY_KEY_KANA_MODE: GhosttyKey = 66;
+pub const GhosttyKey_GHOSTTY_KEY_NON_CONVERT: GhosttyKey = 67;
+pub const GhosttyKey_GHOSTTY_KEY_DELETE: GhosttyKey = 68;
+pub const GhosttyKey_GHOSTTY_KEY_END: GhosttyKey = 69;
+pub const GhosttyKey_GHOSTTY_KEY_HELP: GhosttyKey = 70;
+pub const GhosttyKey_GHOSTTY_KEY_HOME: GhosttyKey = 71;
+pub const GhosttyKey_GHOSTTY_KEY_INSERT: GhosttyKey = 72;
+pub const GhosttyKey_GHOSTTY_KEY_PAGE_DOWN: GhosttyKey = 73;
+pub const GhosttyKey_GHOSTTY_KEY_PAGE_UP: GhosttyKey = 74;
+pub const GhosttyKey_GHOSTTY_KEY_ARROW_DOWN: GhosttyKey = 75;
+pub const GhosttyKey_GHOSTTY_KEY_ARROW_LEFT: GhosttyKey = 76;
+pub const GhosttyKey_GHOSTTY_KEY_ARROW_RIGHT: GhosttyKey = 77;
+pub const GhosttyKey_GHOSTTY_KEY_ARROW_UP: GhosttyKey = 78;
+pub const GhosttyKey_GHOSTTY_KEY_NUM_LOCK: GhosttyKey = 79;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_0: GhosttyKey = 80;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_1: GhosttyKey = 81;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_2: GhosttyKey = 82;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_3: GhosttyKey = 83;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_4: GhosttyKey = 84;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_5: GhosttyKey = 85;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_6: GhosttyKey = 86;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_7: GhosttyKey = 87;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_8: GhosttyKey = 88;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_9: GhosttyKey = 89;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_ADD: GhosttyKey = 90;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_BACKSPACE: GhosttyKey = 91;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_CLEAR: GhosttyKey = 92;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_CLEAR_ENTRY: GhosttyKey = 93;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_COMMA: GhosttyKey = 94;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_DECIMAL: GhosttyKey = 95;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_DIVIDE: GhosttyKey = 96;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_ENTER: GhosttyKey = 97;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_EQUAL: GhosttyKey = 98;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_MEMORY_ADD: GhosttyKey = 99;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_MEMORY_CLEAR: GhosttyKey = 100;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_MEMORY_RECALL: GhosttyKey = 101;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_MEMORY_STORE: GhosttyKey = 102;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_MEMORY_SUBTRACT: GhosttyKey = 103;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_MULTIPLY: GhosttyKey = 104;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_PAREN_LEFT: GhosttyKey = 105;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_PAREN_RIGHT: GhosttyKey = 106;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_SUBTRACT: GhosttyKey = 107;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_SEPARATOR: GhosttyKey = 108;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_UP: GhosttyKey = 109;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_DOWN: GhosttyKey = 110;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_RIGHT: GhosttyKey = 111;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_LEFT: GhosttyKey = 112;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_BEGIN: GhosttyKey = 113;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_HOME: GhosttyKey = 114;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_END: GhosttyKey = 115;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_INSERT: GhosttyKey = 116;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_DELETE: GhosttyKey = 117;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_PAGE_UP: GhosttyKey = 118;
+pub const GhosttyKey_GHOSTTY_KEY_NUMPAD_PAGE_DOWN: GhosttyKey = 119;
+pub const GhosttyKey_GHOSTTY_KEY_ESCAPE: GhosttyKey = 120;
+pub const GhosttyKey_GHOSTTY_KEY_F1: GhosttyKey = 121;
+pub const GhosttyKey_GHOSTTY_KEY_F2: GhosttyKey = 122;
+pub const GhosttyKey_GHOSTTY_KEY_F3: GhosttyKey = 123;
+pub const GhosttyKey_GHOSTTY_KEY_F4: GhosttyKey = 124;
+pub const GhosttyKey_GHOSTTY_KEY_F5: GhosttyKey = 125;
+pub const GhosttyKey_GHOSTTY_KEY_F6: GhosttyKey = 126;
+pub const GhosttyKey_GHOSTTY_KEY_F7: GhosttyKey = 127;
+pub const GhosttyKey_GHOSTTY_KEY_F8: GhosttyKey = 128;
+pub const GhosttyKey_GHOSTTY_KEY_F9: GhosttyKey = 129;
+pub const GhosttyKey_GHOSTTY_KEY_F10: GhosttyKey = 130;
+pub const GhosttyKey_GHOSTTY_KEY_F11: GhosttyKey = 131;
+pub const GhosttyKey_GHOSTTY_KEY_F12: GhosttyKey = 132;
+pub const GhosttyKey_GHOSTTY_KEY_F13: GhosttyKey = 133;
+pub const GhosttyKey_GHOSTTY_KEY_F14: GhosttyKey = 134;
+pub const GhosttyKey_GHOSTTY_KEY_F15: GhosttyKey = 135;
+pub const GhosttyKey_GHOSTTY_KEY_F16: GhosttyKey = 136;
+pub const GhosttyKey_GHOSTTY_KEY_F17: GhosttyKey = 137;
+pub const GhosttyKey_GHOSTTY_KEY_F18: GhosttyKey = 138;
+pub const GhosttyKey_GHOSTTY_KEY_F19: GhosttyKey = 139;
+pub const GhosttyKey_GHOSTTY_KEY_F20: GhosttyKey = 140;
+pub const GhosttyKey_GHOSTTY_KEY_F21: GhosttyKey = 141;
+pub const GhosttyKey_GHOSTTY_KEY_F22: GhosttyKey = 142;
+pub const GhosttyKey_GHOSTTY_KEY_F23: GhosttyKey = 143;
+pub const GhosttyKey_GHOSTTY_KEY_F24: GhosttyKey = 144;
+pub const GhosttyKey_GHOSTTY_KEY_F25: GhosttyKey = 145;
+pub const GhosttyKey_GHOSTTY_KEY_FN: GhosttyKey = 146;
+pub const GhosttyKey_GHOSTTY_KEY_FN_LOCK: GhosttyKey = 147;
+pub const GhosttyKey_GHOSTTY_KEY_PRINT_SCREEN: GhosttyKey = 148;
+pub const GhosttyKey_GHOSTTY_KEY_SCROLL_LOCK: GhosttyKey = 149;
+pub const GhosttyKey_GHOSTTY_KEY_PAUSE: GhosttyKey = 150;
+pub const GhosttyKey_GHOSTTY_KEY_BROWSER_BACK: GhosttyKey = 151;
+pub const GhosttyKey_GHOSTTY_KEY_BROWSER_FAVORITES: GhosttyKey = 152;
+pub const GhosttyKey_GHOSTTY_KEY_BROWSER_FORWARD: GhosttyKey = 153;
+pub const GhosttyKey_GHOSTTY_KEY_BROWSER_HOME: GhosttyKey = 154;
+pub const GhosttyKey_GHOSTTY_KEY_BROWSER_REFRESH: GhosttyKey = 155;
+pub const GhosttyKey_GHOSTTY_KEY_BROWSER_SEARCH: GhosttyKey = 156;
+pub const GhosttyKey_GHOSTTY_KEY_BROWSER_STOP: GhosttyKey = 157;
+pub const GhosttyKey_GHOSTTY_KEY_EJECT: GhosttyKey = 158;
+pub const GhosttyKey_GHOSTTY_KEY_LAUNCH_APP_1: GhosttyKey = 159;
+pub const GhosttyKey_GHOSTTY_KEY_LAUNCH_APP_2: GhosttyKey = 160;
+pub const GhosttyKey_GHOSTTY_KEY_LAUNCH_MAIL: GhosttyKey = 161;
+pub const GhosttyKey_GHOSTTY_KEY_MEDIA_PLAY_PAUSE: GhosttyKey = 162;
+pub const GhosttyKey_GHOSTTY_KEY_MEDIA_SELECT: GhosttyKey = 163;
+pub const GhosttyKey_GHOSTTY_KEY_MEDIA_STOP: GhosttyKey = 164;
+pub const GhosttyKey_GHOSTTY_KEY_MEDIA_TRACK_NEXT: GhosttyKey = 165;
+pub const GhosttyKey_GHOSTTY_KEY_MEDIA_TRACK_PREVIOUS: GhosttyKey = 166;
+pub const GhosttyKey_GHOSTTY_KEY_POWER: GhosttyKey = 167;
+pub const GhosttyKey_GHOSTTY_KEY_SLEEP: GhosttyKey = 168;
+pub const GhosttyKey_GHOSTTY_KEY_AUDIO_VOLUME_DOWN: GhosttyKey = 169;
+pub const GhosttyKey_GHOSTTY_KEY_AUDIO_VOLUME_MUTE: GhosttyKey = 170;
+pub const GhosttyKey_GHOSTTY_KEY_AUDIO_VOLUME_UP: GhosttyKey = 171;
+pub const GhosttyKey_GHOSTTY_KEY_WAKE_UP: GhosttyKey = 172;
+pub const GhosttyKey_GHOSTTY_KEY_COPY: GhosttyKey = 173;
+pub const GhosttyKey_GHOSTTY_KEY_CUT: GhosttyKey = 174;
+pub const GhosttyKey_GHOSTTY_KEY_PASTE: GhosttyKey = 175;
+#[doc = " Physical key codes.\n\n The set of key codes that Ghostty is aware of. These represent physical keys\n on the keyboard and are layout-independent. For example, the \"a\" key on a US\n keyboard is the same as the \"ф\" key on a Russian keyboard, but both will\n report the same key_a value.\n\n Layout-dependent strings are provided separately as UTF-8 text and are produced\n by the platform. These values are based on the W3C UI Events KeyboardEvent code\n standard. See: https://www.w3.org/TR/uievents-code\n\n @ingroup key"]
+pub type GhosttyKey = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Create a new key event instance.\n\n Creates a new key event with default values. The event must be freed using\n ghostty_key_event_free() when no longer needed.\n\n @param allocator Pointer to the allocator to use for memory management, or NULL to use the default allocator\n @param event Pointer to store the created key event handle\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup key"]
+ pub fn ghostty_key_event_new(
+ allocator: *const GhosttyAllocator,
+ event: *mut GhosttyKeyEvent_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a key event instance.\n\n Releases all resources associated with the key event. After this call,\n the event handle becomes invalid and must not be used.\n\n @param event The key event handle to free (may be NULL)\n\n @ingroup key"]
+ pub fn ghostty_key_event_free(event: GhosttyKeyEvent_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Set the key action (press, release, repeat).\n\n @param event The key event handle, must not be NULL\n @param action The action to set\n\n @ingroup key"]
+ pub fn ghostty_key_event_set_action(event: GhosttyKeyEvent_ptr, action: GhosttyKeyAction);
+}
+unsafe extern "C" {
+ #[doc = " Get the key action (press, release, repeat).\n\n @param event The key event handle, must not be NULL\n @return The key action\n\n @ingroup key"]
+ pub fn ghostty_key_event_get_action(event: GhosttyKeyEvent_ptr) -> GhosttyKeyAction;
+}
+unsafe extern "C" {
+ #[doc = " Set the physical key code.\n\n @param event The key event handle, must not be NULL\n @param key The physical key code to set\n\n @ingroup key"]
+ pub fn ghostty_key_event_set_key(event: GhosttyKeyEvent_ptr, key: GhosttyKey);
+}
+unsafe extern "C" {
+ #[doc = " Get the physical key code.\n\n @param event The key event handle, must not be NULL\n @return The physical key code\n\n @ingroup key"]
+ pub fn ghostty_key_event_get_key(event: GhosttyKeyEvent_ptr) -> GhosttyKey;
+}
+unsafe extern "C" {
+ #[doc = " Set the modifier keys bitmask.\n\n @param event The key event handle, must not be NULL\n @param mods The modifier keys bitmask to set\n\n @ingroup key"]
+ pub fn ghostty_key_event_set_mods(event: GhosttyKeyEvent_ptr, mods: GhosttyMods);
+}
+unsafe extern "C" {
+ #[doc = " Get the modifier keys bitmask.\n\n @param event The key event handle, must not be NULL\n @return The modifier keys bitmask\n\n @ingroup key"]
+ pub fn ghostty_key_event_get_mods(event: GhosttyKeyEvent_ptr) -> GhosttyMods;
+}
+unsafe extern "C" {
+ #[doc = " Set the consumed modifiers bitmask.\n\n @param event The key event handle, must not be NULL\n @param consumed_mods The consumed modifiers bitmask to set\n\n @ingroup key"]
+ pub fn ghostty_key_event_set_consumed_mods(
+ event: GhosttyKeyEvent_ptr,
+ consumed_mods: GhosttyMods,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Get the consumed modifiers bitmask.\n\n @param event The key event handle, must not be NULL\n @return The consumed modifiers bitmask\n\n @ingroup key"]
+ pub fn ghostty_key_event_get_consumed_mods(event: GhosttyKeyEvent_ptr) -> GhosttyMods;
+}
+unsafe extern "C" {
+ #[doc = " Set whether the key event is part of a composition sequence.\n\n @param event The key event handle, must not be NULL\n @param composing Whether the key event is part of a composition sequence\n\n @ingroup key"]
+ pub fn ghostty_key_event_set_composing(event: GhosttyKeyEvent_ptr, composing: bool);
+}
+unsafe extern "C" {
+ #[doc = " Get whether the key event is part of a composition sequence.\n\n @param event The key event handle, must not be NULL\n @return Whether the key event is part of a composition sequence\n\n @ingroup key"]
+ pub fn ghostty_key_event_get_composing(event: GhosttyKeyEvent_ptr) -> bool;
+}
+unsafe extern "C" {
+ #[doc = " Set the UTF-8 text generated by the key event.\n\n The key event does NOT take ownership of the text pointer. The caller\n must ensure the string remains valid for the lifetime needed by the event.\n\n @param event The key event handle, must not be NULL\n @param utf8 The UTF-8 text to set (or NULL for empty)\n @param len Length of the UTF-8 text in bytes\n\n @ingroup key"]
+ pub fn ghostty_key_event_set_utf8(
+ event: GhosttyKeyEvent_ptr,
+ utf8: *const ::std::os::raw::c_char,
+ len: usize,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Get the UTF-8 text generated by the key event.\n\n The returned pointer is valid until the event is freed or the UTF-8 text is modified.\n\n @param event The key event handle, must not be NULL\n @param len Pointer to store the length of the UTF-8 text in bytes (may be NULL)\n @return The UTF-8 text (or NULL for empty)\n\n @ingroup key"]
+ pub fn ghostty_key_event_get_utf8(
+ event: GhosttyKeyEvent_ptr,
+ len: *mut usize,
+ ) -> *const ::std::os::raw::c_char;
+}
+unsafe extern "C" {
+ #[doc = " Set the unshifted Unicode codepoint.\n\n @param event The key event handle, must not be NULL\n @param codepoint The unshifted Unicode codepoint to set\n\n @ingroup key"]
+ pub fn ghostty_key_event_set_unshifted_codepoint(event: GhosttyKeyEvent_ptr, codepoint: u32);
+}
+unsafe extern "C" {
+ #[doc = " Get the unshifted Unicode codepoint.\n\n @param event The key event handle, must not be NULL\n @return The unshifted Unicode codepoint\n\n @ingroup key"]
+ pub fn ghostty_key_event_get_unshifted_codepoint(event: GhosttyKeyEvent_ptr) -> u32;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyKeyEncoder {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a key encoder instance.\n\n This handle represents a key encoder that converts key events into terminal\n escape sequences.\n\n @ingroup key"]
+pub type GhosttyKeyEncoder_ptr = *mut GhosttyKeyEncoder;
+#[doc = " Kitty keyboard protocol flags.\n\n Bitflags representing the various modes of the Kitty keyboard protocol.\n These can be combined using bitwise OR operations. Valid values all\n start with `GHOSTTY_KITTY_KEY_`.\n\n @ingroup key"]
+pub type GhosttyKittyKeyFlags = u8;
+#[doc = " Option key is not treated as alt"]
+pub const GhosttyOptionAsAlt_GHOSTTY_OPTION_AS_ALT_FALSE: GhosttyOptionAsAlt = 0;
+#[doc = " Option key is treated as alt"]
+pub const GhosttyOptionAsAlt_GHOSTTY_OPTION_AS_ALT_TRUE: GhosttyOptionAsAlt = 1;
+#[doc = " Only left option key is treated as alt"]
+pub const GhosttyOptionAsAlt_GHOSTTY_OPTION_AS_ALT_LEFT: GhosttyOptionAsAlt = 2;
+#[doc = " Only right option key is treated as alt"]
+pub const GhosttyOptionAsAlt_GHOSTTY_OPTION_AS_ALT_RIGHT: GhosttyOptionAsAlt = 3;
+#[doc = " macOS option key behavior.\n\n Determines whether the \"option\" key on macOS is treated as \"alt\" or not.\n See the Ghostty `macos-option-as-alt` configuration option for more details.\n\n @ingroup key"]
+pub type GhosttyOptionAsAlt = ::std::os::raw::c_uint;
+#[doc = " Terminal DEC mode 1: cursor key application mode (value: bool)"]
+pub const GhosttyKeyEncoderOption_GHOSTTY_KEY_ENCODER_OPT_CURSOR_KEY_APPLICATION:
+ GhosttyKeyEncoderOption = 0;
+#[doc = " Terminal DEC mode 66: keypad key application mode (value: bool)"]
+pub const GhosttyKeyEncoderOption_GHOSTTY_KEY_ENCODER_OPT_KEYPAD_KEY_APPLICATION:
+ GhosttyKeyEncoderOption = 1;
+#[doc = " Terminal DEC mode 1035: ignore keypad with numlock (value: bool)"]
+pub const GhosttyKeyEncoderOption_GHOSTTY_KEY_ENCODER_OPT_IGNORE_KEYPAD_WITH_NUMLOCK:
+ GhosttyKeyEncoderOption = 2;
+#[doc = " Terminal DEC mode 1036: alt sends escape prefix (value: bool)"]
+pub const GhosttyKeyEncoderOption_GHOSTTY_KEY_ENCODER_OPT_ALT_ESC_PREFIX: GhosttyKeyEncoderOption =
+ 3;
+#[doc = " xterm modifyOtherKeys mode 2 (value: bool)"]
+pub const GhosttyKeyEncoderOption_GHOSTTY_KEY_ENCODER_OPT_MODIFY_OTHER_KEYS_STATE_2:
+ GhosttyKeyEncoderOption = 4;
+#[doc = " Kitty keyboard protocol flags (value: GhosttyKittyKeyFlags bitmask)"]
+pub const GhosttyKeyEncoderOption_GHOSTTY_KEY_ENCODER_OPT_KITTY_FLAGS: GhosttyKeyEncoderOption = 5;
+#[doc = " macOS option-as-alt setting (value: GhosttyOptionAsAlt)"]
+pub const GhosttyKeyEncoderOption_GHOSTTY_KEY_ENCODER_OPT_MACOS_OPTION_AS_ALT:
+ GhosttyKeyEncoderOption = 6;
+#[doc = " Key encoder option identifiers.\n\n These values are used with ghostty_key_encoder_setopt() to configure\n the behavior of the key encoder.\n\n @ingroup key"]
+pub type GhosttyKeyEncoderOption = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Create a new key encoder instance.\n\n Creates a new key encoder with default options. The encoder can be configured\n using ghostty_key_encoder_setopt() and must be freed using\n ghostty_key_encoder_free() when no longer needed.\n\n @param allocator Pointer to the allocator to use for memory management, or NULL to use the default allocator\n @param encoder Pointer to store the created encoder handle\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup key"]
+ pub fn ghostty_key_encoder_new(
+ allocator: *const GhosttyAllocator,
+ encoder: *mut GhosttyKeyEncoder_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a key encoder instance.\n\n Releases all resources associated with the key encoder. After this call,\n the encoder handle becomes invalid and must not be used.\n\n @param encoder The encoder handle to free (may be NULL)\n\n @ingroup key"]
+ pub fn ghostty_key_encoder_free(encoder: GhosttyKeyEncoder_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Set an option on the key encoder.\n\n Configures the behavior of the key encoder. Options control various aspects\n of encoding such as terminal modes (cursor key application mode, keypad mode),\n protocol selection (Kitty keyboard protocol flags), and platform-specific\n behaviors (macOS option-as-alt).\n\n If you are using a terminal instance, you can set the key encoding\n options based on the active terminal state (e.g. legacy vs Kitty mode\n and associated flags) with ghostty_key_encoder_setopt_from_terminal().\n\n A null pointer value does nothing. It does not reset the value to the\n default. The setopt call will do nothing.\n\n @param encoder The encoder handle, must not be NULL\n @param option The option to set\n @param value Pointer to the value to set (type depends on the option)\n\n @ingroup key"]
+ pub fn ghostty_key_encoder_setopt(
+ encoder: GhosttyKeyEncoder_ptr,
+ option: GhosttyKeyEncoderOption,
+ value: *const ::std::os::raw::c_void,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Set encoder options from a terminal's current state.\n\n Reads the terminal's current modes and flags and applies them to the\n encoder's options. This sets cursor key application mode, keypad mode,\n alt escape prefix, modifyOtherKeys state, and Kitty keyboard protocol\n flags from the terminal state.\n\n Note that the `macos_option_as_alt` option cannot be determined from\n terminal state and is reset to `GHOSTTY_OPTION_AS_ALT_FALSE` by this\n call. Use ghostty_key_encoder_setopt() to set it afterward if needed.\n\n @param encoder The encoder handle, must not be NULL\n @param terminal The terminal handle, must not be NULL\n\n @ingroup key"]
+ pub fn ghostty_key_encoder_setopt_from_terminal(
+ encoder: GhosttyKeyEncoder_ptr,
+ terminal: GhosttyTerminal_ptr,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Encode a key event into a terminal escape sequence.\n\n Converts a key event into the appropriate terminal escape sequence based on\n the encoder's current options. The sequence is written to the provided buffer.\n\n Not all key events produce output. For example, unmodified modifier keys\n typically don't generate escape sequences. Check the out_len parameter to\n determine if any data was written.\n\n If the output buffer is too small, this function returns GHOSTTY_OUT_OF_SPACE\n and out_len will contain the required buffer size. The caller can then\n allocate a larger buffer and call the function again.\n\n @param encoder The encoder handle, must not be NULL\n @param event The key event to encode, must not be NULL\n @param out_buf Buffer to write the encoded sequence to\n @param out_buf_size Size of the output buffer in bytes\n @param out_len Pointer to store the number of bytes written (may be NULL)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if buffer too small, or other error code\n\n ## Example: Calculate required buffer size\n\n @code{.c}\n // Query the required size with a NULL buffer (always returns OUT_OF_SPACE)\n size_t required = 0;\n GhosttyResult result = ghostty_key_encoder_encode(encoder, event, NULL, 0, &required);\n assert(result == GHOSTTY_OUT_OF_SPACE);\n\n // Allocate buffer of required size\n char *buf = malloc(required);\n\n // Encode with properly sized buffer\n size_t written = 0;\n result = ghostty_key_encoder_encode(encoder, event, buf, required, &written);\n assert(result == GHOSTTY_SUCCESS);\n\n // Use the encoded sequence...\n\n free(buf);\n @endcode\n\n ## Example: Direct encoding with static buffer\n\n @code{.c}\n // Most escape sequences are short, so a static buffer often suffices\n char buf[128];\n size_t written = 0;\n GhosttyResult result = ghostty_key_encoder_encode(encoder, event, buf, sizeof(buf), &written);\n\n if (result == GHOSTTY_SUCCESS) {\n // Write the encoded sequence to the terminal\n write(pty_fd, buf, written);\n } else if (result == GHOSTTY_OUT_OF_SPACE) {\n // Buffer too small, written contains required size\n char *dynamic_buf = malloc(written);\n result = ghostty_key_encoder_encode(encoder, event, dynamic_buf, written, &written);\n assert(result == GHOSTTY_SUCCESS);\n write(pty_fd, dynamic_buf, written);\n free(dynamic_buf);\n }\n @endcode\n\n @ingroup key"]
+ pub fn ghostty_key_encoder_encode(
+ encoder: GhosttyKeyEncoder_ptr,
+ event: GhosttyKeyEvent_ptr,
+ out_buf: *mut ::std::os::raw::c_char,
+ out_buf_size: usize,
+ out_len: *mut usize,
+ ) -> GhosttyResult;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyMouseEvent {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a mouse event.\n\n This handle represents a normalized mouse input event containing\n action, button, modifiers, and surface-space position.\n\n @ingroup mouse"]
+pub type GhosttyMouseEvent_ptr = *mut GhosttyMouseEvent;
+#[doc = " Mouse button was pressed."]
+pub const GhosttyMouseAction_GHOSTTY_MOUSE_ACTION_PRESS: GhosttyMouseAction = 0;
+#[doc = " Mouse button was released."]
+pub const GhosttyMouseAction_GHOSTTY_MOUSE_ACTION_RELEASE: GhosttyMouseAction = 1;
+#[doc = " Mouse moved."]
+pub const GhosttyMouseAction_GHOSTTY_MOUSE_ACTION_MOTION: GhosttyMouseAction = 2;
+#[doc = " Mouse event action type.\n\n @ingroup mouse"]
+pub type GhosttyMouseAction = ::std::os::raw::c_uint;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_UNKNOWN: GhosttyMouseButton = 0;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_LEFT: GhosttyMouseButton = 1;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_RIGHT: GhosttyMouseButton = 2;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_MIDDLE: GhosttyMouseButton = 3;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_FOUR: GhosttyMouseButton = 4;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_FIVE: GhosttyMouseButton = 5;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_SIX: GhosttyMouseButton = 6;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_SEVEN: GhosttyMouseButton = 7;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_EIGHT: GhosttyMouseButton = 8;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_NINE: GhosttyMouseButton = 9;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_TEN: GhosttyMouseButton = 10;
+pub const GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_ELEVEN: GhosttyMouseButton = 11;
+#[doc = " Mouse button identity.\n\n @ingroup mouse"]
+pub type GhosttyMouseButton = ::std::os::raw::c_uint;
+#[doc = " Mouse position in surface-space pixels.\n\n @ingroup mouse"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyMousePosition {
+ pub x: f32,
+ pub y: f32,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyMousePosition"][::std::mem::size_of::() - 8usize];
+ ["Alignment of GhosttyMousePosition"][::std::mem::align_of::() - 4usize];
+ ["Offset of field: GhosttyMousePosition::x"]
+ [::std::mem::offset_of!(GhosttyMousePosition, x) - 0usize];
+ ["Offset of field: GhosttyMousePosition::y"]
+ [::std::mem::offset_of!(GhosttyMousePosition, y) - 4usize];
+};
+unsafe extern "C" {
+ #[doc = " Create a new mouse event instance.\n\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param event Pointer to store the created event handle\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_new(
+ allocator: *const GhosttyAllocator,
+ event: *mut GhosttyMouseEvent_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a mouse event instance.\n\n @param event The mouse event handle to free (may be NULL)\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_free(event: GhosttyMouseEvent_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Set the event action.\n\n @param event The event handle, must not be NULL\n @param action The action to set\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_set_action(event: GhosttyMouseEvent_ptr, action: GhosttyMouseAction);
+}
+unsafe extern "C" {
+ #[doc = " Get the event action.\n\n @param event The event handle, must not be NULL\n @return The event action\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_get_action(event: GhosttyMouseEvent_ptr) -> GhosttyMouseAction;
+}
+unsafe extern "C" {
+ #[doc = " Set the event button.\n\n This sets a concrete button identity for the event.\n To represent \"no button\" (for motion events), use\n ghostty_mouse_event_clear_button().\n\n @param event The event handle, must not be NULL\n @param button The button to set\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_set_button(event: GhosttyMouseEvent_ptr, button: GhosttyMouseButton);
+}
+unsafe extern "C" {
+ #[doc = " Clear the event button.\n\n This sets the event button to \"none\".\n\n @param event The event handle, must not be NULL\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_clear_button(event: GhosttyMouseEvent_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Get the event button.\n\n @param event The event handle, must not be NULL\n @param out_button Output pointer for the button value (may be NULL)\n @return true if a button is set, false if no button is set\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_get_button(
+ event: GhosttyMouseEvent_ptr,
+ out_button: *mut GhosttyMouseButton,
+ ) -> bool;
+}
+unsafe extern "C" {
+ #[doc = " Set keyboard modifiers held during the event.\n\n @param event The event handle, must not be NULL\n @param mods Modifier bitmask\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_set_mods(event: GhosttyMouseEvent_ptr, mods: GhosttyMods);
+}
+unsafe extern "C" {
+ #[doc = " Get keyboard modifiers held during the event.\n\n @param event The event handle, must not be NULL\n @return Modifier bitmask\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_get_mods(event: GhosttyMouseEvent_ptr) -> GhosttyMods;
+}
+unsafe extern "C" {
+ #[doc = " Set the event position in surface-space pixels.\n\n @param event The event handle, must not be NULL\n @param position The position to set\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_set_position(
+ event: GhosttyMouseEvent_ptr,
+ position: GhosttyMousePosition,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Get the event position in surface-space pixels.\n\n @param event The event handle, must not be NULL\n @return The current event position\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_event_get_position(event: GhosttyMouseEvent_ptr) -> GhosttyMousePosition;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct GhosttyMouseEncoder {
+ _unused: [u8; 0],
+}
+#[doc = " Opaque handle to a mouse encoder instance.\n\n This handle represents a mouse encoder that converts normalized\n mouse events into terminal escape sequences.\n\n @ingroup mouse"]
+pub type GhosttyMouseEncoder_ptr = *mut GhosttyMouseEncoder;
+#[doc = " Mouse reporting disabled."]
+pub const GhosttyMouseTrackingMode_GHOSTTY_MOUSE_TRACKING_NONE: GhosttyMouseTrackingMode = 0;
+#[doc = " X10 mouse mode."]
+pub const GhosttyMouseTrackingMode_GHOSTTY_MOUSE_TRACKING_X10: GhosttyMouseTrackingMode = 1;
+#[doc = " Normal mouse mode (button press/release only)."]
+pub const GhosttyMouseTrackingMode_GHOSTTY_MOUSE_TRACKING_NORMAL: GhosttyMouseTrackingMode = 2;
+#[doc = " Button-event tracking mode."]
+pub const GhosttyMouseTrackingMode_GHOSTTY_MOUSE_TRACKING_BUTTON: GhosttyMouseTrackingMode = 3;
+#[doc = " Any-event tracking mode."]
+pub const GhosttyMouseTrackingMode_GHOSTTY_MOUSE_TRACKING_ANY: GhosttyMouseTrackingMode = 4;
+#[doc = " Mouse tracking mode.\n\n @ingroup mouse"]
+pub type GhosttyMouseTrackingMode = ::std::os::raw::c_uint;
+pub const GhosttyMouseFormat_GHOSTTY_MOUSE_FORMAT_X10: GhosttyMouseFormat = 0;
+pub const GhosttyMouseFormat_GHOSTTY_MOUSE_FORMAT_UTF8: GhosttyMouseFormat = 1;
+pub const GhosttyMouseFormat_GHOSTTY_MOUSE_FORMAT_SGR: GhosttyMouseFormat = 2;
+pub const GhosttyMouseFormat_GHOSTTY_MOUSE_FORMAT_URXVT: GhosttyMouseFormat = 3;
+pub const GhosttyMouseFormat_GHOSTTY_MOUSE_FORMAT_SGR_PIXELS: GhosttyMouseFormat = 4;
+#[doc = " Mouse output format.\n\n @ingroup mouse"]
+pub type GhosttyMouseFormat = ::std::os::raw::c_uint;
+#[doc = " Mouse encoder size and geometry context.\n\n This describes the rendered terminal geometry used to convert\n surface-space positions into encoded coordinates.\n\n @ingroup mouse"]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct GhosttyMouseEncoderSize {
+ #[doc = " Size of this struct in bytes. Must be set to sizeof(GhosttyMouseEncoderSize)."]
+ pub size: usize,
+ #[doc = " Full screen width in pixels."]
+ pub screen_width: u32,
+ #[doc = " Full screen height in pixels."]
+ pub screen_height: u32,
+ #[doc = " Cell width in pixels. Must be non-zero."]
+ pub cell_width: u32,
+ #[doc = " Cell height in pixels. Must be non-zero."]
+ pub cell_height: u32,
+ #[doc = " Top padding in pixels."]
+ pub padding_top: u32,
+ #[doc = " Bottom padding in pixels."]
+ pub padding_bottom: u32,
+ #[doc = " Right padding in pixels."]
+ pub padding_right: u32,
+ #[doc = " Left padding in pixels."]
+ pub padding_left: u32,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of GhosttyMouseEncoderSize"][::std::mem::size_of::() - 40usize];
+ ["Alignment of GhosttyMouseEncoderSize"]
+ [::std::mem::align_of::() - 8usize];
+ ["Offset of field: GhosttyMouseEncoderSize::size"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, size) - 0usize];
+ ["Offset of field: GhosttyMouseEncoderSize::screen_width"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, screen_width) - 8usize];
+ ["Offset of field: GhosttyMouseEncoderSize::screen_height"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, screen_height) - 12usize];
+ ["Offset of field: GhosttyMouseEncoderSize::cell_width"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, cell_width) - 16usize];
+ ["Offset of field: GhosttyMouseEncoderSize::cell_height"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, cell_height) - 20usize];
+ ["Offset of field: GhosttyMouseEncoderSize::padding_top"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_top) - 24usize];
+ ["Offset of field: GhosttyMouseEncoderSize::padding_bottom"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_bottom) - 28usize];
+ ["Offset of field: GhosttyMouseEncoderSize::padding_right"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_right) - 32usize];
+ ["Offset of field: GhosttyMouseEncoderSize::padding_left"]
+ [::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_left) - 36usize];
+};
+#[doc = " Mouse tracking mode (value: GhosttyMouseTrackingMode)."]
+pub const GhosttyMouseEncoderOption_GHOSTTY_MOUSE_ENCODER_OPT_EVENT: GhosttyMouseEncoderOption = 0;
+#[doc = " Mouse output format (value: GhosttyMouseFormat)."]
+pub const GhosttyMouseEncoderOption_GHOSTTY_MOUSE_ENCODER_OPT_FORMAT: GhosttyMouseEncoderOption = 1;
+#[doc = " Renderer size context (value: GhosttyMouseEncoderSize)."]
+pub const GhosttyMouseEncoderOption_GHOSTTY_MOUSE_ENCODER_OPT_SIZE: GhosttyMouseEncoderOption = 2;
+#[doc = " Whether any mouse button is currently pressed (value: bool)."]
+pub const GhosttyMouseEncoderOption_GHOSTTY_MOUSE_ENCODER_OPT_ANY_BUTTON_PRESSED:
+ GhosttyMouseEncoderOption = 3;
+#[doc = " Whether to enable motion deduplication by last cell (value: bool)."]
+pub const GhosttyMouseEncoderOption_GHOSTTY_MOUSE_ENCODER_OPT_TRACK_LAST_CELL:
+ GhosttyMouseEncoderOption = 4;
+#[doc = " Mouse encoder option identifiers.\n\n These values are used with ghostty_mouse_encoder_setopt() to configure\n the behavior of the mouse encoder.\n\n @ingroup mouse"]
+pub type GhosttyMouseEncoderOption = ::std::os::raw::c_uint;
+unsafe extern "C" {
+ #[doc = " Create a new mouse encoder instance.\n\n @param allocator Pointer to allocator, or NULL to use the default allocator\n @param encoder Pointer to store the created encoder handle\n @return GHOSTTY_SUCCESS on success, or an error code on failure\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_encoder_new(
+ allocator: *const GhosttyAllocator,
+ encoder: *mut GhosttyMouseEncoder_ptr,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Free a mouse encoder instance.\n\n @param encoder The encoder handle to free (may be NULL)\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_encoder_free(encoder: GhosttyMouseEncoder_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Set an option on the mouse encoder.\n\n A null pointer value does nothing. It does not reset to defaults.\n\n @param encoder The encoder handle, must not be NULL\n @param option The option to set\n @param value Pointer to option value (type depends on option)\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_encoder_setopt(
+ encoder: GhosttyMouseEncoder_ptr,
+ option: GhosttyMouseEncoderOption,
+ value: *const ::std::os::raw::c_void,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Set encoder options from a terminal's current state.\n\n This sets tracking mode and output format from terminal state.\n It does not modify size or any-button state.\n\n @param encoder The encoder handle, must not be NULL\n @param terminal The terminal handle, must not be NULL\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_encoder_setopt_from_terminal(
+ encoder: GhosttyMouseEncoder_ptr,
+ terminal: GhosttyTerminal_ptr,
+ );
+}
+unsafe extern "C" {
+ #[doc = " Reset internal encoder state.\n\n This clears motion deduplication state (last tracked cell).\n\n @param encoder The encoder handle (may be NULL)\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_encoder_reset(encoder: GhosttyMouseEncoder_ptr);
+}
+unsafe extern "C" {
+ #[doc = " Encode a mouse event into a terminal escape sequence.\n\n Not all mouse events produce output. In such cases this returns\n GHOSTTY_SUCCESS with out_len set to 0.\n\n If the output buffer is too small, this returns GHOSTTY_OUT_OF_SPACE\n and out_len contains the required size.\n\n @param encoder The encoder handle, must not be NULL\n @param event The mouse event to encode, must not be NULL\n @param out_buf Buffer to write encoded bytes to, or NULL to query required size\n @param out_buf_size Size of out_buf in bytes\n @param out_len Pointer to store bytes written (or required bytes on failure)\n @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if buffer is too small,\n or another error code\n\n @ingroup mouse"]
+ pub fn ghostty_mouse_encoder_encode(
+ encoder: GhosttyMouseEncoder_ptr,
+ event: GhosttyMouseEvent_ptr,
+ out_buf: *mut ::std::os::raw::c_char,
+ out_buf_size: usize,
+ out_len: *mut usize,
+ ) -> GhosttyResult;
+}
+unsafe extern "C" {
+ #[doc = " Check if paste data is safe to paste into the terminal.\n\n Data is considered unsafe if it contains:\n - Newlines (`\\n`) which can inject commands\n - The bracketed paste end sequence (`\\x1b[201~`) which can be used\n to exit bracketed paste mode and inject commands\n\n This check is conservative and considers data unsafe regardless of\n current terminal state.\n\n @param data The paste data to check (must not be NULL)\n @param len The length of the data in bytes\n @return true if the data is safe to paste, false otherwise"]
+ pub fn ghostty_paste_is_safe(data: *const ::std::os::raw::c_char, len: usize) -> bool;
+}
diff --git a/src/ghostty/mod.rs b/src/ghostty/mod.rs
new file mode 100644
index 00000000..8c5e591d
--- /dev/null
+++ b/src/ghostty/mod.rs
@@ -0,0 +1,1106 @@
+#![cfg(feature = "ghostty-vt")]
+#![allow(dead_code)]
+
+#[allow(
+ dead_code,
+ non_camel_case_types,
+ non_snake_case,
+ non_upper_case_globals,
+ clippy::all,
+ rustdoc::all
+)]
+pub mod bindings;
+
+use std::ffi::c_void;
+use std::fmt;
+use std::marker::PhantomData;
+use std::mem;
+use std::os::raw::c_char;
+use std::ptr;
+use std::slice;
+
+pub use bindings as ffi;
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct Error(ffi::GhosttyResult);
+
+impl fmt::Display for Error {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "ghostty error {}", self.0)
+ }
+}
+
+impl std::error::Error for Error {}
+
+trait GhosttyResultExt {
+ fn into_result(self) -> Result<(), Error>;
+}
+
+impl GhosttyResultExt for ffi::GhosttyResult {
+ fn into_result(self) -> Result<(), Error> {
+ if self == ffi::GhosttyResult_GHOSTTY_SUCCESS {
+ Ok(())
+ } else {
+ Err(Error(self))
+ }
+ }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum Dirty {
+ Clean,
+ Partial,
+ Full,
+}
+
+impl Dirty {
+ fn from_raw(value: ffi::GhosttyRenderStateDirty) -> Self {
+ match value {
+ ffi::GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_FALSE => Self::Clean,
+ ffi::GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_PARTIAL => Self::Partial,
+ ffi::GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_FULL => Self::Full,
+ _ => Self::Full,
+ }
+ }
+
+ fn as_raw(self) -> ffi::GhosttyRenderStateDirty {
+ match self {
+ Self::Clean => ffi::GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_FALSE,
+ Self::Partial => ffi::GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_PARTIAL,
+ Self::Full => ffi::GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_FULL,
+ }
+ }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum FocusEvent {
+ Gained,
+ Lost,
+}
+
+impl FocusEvent {
+ fn as_raw(self) -> ffi::GhosttyFocusEvent {
+ match self {
+ Self::Gained => ffi::GhosttyFocusEvent_GHOSTTY_FOCUS_GAINED,
+ Self::Lost => ffi::GhosttyFocusEvent_GHOSTTY_FOCUS_LOST,
+ }
+ }
+}
+
+pub const MOD_SHIFT: u16 = ffi::GHOSTTY_MODS_SHIFT as u16;
+pub const MOD_CTRL: u16 = ffi::GHOSTTY_MODS_CTRL as u16;
+pub const MOD_ALT: u16 = ffi::GHOSTTY_MODS_ALT as u16;
+pub const MOD_SUPER: u16 = ffi::GHOSTTY_MODS_SUPER as u16;
+
+pub const KEY_ENTER: u32 = ffi::GhosttyKey_GHOSTTY_KEY_ENTER;
+pub const KEY_UP: u32 = ffi::GhosttyKey_GHOSTTY_KEY_ARROW_UP;
+pub const KEY_DOWN: u32 = ffi::GhosttyKey_GHOSTTY_KEY_ARROW_DOWN;
+pub const KEY_LEFT: u32 = ffi::GhosttyKey_GHOSTTY_KEY_ARROW_LEFT;
+pub const KEY_RIGHT: u32 = ffi::GhosttyKey_GHOSTTY_KEY_ARROW_RIGHT;
+pub const KEY_A: u32 = ffi::GhosttyKey_GHOSTTY_KEY_A;
+
+pub const MOUSE_ACTION_PRESS: ffi::GhosttyMouseAction =
+ ffi::GhosttyMouseAction_GHOSTTY_MOUSE_ACTION_PRESS;
+pub const MOUSE_ACTION_RELEASE: ffi::GhosttyMouseAction =
+ ffi::GhosttyMouseAction_GHOSTTY_MOUSE_ACTION_RELEASE;
+pub const MOUSE_ACTION_MOTION: ffi::GhosttyMouseAction =
+ ffi::GhosttyMouseAction_GHOSTTY_MOUSE_ACTION_MOTION;
+pub const MOUSE_BUTTON_LEFT: ffi::GhosttyMouseButton =
+ ffi::GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_LEFT;
+pub const MOUSE_BUTTON_RIGHT: ffi::GhosttyMouseButton =
+ ffi::GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_RIGHT;
+pub const MOUSE_BUTTON_MIDDLE: ffi::GhosttyMouseButton =
+ ffi::GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_MIDDLE;
+pub const MOUSE_BUTTON_WHEEL_UP: ffi::GhosttyMouseButton =
+ ffi::GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_FOUR;
+pub const MOUSE_BUTTON_WHEEL_DOWN: ffi::GhosttyMouseButton =
+ ffi::GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_FIVE;
+pub const MOUSE_BUTTON_WHEEL_LEFT: ffi::GhosttyMouseButton =
+ ffi::GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_SIX;
+pub const MOUSE_BUTTON_WHEEL_RIGHT: ffi::GhosttyMouseButton =
+ ffi::GhosttyMouseButton_GHOSTTY_MOUSE_BUTTON_SEVEN;
+
+pub const MODE_APPLICATION_CURSOR_KEYS: u16 = 1;
+pub const MODE_BRACKETED_PASTE: u16 = 2004;
+pub const MODE_MOUSE_UTF8: u16 = 1005;
+pub const MODE_MOUSE_SGR: u16 = 1006;
+pub const MODE_MOUSE_ALTERNATE_SCROLL: u16 = 1007;
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum ActiveScreen {
+ Primary,
+ Alternate,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct TerminalScrollbar {
+ pub total: usize,
+ pub offset: usize,
+ pub len: usize,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct CursorViewport {
+ pub x: u16,
+ pub y: u16,
+ pub wide_tail: bool,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+pub struct RgbColor {
+ pub r: u8,
+ pub g: u8,
+ pub b: u8,
+}
+
+impl From for RgbColor {
+ fn from(value: ffi::GhosttyColorRgb) -> Self {
+ Self {
+ r: value.r,
+ g: value.g,
+ b: value.b,
+ }
+ }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+pub struct CellStyle {
+ pub bold: bool,
+ pub italic: bool,
+ pub faint: bool,
+ pub blink: bool,
+ pub inverse: bool,
+ pub invisible: bool,
+ pub strikethrough: bool,
+ pub overline: bool,
+ pub underlined: bool,
+}
+
+impl From for CellStyle {
+ fn from(value: ffi::GhosttyStyle) -> Self {
+ Self {
+ bold: value.bold,
+ italic: value.italic,
+ faint: value.faint,
+ blink: value.blink,
+ inverse: value.inverse,
+ invisible: value.invisible,
+ strikethrough: value.strikethrough,
+ overline: value.overline,
+ underlined: value.underline != 0,
+ }
+ }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct RenderColors {
+ pub background: RgbColor,
+ pub foreground: RgbColor,
+}
+
+struct WritePtyCallbackState {
+ callback: Box,
+}
+
+unsafe extern "C" fn write_pty_trampoline(
+ _terminal: ffi::GhosttyTerminal_ptr,
+ userdata: *mut c_void,
+ data: *const u8,
+ len: usize,
+) {
+ if userdata.is_null() {
+ return;
+ }
+ let state = unsafe { &mut *(userdata.cast::()) };
+ let bytes = unsafe { slice::from_raw_parts(data, len) };
+ (state.callback)(bytes);
+}
+
+pub fn encode_focus(event: FocusEvent) -> Result, Error> {
+ let mut required = 0usize;
+ // SAFETY: null buffer + out len is the documented way to query required size.
+ let result =
+ unsafe { ffi::ghostty_focus_encode(event.as_raw(), ptr::null_mut(), 0, &mut required) };
+ if result != ffi::GhosttyResult_GHOSTTY_OUT_OF_SPACE {
+ result.into_result()?;
+ }
+
+ let mut buffer = vec![0u8; required];
+ // SAFETY: buffer is allocated for required size; function writes at most that many bytes.
+ unsafe {
+ ffi::ghostty_focus_encode(
+ event.as_raw(),
+ buffer.as_mut_ptr().cast(),
+ buffer.len(),
+ &mut required,
+ )
+ .into_result()?;
+ }
+ buffer.truncate(required);
+ Ok(buffer)
+}
+
+pub struct Terminal {
+ raw: ffi::GhosttyTerminal_ptr,
+ write_pty_callback: Option>,
+}
+
+impl Terminal {
+ pub fn new(cols: u16, rows: u16, max_scrollback: usize) -> Result {
+ let mut raw = ptr::null_mut();
+ let options = ffi::GhosttyTerminalOptions {
+ cols,
+ rows,
+ max_scrollback,
+ };
+ // SAFETY: valid out pointer and options, null allocator means default allocator.
+ unsafe {
+ ffi::ghostty_terminal_new(ptr::null(), &mut raw, options).into_result()?;
+ }
+ Ok(Self {
+ raw,
+ write_pty_callback: None,
+ })
+ }
+
+ pub fn write(&mut self, bytes: &[u8]) {
+ // SAFETY: self.raw is a live terminal handle for self's lifetime.
+ unsafe {
+ ffi::ghostty_terminal_vt_write(self.raw, bytes.as_ptr(), bytes.len());
+ }
+ }
+
+ pub fn resize(&mut self, cols: u16, rows: u16) -> Result<(), Error> {
+ // SAFETY: self.raw is valid and sizes are plain values.
+ unsafe { ffi::ghostty_terminal_resize(self.raw, cols, rows, 0, 0).into_result() }
+ }
+
+ pub fn set_write_pty_callback(&mut self, callback: F) -> Result<(), Error>
+ where
+ F: FnMut(&[u8]) + Send + 'static,
+ {
+ let mut state = Box::new(WritePtyCallbackState {
+ callback: Box::new(callback),
+ });
+ let userdata = (&mut *state as *mut WritePtyCallbackState).cast::();
+ unsafe {
+ ffi::ghostty_terminal_set(
+ self.raw,
+ ffi::GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_USERDATA,
+ userdata.cast(),
+ )
+ .into_result()?;
+ ffi::ghostty_terminal_set(
+ self.raw,
+ ffi::GhosttyTerminalOption_GHOSTTY_TERMINAL_OPT_WRITE_PTY,
+ (write_pty_trampoline as *const ()).cast(),
+ )
+ .into_result()?;
+ }
+ self.write_pty_callback = Some(state);
+ Ok(())
+ }
+
+ pub fn mode_get(&self, mode: u16) -> Result {
+ let mut out = false;
+ unsafe { ffi::ghostty_terminal_mode_get(self.raw, mode, &mut out).into_result()? };
+ Ok(out)
+ }
+
+ pub fn mode_set(&mut self, mode: u16, value: bool) -> Result<(), Error> {
+ unsafe { ffi::ghostty_terminal_mode_set(self.raw, mode, value).into_result() }
+ }
+
+ pub fn kitty_keyboard_flags(&self) -> Result {
+ let mut out = 0u8;
+ unsafe {
+ ffi::ghostty_terminal_get(
+ self.raw,
+ ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_KITTY_KEYBOARD_FLAGS,
+ (&mut out as *mut u8).cast(),
+ )
+ .into_result()?;
+ }
+ Ok(out)
+ }
+
+ pub fn mouse_tracking_enabled(&self) -> Result {
+ let mut out = false;
+ unsafe {
+ ffi::ghostty_terminal_get(
+ self.raw,
+ ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_MOUSE_TRACKING,
+ (&mut out as *mut bool).cast(),
+ )
+ .into_result()?;
+ }
+ Ok(out)
+ }
+
+ pub fn active_screen(&self) -> Result {
+ let mut out = ffi::GhosttyTerminalScreen_GHOSTTY_TERMINAL_SCREEN_PRIMARY;
+ unsafe {
+ ffi::ghostty_terminal_get(
+ self.raw,
+ ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_ACTIVE_SCREEN,
+ (&mut out as *mut ffi::GhosttyTerminalScreen).cast(),
+ )
+ .into_result()?;
+ }
+ Ok(match out {
+ ffi::GhosttyTerminalScreen_GHOSTTY_TERMINAL_SCREEN_PRIMARY => ActiveScreen::Primary,
+ ffi::GhosttyTerminalScreen_GHOSTTY_TERMINAL_SCREEN_ALTERNATE => {
+ ActiveScreen::Alternate
+ }
+ _ => ActiveScreen::Primary,
+ })
+ }
+
+ pub fn total_rows(&self) -> Result {
+ self.get_usize(ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_TOTAL_ROWS)
+ }
+
+ pub fn scrollback_rows(&self) -> Result {
+ self.get_usize(ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_SCROLLBACK_ROWS)
+ }
+
+ pub fn scrollbar(&self) -> Result {
+ let mut out = ffi::GhosttyTerminalScrollbar::default();
+ unsafe {
+ ffi::ghostty_terminal_get(
+ self.raw,
+ ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_SCROLLBAR,
+ (&mut out as *mut ffi::GhosttyTerminalScrollbar).cast(),
+ )
+ .into_result()?;
+ }
+ Ok(TerminalScrollbar {
+ total: out.total as usize,
+ offset: out.offset as usize,
+ len: out.len as usize,
+ })
+ }
+
+ pub fn screen_graphemes(&self, x: u16, y: u32) -> Result, Error> {
+ let point = ffi::GhosttyPoint {
+ tag: ffi::GhosttyPointTag_GHOSTTY_POINT_TAG_SCREEN,
+ value: ffi::GhosttyPointValue {
+ coordinate: ffi::GhosttyPointCoordinate { x, y },
+ },
+ };
+ let mut grid_ref = ffi::GhosttyGridRef {
+ size: mem::size_of::(),
+ ..Default::default()
+ };
+ unsafe {
+ ffi::ghostty_terminal_grid_ref(self.raw, point, &mut grid_ref).into_result()?;
+ }
+ let mut required = 0usize;
+ let result = unsafe {
+ ffi::ghostty_grid_ref_graphemes(&grid_ref, ptr::null_mut(), 0, &mut required)
+ };
+ if result != ffi::GhosttyResult_GHOSTTY_OUT_OF_SPACE {
+ result.into_result()?;
+ }
+ let mut buffer = vec![0u32; required];
+ if required == 0 {
+ return Ok(buffer);
+ }
+ unsafe {
+ ffi::ghostty_grid_ref_graphemes(&grid_ref, buffer.as_mut_ptr(), buffer.len(), &mut required)
+ .into_result()?;
+ }
+ buffer.truncate(required);
+ Ok(buffer)
+ }
+
+ pub fn scroll_viewport_bottom(&mut self) {
+ let viewport = ffi::GhosttyTerminalScrollViewport {
+ tag: ffi::GhosttyTerminalScrollViewportTag_GHOSTTY_SCROLL_VIEWPORT_BOTTOM,
+ value: ffi::GhosttyTerminalScrollViewportValue::default(),
+ };
+ // SAFETY: self.raw is valid and viewport value matches the tag.
+ unsafe {
+ ffi::ghostty_terminal_scroll_viewport(self.raw, viewport);
+ }
+ }
+
+ pub fn scroll_viewport_delta(&mut self, delta: isize) {
+ let viewport = ffi::GhosttyTerminalScrollViewport {
+ tag: ffi::GhosttyTerminalScrollViewportTag_GHOSTTY_SCROLL_VIEWPORT_DELTA,
+ value: ffi::GhosttyTerminalScrollViewportValue { delta },
+ };
+ // SAFETY: self.raw is valid and viewport value matches the tag.
+ unsafe {
+ ffi::ghostty_terminal_scroll_viewport(self.raw, viewport);
+ }
+ }
+
+ pub fn cols(&self) -> Result {
+ self.get_u16(ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_COLS)
+ }
+
+ pub fn rows(&self) -> Result {
+ self.get_u16(ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_ROWS)
+ }
+
+ fn get_u16(&self, data: ffi::GhosttyTerminalData) -> Result {
+ let mut out = 0u16;
+ // SAFETY: out points to a u16 matching the requested terminal data type.
+ unsafe {
+ ffi::ghostty_terminal_get(self.raw, data, (&mut out as *mut u16).cast())
+ .into_result()?;
+ }
+ Ok(out)
+ }
+
+ fn get_usize(&self, data: ffi::GhosttyTerminalData) -> Result {
+ let mut out = 0usize;
+ unsafe {
+ ffi::ghostty_terminal_get(self.raw, data, (&mut out as *mut usize).cast())
+ .into_result()?;
+ }
+ Ok(out)
+ }
+
+ fn raw(&self) -> ffi::GhosttyTerminal_ptr {
+ self.raw
+ }
+}
+
+// SAFETY: these opaque handles are only used behind external synchronization in pane runtime.
+unsafe impl Send for Terminal {}
+
+impl Drop for Terminal {
+ fn drop(&mut self) {
+ // SAFETY: freeing a null or live handle is allowed by the C API.
+ unsafe {
+ ffi::ghostty_terminal_free(self.raw);
+ }
+ }
+}
+
+pub struct RenderState {
+ raw: ffi::GhosttyRenderState_ptr,
+}
+
+impl RenderState {
+ pub fn new() -> Result {
+ let mut raw = ptr::null_mut();
+ // SAFETY: valid out pointer and null allocator use default allocator.
+ unsafe {
+ ffi::ghostty_render_state_new(ptr::null(), &mut raw).into_result()?;
+ }
+ Ok(Self { raw })
+ }
+
+ pub fn update(&mut self, terminal: &Terminal) -> Result<(), Error> {
+ // SAFETY: both handles are valid for the duration of the call.
+ unsafe { ffi::ghostty_render_state_update(self.raw, terminal.raw()).into_result() }
+ }
+
+ pub fn cols(&self) -> Result {
+ self.get_u16(ffi::GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_COLS)
+ }
+
+ pub fn rows(&self) -> Result {
+ self.get_u16(ffi::GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_ROWS)
+ }
+
+ pub fn dirty(&self) -> Result {
+ let mut out = ffi::GhosttyRenderStateDirty_GHOSTTY_RENDER_STATE_DIRTY_FALSE;
+ // SAFETY: out points to the matching enum storage for the requested data kind.
+ unsafe {
+ ffi::ghostty_render_state_get(
+ self.raw,
+ ffi::GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_DIRTY,
+ (&mut out as *mut ffi::GhosttyRenderStateDirty).cast(),
+ )
+ .into_result()?;
+ }
+ Ok(Dirty::from_raw(out))
+ }
+
+ pub fn cursor_visible(&self) -> Result {
+ self.get_bool(ffi::GhosttyRenderStateData_GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE)
+ }
+
+ pub fn cursor_viewport(&self) -> Result
+
+## About
+
+Ghostty is a terminal emulator that differentiates itself by being
+fast, feature-rich, and native. While there are many excellent terminal
+emulators available, they all force you to choose between speed,
+features, or native UIs. Ghostty provides all three.
+
+**`libghostty`** is a cross-platform, zero-dependency C and Zig library
+for building terminal emulators or utilizing terminal functionality
+(such as style parsing). Anyone can use `libghostty` to build a terminal
+emulator or embed a terminal into their own applications. See
+[Ghostling](https://github.com/ghostty-org/ghostling) for a minimal complete project
+example or the [`examples` directory](https://github.com/ghostty-org/ghostty/tree/main/example)
+for smaller examples of using `libghostty` in C and Zig.
+
+For more details, see [About Ghostty](https://ghostty.org/docs/about).
+
+## Download
+
+See the [download page](https://ghostty.org/download) on the Ghostty website.
+
+## Documentation
+
+See the [documentation](https://ghostty.org/docs) on the Ghostty website.
+
+## Contributing and Developing
+
+If you have any ideas, issues, etc. regarding Ghostty, or would like to
+contribute to Ghostty through pull requests, please check out our
+["Contributing to Ghostty"](CONTRIBUTING.md) document. Those who would like
+to get involved with Ghostty's development as well should also read the
+["Developing Ghostty"](HACKING.md) document for more technical details.
+
+## Roadmap and Status
+
+Ghostty is stable and in use by millions of people and machines daily.
+
+The high-level ambitious plan for the project, in order:
+
+| # | Step | Status |
+| :-: | ------------------------------------------------------- | :----: |
+| 1 | Standards-compliant terminal emulation | ✅ |
+| 2 | Competitive performance | ✅ |
+| 3 | Rich windowing features -- multi-window, tabbing, panes | ✅ |
+| 4 | Native Platform Experiences | ✅ |
+| 5 | Cross-platform `libghostty` for Embeddable Terminals | ✅ |
+| 6 | Ghostty-only Terminal Control Sequences | ❌ |
+
+Additional details for each step in the big roadmap below:
+
+#### Standards-Compliant Terminal Emulation
+
+Ghostty implements all of the regularly used control sequences and
+can run every mainstream terminal program without issue. For legacy sequences,
+we've done a [comprehensive xterm audit](https://github.com/ghostty-org/ghostty/issues/632)
+comparing Ghostty's behavior to xterm and building a set of conformance
+test cases.
+
+In addition to legacy sequences (what you'd call real "terminal" emulation),
+Ghostty also supports more modern sequences than almost any other terminal
+emulator. These features include things like the Kitty graphics protocol,
+Kitty image protocol, clipboard sequences, synchronized rendering,
+light/dark mode notifications, and many, many more.
+
+We believe Ghostty is one of the most compliant and feature-rich terminal
+emulators available.
+
+Terminal behavior is partially a de jure standard
+(i.e. [ECMA-48](https://ecma-international.org/publications-and-standards/standards/ecma-48/))
+but mostly a de facto standard as defined by popular terminal emulators
+worldwide. Ghostty takes the approach that our behavior is defined by
+(1) standards, if available, (2) xterm, if the feature exists, (3)
+other popular terminals, in that order. This defines what the Ghostty project
+views as a "standard."
+
+#### Competitive Performance
+
+Ghostty is generally in the same performance category as the other highest
+performing terminal emulators.
+
+"The same performance category" means that Ghostty is much faster than
+traditional or "slow" terminals and is within an unnoticeable margin of the
+well-known "fast" terminals. For example, Ghostty and Alacritty are usually within
+a few percentage points of each other on various benchmarks, but are both
+something like 100x faster than Terminal.app and iTerm. However, Ghostty
+is much more feature rich than Alacritty and has a much more native app
+experience.
+
+This performance is achieved through high-level architectural decisions and
+low-level optimizations. At a high-level, Ghostty has a multi-threaded
+architecture with a dedicated read thread, write thread, and render thread
+per terminal. Our renderer uses OpenGL on Linux and Metal on macOS.
+Our read thread has a heavily optimized terminal parser that leverages
+CPU-specific SIMD instructions. Etc.
+
+#### Rich Windowing Features
+
+The Mac and Linux (build with GTK) apps support multi-window, tabbing, and
+splits with additional features such as tab renaming, coloring, etc. These
+features allow for a higher degree of organization and customization than
+single-window terminals.
+
+#### Native Platform Experiences
+
+Ghostty is a cross-platform terminal emulator but we don't aim for a
+least-common-denominator experience. There is a large, shared core written
+in Zig but we do a lot of platform-native things:
+
+- The macOS app is a true SwiftUI-based application with all the things you
+ would expect such as real windowing, menu bars, a settings GUI, etc.
+- macOS uses a true Metal renderer with CoreText for font discovery.
+- macOS supports AppleScript, Apple Shortcuts (AppIntents), etc.
+- The Linux app is built with GTK.
+- The Linux app integrates deeply with systemd if available for things
+ like always-on, new windows in a single instance, cgroup isolation, etc.
+
+Our goal with Ghostty is for users of whatever platform they run Ghostty
+on to think that Ghostty was built for their platform first and maybe even
+exclusively. We want Ghostty to feel like a native app on every platform,
+for the best definition of "native" on each platform.
+
+#### Cross-platform `libghostty` for Embeddable Terminals
+
+In addition to being a standalone terminal emulator, Ghostty is a
+C-compatible library for embedding a fast, feature-rich terminal emulator
+in any 3rd party project. This library is called `libghostty`.
+
+Due to the scope of this project, we're breaking libghostty down into
+separate actually libraries, starting with `libghostty-vt`. The goal of
+this project is to focus on parsing terminal sequences and maintaining
+terminal state. This is covered in more detail in this
+[blog post](https://mitchellh.com/writing/libghostty-is-coming).
+
+`libghostty-vt` is already available and usable today for Zig and C and
+is compatible for macOS, Linux, Windows, and WebAssembly. The functionality
+is extremely stable (since its been proven in Ghostty GUI for a long time),
+but the API signatures are still in flux.
+
+`libghostty` is already heavily in use. See [`examples`](https://github.com/ghostty-org/ghostty/tree/main/example)
+for small examples of using `libghostty` in C and Zig or the
+[Ghostling](https://github.com/ghostty-org/ghostling) project for a
+complete example. See [awesome-libghostty](https://github.com/Uzaaft/awesome-libghostty)
+for a list of projects and resources related to `libghostty`.
+
+We haven't tagged libghostty with a version yet and we're still working
+on a better docs experience, but our [Doxygen website](https://libghostty.tip.ghostty.org/)
+is a good resource for the C API.
+
+#### Ghostty-only Terminal Control Sequences
+
+We want and believe that terminal applications can and should be able
+to do so much more. We've worked hard to support a wide variety of modern
+sequences created by other terminal emulators towards this end, but we also
+want to fill the gaps by creating our own sequences.
+
+We've been hesitant to do this up until now because we don't want to create
+more fragmentation in the terminal ecosystem by creating sequences that only
+work in Ghostty. But, we do want to balance that with the desire to push the
+terminal forward with stagnant standards and the slow pace of change in the
+terminal ecosystem.
+
+We haven't done any of this yet.
+
+## Crash Reports
+
+Ghostty has a built-in crash reporter that will generate and save crash
+reports to disk. The crash reports are saved to the `$XDG_STATE_HOME/ghostty/crash`
+directory. If `$XDG_STATE_HOME` is not set, the default is `~/.local/state`.
+**Crash reports are _not_ automatically sent anywhere off your machine.**
+
+Crash reports are only generated the next time Ghostty is started after a
+crash. If Ghostty crashes and you want to generate a crash report, you must
+restart Ghostty at least once. You should see a message in the log that a
+crash report was generated.
+
+> [!NOTE]
+>
+> Use the `ghostty +crash-report` CLI command to get a list of available crash
+> reports. A future version of Ghostty will make the contents of the crash
+> reports more easily viewable through the CLI and GUI.
+
+Crash reports end in the `.ghosttycrash` extension. The crash reports are in
+[Sentry envelope format](https://develop.sentry.dev/sdk/envelopes/). You can
+upload these to your own Sentry account to view their contents, but the format
+is also publicly documented so any other available tools can also be used.
+The `ghostty +crash-report` CLI command can be used to list any crash reports.
+A future version of Ghostty will show you the contents of the crash report
+directly in the terminal.
+
+To send the crash report to the Ghostty project, you can use the following
+CLI command using the [Sentry CLI](https://docs.sentry.io/cli/installation/):
+
+```shell-session
+SENTRY_DSN=https://e914ee84fd895c4fe324afa3e53dac76@o4507352570920960.ingest.us.sentry.io/4507850923638784 sentry-cli send-envelope --raw
+```
+
+> [!WARNING]
+>
+> The crash report can contain sensitive information. The report doesn't
+> purposely contain sensitive information, but it does contain the full
+> stack memory of each thread at the time of the crash. This information
+> is used to rebuild the stack trace but can also contain sensitive data
+> depending on when the crash occurred.
diff --git a/vendor/libghostty-vt/VERSION b/vendor/libghostty-vt/VERSION
new file mode 100644
index 00000000..c2828575
--- /dev/null
+++ b/vendor/libghostty-vt/VERSION
@@ -0,0 +1 @@
+1.3.2-main+0a492fd
\ No newline at end of file
diff --git a/vendor/libghostty-vt/build.zig b/vendor/libghostty-vt/build.zig
new file mode 100644
index 00000000..45ad3ba1
--- /dev/null
+++ b/vendor/libghostty-vt/build.zig
@@ -0,0 +1,371 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const builtin = @import("builtin");
+const buildpkg = @import("src/build/main.zig");
+
+/// App version from build.zig.zon.
+const app_zon_version = @import("build.zig.zon").version;
+
+/// Libghostty version. We use a separate version from the app.
+const lib_version = "0.1.0";
+
+/// Minimum required zig version.
+const minimum_zig_version = @import("build.zig.zon").minimum_zig_version;
+
+comptime {
+ buildpkg.requireZig(minimum_zig_version);
+}
+
+pub fn build(b: *std.Build) !void {
+ // This defines all the available build options (e.g. `-D`). If you
+ // want to know what options are available, you can run `--help` or
+ // you can read `src/build/Config.zig`.
+
+ // If we have a VERSION file (present in source tarballs) then we
+ // use that as the version source of truth. Otherwise we fall back
+ // to what is in the build.zig.zon.
+ const file_version: ?[]const u8 = if (b.build_root.handle.readFileAlloc(
+ b.allocator,
+ "VERSION",
+ 128,
+ )) |content| std.mem.trim(
+ u8,
+ content,
+ &std.ascii.whitespace,
+ ) else |_| null;
+
+ const config = try buildpkg.Config.init(
+ b,
+ file_version orelse app_zon_version,
+ );
+ const test_filters = b.option(
+ [][]const u8,
+ "test-filter",
+ "Filter for test. Only applies to Zig tests.",
+ ) orelse &[0][]const u8{};
+
+ // Ghostty dependencies used by many artifacts.
+ const deps = try buildpkg.SharedDeps.init(b, &config);
+
+ // The modules exported for Zig consumers of libghostty. If you're
+ // writing a Zig program that uses libghostty, read this file.
+ const mod = try buildpkg.GhosttyZig.init(
+ b,
+ &config,
+ &deps,
+ );
+
+ // All our steps which we'll hook up later. The steps are shown
+ // up here just so that they are more self-documenting.
+ const run_step = b.step("run", "Run the app");
+ const run_valgrind_step = b.step(
+ "run-valgrind",
+ "Run the app under valgrind",
+ );
+ const test_step = b.step("test", "Run tests");
+ const test_lib_vt_step = b.step(
+ "test-lib-vt",
+ "Run libghostty-vt tests",
+ );
+ const test_valgrind_step = b.step(
+ "test-valgrind",
+ "Run tests under valgrind",
+ );
+ const translations_step = b.step(
+ "update-translations",
+ "Update translation files",
+ );
+
+ // Ghostty resources like terminfo, shell integration, themes, etc.
+ const resources = try buildpkg.GhosttyResources.init(b, &config, &deps);
+ const i18n = if (config.i18n) try buildpkg.GhosttyI18n.init(b, &config) else null;
+
+ // Ghostty executable, the actual runnable Ghostty program.
+ const exe = try buildpkg.GhosttyExe.init(b, &config, &deps);
+
+ // Ghostty docs
+ const docs = try buildpkg.GhosttyDocs.init(b, &deps);
+ if (config.emit_docs) {
+ docs.install();
+ } else if (config.target.result.os.tag.isDarwin()) {
+ // If we aren't emitting docs we need to emit a placeholder so
+ // our macOS xcodeproject builds since it expects the `share/man`
+ // directory to exist to copy into the app bundle.
+ docs.installDummy(b.getInstallStep());
+ }
+
+ // Ghostty webdata
+ const webdata = try buildpkg.GhosttyWebdata.init(b, &deps);
+ if (config.emit_webdata) webdata.install();
+
+ // Ghostty bench tools
+ const bench = try buildpkg.GhosttyBench.init(b, &deps);
+ if (config.emit_bench) bench.install();
+
+ // Ghostty dist tarball
+ const dist = try buildpkg.GhosttyDist.init(b, &config);
+ {
+ const step = b.step("dist", "Build the dist tarball");
+ step.dependOn(dist.install_step);
+ const check_step = b.step("distcheck", "Install and validate the dist tarball");
+ check_step.dependOn(dist.check_step);
+ check_step.dependOn(dist.install_step);
+ }
+
+ // libghostty-vt
+ const libghostty_vt_shared = shared: {
+ if (config.target.result.cpu.arch.isWasm()) {
+ break :shared try buildpkg.GhosttyLibVt.initWasm(
+ b,
+ &mod,
+ );
+ }
+
+ break :shared try buildpkg.GhosttyLibVt.initShared(
+ b,
+ &mod,
+ );
+ };
+ libghostty_vt_shared.install(b.getInstallStep());
+
+ // libghostty-vt static lib
+ const libghostty_vt_static = try buildpkg.GhosttyLibVt.initStatic(
+ b,
+ &mod,
+ );
+ if (config.is_dep) {
+ // If we're a dependency, we need to install everything as-is
+ // so that dep.artifact("ghostty-vt-static") works.
+ libghostty_vt_static.install(b.getInstallStep());
+ } else {
+ // If we're not a dependency, we rename the static lib to
+ // be idiomatic. On Windows, we use a distinct name to avoid
+ // colliding with the DLL import library (ghostty-vt.lib).
+ const static_lib_name = if (config.target.result.os.tag == .windows)
+ "ghostty-vt-static.lib"
+ else
+ "libghostty-vt.a";
+ b.getInstallStep().dependOn(&b.addInstallLibFile(
+ libghostty_vt_static.output,
+ static_lib_name,
+ ).step);
+ }
+
+ // Helpgen
+ if (config.emit_helpgen) deps.help_strings.install();
+
+ // Runtime "none" is libghostty, anything else is an executable.
+ if (config.app_runtime != .none) {
+ if (config.emit_exe) {
+ exe.install();
+ resources.install();
+ if (i18n) |v| v.install();
+ }
+ } else if (!config.emit_lib_vt) {
+ // The macOS Ghostty Library
+ //
+ // This is NOT libghostty (even though its named that for historical
+ // reasons). It is just the glue between Ghostty GUI on macOS and
+ // the full Ghostty GUI core.
+ const lib_shared = try buildpkg.GhosttyLib.initShared(b, &deps);
+ const lib_static = try buildpkg.GhosttyLib.initStatic(b, &deps);
+
+ // We shouldn't have this guard but we don't currently
+ // build on macOS this way ironically so we need to fix that.
+ if (!config.target.result.os.tag.isDarwin()) {
+ lib_shared.installHeader(); // Only need one header
+ if (config.target.result.os.tag == .windows) {
+ lib_shared.install("ghostty.dll");
+ lib_static.install("ghostty-static.lib");
+ } else {
+ lib_shared.install("libghostty.so");
+ lib_static.install("libghostty.a");
+ }
+ }
+ }
+
+ // macOS only artifacts. These will error if they're initialized for
+ // other targets.
+ if (config.target.result.os.tag.isDarwin() and
+ (config.emit_xcframework or config.emit_macos_app))
+ {
+ // Ghostty xcframework
+ const xcframework = try buildpkg.GhosttyXCFramework.init(
+ b,
+ &deps,
+ config.xcframework_target,
+ );
+ if (config.emit_xcframework) {
+ xcframework.install();
+
+ // The xcframework build always installs resources because our
+ // macOS xcode project contains references to them.
+ resources.install();
+ if (i18n) |v| v.install();
+ }
+
+ // Ghostty macOS app
+ const macos_app = try buildpkg.GhosttyXcodebuild.init(
+ b,
+ &config,
+ .{
+ .xcframework = &xcframework,
+ .docs = &docs,
+ .i18n = if (i18n) |v| &v else null,
+ .resources = &resources,
+ },
+ );
+ if (config.emit_macos_app) {
+ macos_app.install();
+ }
+ }
+
+ // Run step
+ run: {
+ if (config.app_runtime != .none) {
+ const run_cmd = b.addRunArtifact(exe.exe);
+ if (b.args) |args| run_cmd.addArgs(args);
+
+ // Set the proper resources dir so things like shell integration
+ // work correctly. If we're running `zig build run` in Ghostty,
+ // this also ensures it overwrites the release one with our debug
+ // build.
+ run_cmd.setEnvironmentVariable(
+ "GHOSTTY_RESOURCES_DIR",
+ b.getInstallPath(.prefix, "share/ghostty"),
+ );
+
+ run_step.dependOn(&run_cmd.step);
+ break :run;
+ }
+
+ assert(config.app_runtime == .none);
+
+ // On macOS we can run the macOS app. For "run" we always force
+ // a native-only build so that we can run as quickly as possible.
+ if (config.target.result.os.tag.isDarwin() and
+ (config.emit_xcframework or config.emit_macos_app))
+ {
+ const xcframework_native = try buildpkg.GhosttyXCFramework.init(
+ b,
+ &deps,
+ .native,
+ );
+ const macos_app_native_only = try buildpkg.GhosttyXcodebuild.init(
+ b,
+ &config,
+ .{
+ .xcframework = &xcframework_native,
+ .docs = &docs,
+ .i18n = if (i18n) |v| &v else null,
+ .resources = &resources,
+ },
+ );
+
+ // Run uses the native macOS app
+ run_step.dependOn(&macos_app_native_only.open.step);
+
+ // If we have no test filters, install the tests too
+ if (test_filters.len == 0) {
+ macos_app_native_only.addTestStepDependencies(test_step);
+ }
+ }
+ }
+
+ // Valgrind
+ if (config.app_runtime != .none) {
+ // We need to rebuild Ghostty with a baseline CPU target.
+ const valgrind_exe = exe: {
+ var valgrind_config = config;
+ valgrind_config.target = valgrind_config.baselineTarget();
+ break :exe try buildpkg.GhosttyExe.init(
+ b,
+ &valgrind_config,
+ &deps,
+ );
+ };
+
+ const run_cmd = b.addSystemCommand(&.{
+ "valgrind",
+ "--leak-check=full",
+ "--num-callers=50",
+ b.fmt("--suppressions={s}", .{b.pathFromRoot("valgrind.supp")}),
+ "--gen-suppressions=all",
+ });
+ run_cmd.addArtifactArg(valgrind_exe.exe);
+ if (b.args) |args| run_cmd.addArgs(args);
+ run_valgrind_step.dependOn(&run_cmd.step);
+ }
+
+ // Zig module tests
+ {
+ const mod_vt_test = b.addTest(.{
+ .root_module = mod.vt,
+ .filters = test_filters,
+ });
+ const mod_vt_test_run = b.addRunArtifact(mod_vt_test);
+ test_lib_vt_step.dependOn(&mod_vt_test_run.step);
+
+ const mod_vt_c_test = b.addTest(.{
+ .root_module = mod.vt_c,
+ .filters = test_filters,
+ });
+ const mod_vt_c_test_run = b.addRunArtifact(mod_vt_c_test);
+ test_lib_vt_step.dependOn(&mod_vt_c_test_run.step);
+ }
+
+ // Tests
+ {
+ // Full unit tests
+ const test_exe = b.addTest(.{
+ .name = "ghostty-test",
+ .filters = test_filters,
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/main.zig"),
+ .target = config.baselineTarget(),
+ .optimize = .Debug,
+ .strip = false,
+ .omit_frame_pointer = false,
+ .unwind_tables = .sync,
+ }),
+ // Crash on x86_64 without this
+ .use_llvm = true,
+ });
+ if (config.emit_test_exe) b.installArtifact(test_exe);
+ _ = try deps.add(test_exe);
+
+ // Verify our internal libghostty header.
+ const ghostty_h = b.addTranslateC(.{
+ .root_source_file = b.path("include/ghostty.h"),
+ .target = config.baselineTarget(),
+ .optimize = .Debug,
+ });
+ test_exe.root_module.addImport("ghostty.h", ghostty_h.createModule());
+
+ // Normal test running
+ const test_run = b.addRunArtifact(test_exe);
+ test_step.dependOn(&test_run.step);
+
+ // Normal tests always test our libghostty modules
+ //test_step.dependOn(test_lib_vt_step);
+
+ // Valgrind test running
+ const valgrind_run = b.addSystemCommand(&.{
+ "valgrind",
+ "--leak-check=full",
+ "--num-callers=50",
+ b.fmt("--suppressions={s}", .{b.pathFromRoot("valgrind.supp")}),
+ "--gen-suppressions=all",
+ });
+ valgrind_run.addArtifactArg(test_exe);
+ test_valgrind_step.dependOn(&valgrind_run.step);
+ }
+
+ // update-translations does what it sounds like and updates the "pot"
+ // files. These should be committed to the repo.
+ if (i18n) |v| {
+ translations_step.dependOn(v.update_step);
+ } else {
+ try translations_step.addError("cannot update translations when i18n is disabled", .{});
+ }
+}
diff --git a/vendor/libghostty-vt/build.zig.zon b/vendor/libghostty-vt/build.zig.zon
new file mode 100644
index 00000000..f4ecce71
--- /dev/null
+++ b/vendor/libghostty-vt/build.zig.zon
@@ -0,0 +1,125 @@
+.{
+ .name = .ghostty,
+ .version = "1.3.2-dev",
+ .paths = .{""},
+ .fingerprint = 0x64407a2a0b4147e5,
+ .minimum_zig_version = "0.15.2",
+ .dependencies = .{
+ // Zig libs
+
+ .libxev = .{
+ // mitchellh/libxev
+ .url = "https://deps.files.ghostty.org/libxev-34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz",
+ .hash = "libxev-0.0.0-86vtc4IcEwCqEYxEYoN_3KXmc6A9VLcm22aVImfvecYs",
+ .lazy = true,
+ },
+ .vaxis = .{
+ // rockorager/libvaxis
+ .url = "https://deps.files.ghostty.org/vaxis-7dbb9fd3122e4ffad262dd7c151d80d863b68558.tar.gz",
+ .hash = "vaxis-0.5.1-BWNV_LosCQAGmCCNOLljCIw6j6-yt53tji6n6rwJ2BhS",
+ .lazy = true,
+ },
+ .z2d = .{
+ // vancluever/z2d
+ .url = "https://deps.files.ghostty.org/z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ.tar.gz",
+ .hash = "z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ",
+ .lazy = true,
+ },
+ .zig_objc = .{
+ // mitchellh/zig-objc
+ .url = "https://deps.files.ghostty.org/zig_objc-f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz",
+ .hash = "zig_objc-0.0.0-Ir_Sp5gTAQCvxxR7oVIrPXxXwsfKgVP7_wqoOQrZjFeK",
+ .lazy = true,
+ },
+ .zig_js = .{
+ // mitchellh/zig-js
+ .url = "https://deps.files.ghostty.org/zig_js-04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz",
+ .hash = "zig_js-0.0.0-rjCAV-6GAADxFug7rDmPH-uM_XcnJ5NmuAMJCAscMjhi",
+ .lazy = true,
+ },
+ .uucode = .{
+ // jacobsandlund/uucode
+ .url = "https://deps.files.ghostty.org/uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6o-Exj6m9.tar.gz",
+ .hash = "uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6o-Exj6m9",
+ },
+ .zig_wayland = .{
+ // codeberg ifreund/zig-wayland
+ .url = "https://deps.files.ghostty.org/zig_wayland-1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz",
+ .hash = "wayland-0.5.0-dev-lQa1khrMAQDJDwYFKpdH3HizherB7sHo5dKMECfvxQHe",
+ .lazy = true,
+ },
+ .zf = .{
+ // natecraddock/zf
+ .url = "https://deps.files.ghostty.org/zf-3c52637b7e937c5ae61fd679717da3e276765b23.tar.gz",
+ .hash = "zf-0.10.3-OIRy8RuJAACKA3Lohoumrt85nRbHwbpMcUaLES8vxDnh",
+ .lazy = true,
+ },
+ .gobject = .{
+ // https://github.com/ghostty-org/zig-gobject based on zig_gobject
+ // Temporary until we generate them at build time automatically.
+ .url = "https://deps.files.ghostty.org/gobject-2025-11-08-23-1.tar.zst",
+ .hash = "gobject-0.3.0-Skun7ANLnwDvEfIpVmohcppXgOvg_I6YOJFmPIsKfXk-",
+ .lazy = true,
+ },
+
+ // C libs
+ .dcimgui = .{ .path = "./pkg/dcimgui", .lazy = true },
+ .fontconfig = .{ .path = "./pkg/fontconfig", .lazy = true },
+ .freetype = .{ .path = "./pkg/freetype", .lazy = true },
+ .gtk4_layer_shell = .{ .path = "./pkg/gtk4-layer-shell", .lazy = true },
+ .harfbuzz = .{ .path = "./pkg/harfbuzz", .lazy = true },
+ .highway = .{ .path = "./pkg/highway", .lazy = true },
+ .libintl = .{ .path = "./pkg/libintl", .lazy = true },
+ .libpng = .{ .path = "./pkg/libpng", .lazy = true },
+ .macos = .{ .path = "./pkg/macos", .lazy = true },
+ .oniguruma = .{ .path = "./pkg/oniguruma", .lazy = true },
+ .opengl = .{ .path = "./pkg/opengl", .lazy = true },
+ .sentry = .{ .path = "./pkg/sentry", .lazy = true },
+ .simdutf = .{ .path = "./pkg/simdutf", .lazy = true },
+ .utfcpp = .{ .path = "./pkg/utfcpp", .lazy = true },
+ .wuffs = .{ .path = "./pkg/wuffs", .lazy = true },
+ .zlib = .{ .path = "./pkg/zlib", .lazy = true },
+
+ // Shader translation
+ .glslang = .{ .path = "./pkg/glslang", .lazy = true },
+ .spirv_cross = .{ .path = "./pkg/spirv-cross", .lazy = true },
+
+ // Wayland
+ .wayland = .{
+ .url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz",
+ .hash = "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t",
+ .lazy = true,
+ },
+ .wayland_protocols = .{
+ .url = "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.47/wayland-protocols-1.47.tar.gz",
+ .hash = "N-V-__8AAFdWDwA0ktbNUi9pFBHCRN4weXIgIfCrVjfGxqgA",
+ .lazy = true,
+ },
+ .plasma_wayland_protocols = .{
+ .url = "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz",
+ .hash = "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs",
+ .lazy = true,
+ },
+
+ // Fonts
+ .jetbrains_mono = .{
+ .url = "https://deps.files.ghostty.org/JetBrainsMono-2.304.tar.gz",
+ .hash = "N-V-__8AAIC5lwAVPJJzxnCAahSvZTIlG-HhtOvnM1uh-66x",
+ .lazy = true,
+ },
+ .nerd_fonts_symbols_only = .{
+ .url = "https://deps.files.ghostty.org/NerdFontsSymbolsOnly-3.4.0.tar.gz",
+ .hash = "N-V-__8AAMVLTABmYkLqhZPLXnMl-KyN38R8UVYqGrxqO26s",
+ .lazy = true,
+ },
+
+ // Other
+ .apple_sdk = .{ .path = "./pkg/apple-sdk" },
+ .android_ndk = .{ .path = "./pkg/android-ndk" },
+ .iterm2_themes = .{
+ .url = "https://deps.files.ghostty.org/ghostty-themes-release-20260323-152405-a2c7b60.tgz",
+ .hash = "N-V-__8AAL6FAwBDPampKgDjoxlJYDIn2jv0VaINS4W6CXJN",
+ .lazy = true,
+ },
+ },
+}
diff --git a/vendor/libghostty-vt/build.zig.zon.json b/vendor/libghostty-vt/build.zig.zon.json
new file mode 100644
index 00000000..ccadd6ac
--- /dev/null
+++ b/vendor/libghostty-vt/build.zig.zon.json
@@ -0,0 +1,187 @@
+{
+ "N-V-__8AANT61wB--nJ95Gj_ctmzAtcjloZ__hRqNw5lC1Kr": {
+ "name": "bindings",
+ "url": "https://deps.files.ghostty.org/DearBindings_v0.17_ImGui_v1.92.5-docking.tar.gz",
+ "hash": "sha256-i/7FAOAJJvZ5hT7iPWfMOS08MYFzPKRwRzhlHT9wuqM="
+ },
+ "N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ": {
+ "name": "breakpad",
+ "url": "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz",
+ "hash": "sha256-bMqYlD0amQdmzvYQd8Ca/1k4Bj/heh7+EijlQSttatk="
+ },
+ "N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v": {
+ "name": "fontconfig",
+ "url": "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz",
+ "hash": "sha256-O6LdkhWHGKzsXKrxpxYEO1qgVcJ7CB2RSvPMtA3OilU="
+ },
+ "N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub": {
+ "name": "freetype",
+ "url": "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz",
+ "hash": "sha256-QnIB9dUVFnDQXB9bRb713aHy592XHvVPD+qqf/0quQw="
+ },
+ "N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-": {
+ "name": "gettext",
+ "url": "https://deps.files.ghostty.org/gettext-0.24.tar.gz",
+ "hash": "sha256-yRhQPVk9cNr0hE0XWhPYFq+stmfAb7oeydzVACwVGLc="
+ },
+ "N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy": {
+ "name": "glslang",
+ "url": "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz",
+ "hash": "sha256-FKLtu1Ccs+UamlPj9eQ12/WXFgS0uDPmPmB26MCpl7U="
+ },
+ "gobject-0.3.0-Skun7ANLnwDvEfIpVmohcppXgOvg_I6YOJFmPIsKfXk-": {
+ "name": "gobject",
+ "url": "https://deps.files.ghostty.org/gobject-2025-11-08-23-1.tar.zst",
+ "hash": "sha256-2b1DBvAIHY5LhItq3+q9L6tJgi7itnnrSAHc7fXWDEg="
+ },
+ "N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr": {
+ "name": "gtk4_layer_shell",
+ "url": "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz",
+ "hash": "sha256-mChCgSYKXu9bT2OlXxbEv2p4ihAgptsDfssPcfozaYg="
+ },
+ "N-V-__8AAG02ugUcWec-Ndp-i7JTsJ0dgF8nnJRUInkGLG7G": {
+ "name": "harfbuzz",
+ "url": "https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz",
+ "hash": "sha256-8WNRuv4hRyX+LB1bWfDZPkmQWkskeJn7kNcM/5U6K5s="
+ },
+ "N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE": {
+ "name": "highway",
+ "url": "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz",
+ "hash": "sha256-h9T4iT704I8iSXNgj/6/lCaKgTgLp5wS6IQZaMgKohI="
+ },
+ "N-V-__8AAEbOfQBnvcFcCX2W5z7tDaN8vaNZGamEQtNOe0UI": {
+ "name": "imgui",
+ "url": "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.5-docking.tar.gz",
+ "hash": "sha256-yBbCDox18+Fa6Gc1DnmSVQLRpqhZOLsac7iSfl8x+cs="
+ },
+ "N-V-__8AAL6FAwBDPampKgDjoxlJYDIn2jv0VaINS4W6CXJN": {
+ "name": "iterm2_themes",
+ "url": "https://deps.files.ghostty.org/ghostty-themes-release-20260323-152405-a2c7b60.tgz",
+ "hash": "sha256-fWgXdUXh2/dNZqERzEu9hz4xyy4nl+GUjLMpUMrsRnA="
+ },
+ "N-V-__8AAIC5lwAVPJJzxnCAahSvZTIlG-HhtOvnM1uh-66x": {
+ "name": "jetbrains_mono",
+ "url": "https://deps.files.ghostty.org/JetBrainsMono-2.304.tar.gz",
+ "hash": "sha256-xXppHouCrQmLWWPzlZAy5AOPORCHr3cViFulkEYQXMQ="
+ },
+ "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD": {
+ "name": "libpng",
+ "url": "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz",
+ "hash": "sha256-/syVtGzwXo4/yKQUdQ4LparQDYnp/fF16U/wQcrxoDo="
+ },
+ "libxev-0.0.0-86vtc4IcEwCqEYxEYoN_3KXmc6A9VLcm22aVImfvecYs": {
+ "name": "libxev",
+ "url": "https://deps.files.ghostty.org/libxev-34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz",
+ "hash": "sha256-YAPqa5bkpRihKPkyMn15oRvTCZaxO3O66ymRY3lIfdc="
+ },
+ "N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK": {
+ "name": "libxml2",
+ "url": "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz",
+ "hash": "sha256-bCgFni4+60K1tLFkieORamNGwQladP7jvGXNxdiaYhU="
+ },
+ "N-V-__8AAMVLTABmYkLqhZPLXnMl-KyN38R8UVYqGrxqO26s": {
+ "name": "nerd_fonts_symbols_only",
+ "url": "https://deps.files.ghostty.org/NerdFontsSymbolsOnly-3.4.0.tar.gz",
+ "hash": "sha256-EWTRuVbUveJI17LwmYxDzJT1ICQxoVZKeTiVsec7DQQ="
+ },
+ "N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c": {
+ "name": "oniguruma",
+ "url": "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz",
+ "hash": "sha256-ABqhIC54RI9MC/GkjHblVodrNvFtks4yB+zP1h2Z8qA="
+ },
+ "N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc": {
+ "name": "pixels",
+ "url": "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz",
+ "hash": "sha256-Veg7FtCRCCUCvxSb9FfzH0IJLFmCZQ4/+657SIcb8Ro="
+ },
+ "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs": {
+ "name": "plasma_wayland_protocols",
+ "url": "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz",
+ "hash": "sha256-XFi6IUrNjmvKNCbcCLAixGqN2Zeymhs+KLrfccIN9EE="
+ },
+ "N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG": {
+ "name": "sentry",
+ "url": "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz",
+ "hash": "sha256-KsZJfMjWGo0xCT5HrduMmyxFsWsHBbszSoNbZCPDGN8="
+ },
+ "N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv": {
+ "name": "spirv_cross",
+ "url": "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz",
+ "hash": "sha256-tStvz8Ref6abHwahNiwVVHNETizAmZVVaxVsU7pmV+M="
+ },
+ "N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH": {
+ "name": "utfcpp",
+ "url": "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz",
+ "hash": "sha256-/8ZooxDndgfTk/PBizJxXyI9oerExNbgV5oR345rWc8="
+ },
+ "uucode-0.1.0-ZZjBPj96QADXyt5sqwBJUnhaDYs_qBeeKijZvlRa0eqM": {
+ "name": "uucode",
+ "url": "git+https://github.com/jacobsandlund/uucode#5f05f8f83a75caea201f12cc8ea32a2d82ea9732",
+ "hash": "sha256-sHPh+TQSdUGus/QTbj7KSJJkTuNTrK4VNmQDjS30Lf8="
+ },
+ "uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6o-Exj6m9": {
+ "name": "uucode",
+ "url": "https://deps.files.ghostty.org/uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6o-Exj6m9.tar.gz",
+ "hash": "sha256-0KvuD0+L1urjwFF3fhbnxC2JZKqqAVWRxOVlcD9GX5U="
+ },
+ "vaxis-0.5.1-BWNV_LosCQAGmCCNOLljCIw6j6-yt53tji6n6rwJ2BhS": {
+ "name": "vaxis",
+ "url": "https://deps.files.ghostty.org/vaxis-7dbb9fd3122e4ffad262dd7c151d80d863b68558.tar.gz",
+ "hash": "sha256-LnIzK8icW1Qexua9SHaeHz+3V8QAbz0a+UC1T5sIjvY="
+ },
+ "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t": {
+ "name": "wayland",
+ "url": "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz",
+ "hash": "sha256-6kGR1o5DdnflHzqs3ieCmBAUTpMdOXoyfcYDXiw5xQ0="
+ },
+ "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S": {
+ "name": "wayland_protocols",
+ "url": "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz",
+ "hash": "sha256-XO3K3egbdeYPI+XoO13SuOtO+5+Peb16NH0UiusFMPg="
+ },
+ "N-V-__8AAFdWDwA0ktbNUi9pFBHCRN4weXIgIfCrVjfGxqgA": {
+ "name": "wayland_protocols",
+ "url": "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.47/wayland-protocols-1.47.tar.gz",
+ "hash": "sha256-3S3xSrX0EDgleq7cxLX7msDuAY8/D5SvkJcCjmDTMiM="
+ },
+ "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs": {
+ "name": "wuffs",
+ "url": "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz",
+ "hash": "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM="
+ },
+ "z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ": {
+ "name": "z2d",
+ "url": "https://deps.files.ghostty.org/z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ.tar.gz",
+ "hash": "sha256-afIdou/V7gk3/lXE0J5Ir8T7L5GgHvFnyMJ1rgRnl/c="
+ },
+ "zf-0.10.3-OIRy8RuJAACKA3Lohoumrt85nRbHwbpMcUaLES8vxDnh": {
+ "name": "zf",
+ "url": "https://deps.files.ghostty.org/zf-3c52637b7e937c5ae61fd679717da3e276765b23.tar.gz",
+ "hash": "sha256-OwFdkorwTp4mJyvBXrTbtNmp1GnrbSkKDdrmc7d8RWg="
+ },
+ "zig_js-0.0.0-rjCAV-6GAADxFug7rDmPH-uM_XcnJ5NmuAMJCAscMjhi": {
+ "name": "zig_js",
+ "url": "https://deps.files.ghostty.org/zig_js-04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz",
+ "hash": "sha256-TCAY5WAV05UEuAkDhq2c6Tk/ODgAhdnDI3O/flb8c6M="
+ },
+ "zig_objc-0.0.0-Ir_Sp5gTAQCvxxR7oVIrPXxXwsfKgVP7_wqoOQrZjFeK": {
+ "name": "zig_objc",
+ "url": "https://deps.files.ghostty.org/zig_objc-f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz",
+ "hash": "sha256-3YSvc3YlNW/NciyzCQnzsujXAmZ89XlxSqfqvArAjsw="
+ },
+ "wayland-0.5.0-dev-lQa1khrMAQDJDwYFKpdH3HizherB7sHo5dKMECfvxQHe": {
+ "name": "zig_wayland",
+ "url": "https://deps.files.ghostty.org/zig_wayland-1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz",
+ "hash": "sha256-TxRrc17Q1Sf1IOO/cdPpP3LD0PpYOujt06SFH3B5Ek4="
+ },
+ "zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms": {
+ "name": "zigimg",
+ "url": "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz",
+ "hash": "sha256-LB7Xa6KzVRRUSwwnyWM+y6fDG+kIDjfnoBDJO1obxVM="
+ },
+ "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o": {
+ "name": "zlib",
+ "url": "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz",
+ "hash": "sha256-F+iIY/NgBnKrSRgvIXKBtvxNPHYr3jYZNeQ2qVIU0Fw="
+ }
+}
diff --git a/vendor/libghostty-vt/build.zig.zon.nix b/vendor/libghostty-vt/build.zig.zon.nix
new file mode 100644
index 00000000..23464bd5
--- /dev/null
+++ b/vendor/libghostty-vt/build.zig.zon.nix
@@ -0,0 +1,381 @@
+# generated by zon2nix (https://github.com/jcollie/zon2nix)
+{
+ lib,
+ linkFarm,
+ fetchurl,
+ fetchgit,
+ runCommandLocal,
+ zig_0_15,
+ name ? "zig-packages",
+}: let
+ unpackZigArtifact = {
+ name,
+ artifact,
+ }:
+ runCommandLocal name
+ {
+ nativeBuildInputs = [zig_0_15];
+ }
+ ''
+ hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
+ mv "$TMPDIR/p/$hash" "$out"
+ chmod 755 "$out"
+ '';
+
+ fetchZig = {
+ name,
+ url,
+ hash,
+ }: let
+ artifact = fetchurl {inherit url hash;};
+ in
+ unpackZigArtifact {inherit name artifact;};
+
+ fetchGitZig = {
+ name,
+ url,
+ hash,
+ }: let
+ parts = lib.splitString "#" url;
+ url_base = builtins.elemAt parts 0;
+ url_without_query = builtins.elemAt (lib.splitString "?" url_base) 0;
+ rev_base = builtins.elemAt parts 1;
+ rev =
+ if builtins.match "^[a-fA-F0-9]{40}$" rev_base != null
+ then rev_base
+ else "refs/heads/${rev_base}";
+ in
+ fetchgit {
+ inherit name rev hash;
+ url = url_without_query;
+ deepClone = false;
+ fetchSubmodules = false;
+ };
+
+ fetchZigArtifact = {
+ name,
+ url,
+ hash,
+ }: let
+ parts = lib.splitString "://" url;
+ proto = builtins.elemAt parts 0;
+ path = builtins.elemAt parts 1;
+ fetcher = {
+ "git+http" = fetchGitZig {
+ inherit name hash;
+ url = "http://${path}";
+ };
+ "git+https" = fetchGitZig {
+ inherit name hash;
+ url = "https://${path}";
+ };
+ http = fetchZig {
+ inherit name hash;
+ url = "http://${path}";
+ };
+ https = fetchZig {
+ inherit name hash;
+ url = "https://${path}";
+ };
+ };
+ in
+ fetcher.${proto};
+in
+ linkFarm name [
+ {
+ name = "N-V-__8AANT61wB--nJ95Gj_ctmzAtcjloZ__hRqNw5lC1Kr";
+ path = fetchZigArtifact {
+ name = "bindings";
+ url = "https://deps.files.ghostty.org/DearBindings_v0.17_ImGui_v1.92.5-docking.tar.gz";
+ hash = "sha256-i/7FAOAJJvZ5hT7iPWfMOS08MYFzPKRwRzhlHT9wuqM=";
+ };
+ }
+ {
+ name = "N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ";
+ path = fetchZigArtifact {
+ name = "breakpad";
+ url = "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz";
+ hash = "sha256-bMqYlD0amQdmzvYQd8Ca/1k4Bj/heh7+EijlQSttatk=";
+ };
+ }
+ {
+ name = "N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v";
+ path = fetchZigArtifact {
+ name = "fontconfig";
+ url = "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz";
+ hash = "sha256-O6LdkhWHGKzsXKrxpxYEO1qgVcJ7CB2RSvPMtA3OilU=";
+ };
+ }
+ {
+ name = "N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub";
+ path = fetchZigArtifact {
+ name = "freetype";
+ url = "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz";
+ hash = "sha256-QnIB9dUVFnDQXB9bRb713aHy592XHvVPD+qqf/0quQw=";
+ };
+ }
+ {
+ name = "N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-";
+ path = fetchZigArtifact {
+ name = "gettext";
+ url = "https://deps.files.ghostty.org/gettext-0.24.tar.gz";
+ hash = "sha256-yRhQPVk9cNr0hE0XWhPYFq+stmfAb7oeydzVACwVGLc=";
+ };
+ }
+ {
+ name = "N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy";
+ path = fetchZigArtifact {
+ name = "glslang";
+ url = "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz";
+ hash = "sha256-FKLtu1Ccs+UamlPj9eQ12/WXFgS0uDPmPmB26MCpl7U=";
+ };
+ }
+ {
+ name = "gobject-0.3.0-Skun7ANLnwDvEfIpVmohcppXgOvg_I6YOJFmPIsKfXk-";
+ path = fetchZigArtifact {
+ name = "gobject";
+ url = "https://deps.files.ghostty.org/gobject-2025-11-08-23-1.tar.zst";
+ hash = "sha256-2b1DBvAIHY5LhItq3+q9L6tJgi7itnnrSAHc7fXWDEg=";
+ };
+ }
+ {
+ name = "N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr";
+ path = fetchZigArtifact {
+ name = "gtk4_layer_shell";
+ url = "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz";
+ hash = "sha256-mChCgSYKXu9bT2OlXxbEv2p4ihAgptsDfssPcfozaYg=";
+ };
+ }
+ {
+ name = "N-V-__8AAG02ugUcWec-Ndp-i7JTsJ0dgF8nnJRUInkGLG7G";
+ path = fetchZigArtifact {
+ name = "harfbuzz";
+ url = "https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz";
+ hash = "sha256-8WNRuv4hRyX+LB1bWfDZPkmQWkskeJn7kNcM/5U6K5s=";
+ };
+ }
+ {
+ name = "N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE";
+ path = fetchZigArtifact {
+ name = "highway";
+ url = "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz";
+ hash = "sha256-h9T4iT704I8iSXNgj/6/lCaKgTgLp5wS6IQZaMgKohI=";
+ };
+ }
+ {
+ name = "N-V-__8AAEbOfQBnvcFcCX2W5z7tDaN8vaNZGamEQtNOe0UI";
+ path = fetchZigArtifact {
+ name = "imgui";
+ url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.5-docking.tar.gz";
+ hash = "sha256-yBbCDox18+Fa6Gc1DnmSVQLRpqhZOLsac7iSfl8x+cs=";
+ };
+ }
+ {
+ name = "N-V-__8AAL6FAwBDPampKgDjoxlJYDIn2jv0VaINS4W6CXJN";
+ path = fetchZigArtifact {
+ name = "iterm2_themes";
+ url = "https://deps.files.ghostty.org/ghostty-themes-release-20260323-152405-a2c7b60.tgz";
+ hash = "sha256-fWgXdUXh2/dNZqERzEu9hz4xyy4nl+GUjLMpUMrsRnA=";
+ };
+ }
+ {
+ name = "N-V-__8AAIC5lwAVPJJzxnCAahSvZTIlG-HhtOvnM1uh-66x";
+ path = fetchZigArtifact {
+ name = "jetbrains_mono";
+ url = "https://deps.files.ghostty.org/JetBrainsMono-2.304.tar.gz";
+ hash = "sha256-xXppHouCrQmLWWPzlZAy5AOPORCHr3cViFulkEYQXMQ=";
+ };
+ }
+ {
+ name = "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD";
+ path = fetchZigArtifact {
+ name = "libpng";
+ url = "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz";
+ hash = "sha256-/syVtGzwXo4/yKQUdQ4LparQDYnp/fF16U/wQcrxoDo=";
+ };
+ }
+ {
+ name = "libxev-0.0.0-86vtc4IcEwCqEYxEYoN_3KXmc6A9VLcm22aVImfvecYs";
+ path = fetchZigArtifact {
+ name = "libxev";
+ url = "https://deps.files.ghostty.org/libxev-34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz";
+ hash = "sha256-YAPqa5bkpRihKPkyMn15oRvTCZaxO3O66ymRY3lIfdc=";
+ };
+ }
+ {
+ name = "N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK";
+ path = fetchZigArtifact {
+ name = "libxml2";
+ url = "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz";
+ hash = "sha256-bCgFni4+60K1tLFkieORamNGwQladP7jvGXNxdiaYhU=";
+ };
+ }
+ {
+ name = "N-V-__8AAMVLTABmYkLqhZPLXnMl-KyN38R8UVYqGrxqO26s";
+ path = fetchZigArtifact {
+ name = "nerd_fonts_symbols_only";
+ url = "https://deps.files.ghostty.org/NerdFontsSymbolsOnly-3.4.0.tar.gz";
+ hash = "sha256-EWTRuVbUveJI17LwmYxDzJT1ICQxoVZKeTiVsec7DQQ=";
+ };
+ }
+ {
+ name = "N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c";
+ path = fetchZigArtifact {
+ name = "oniguruma";
+ url = "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz";
+ hash = "sha256-ABqhIC54RI9MC/GkjHblVodrNvFtks4yB+zP1h2Z8qA=";
+ };
+ }
+ {
+ name = "N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc";
+ path = fetchZigArtifact {
+ name = "pixels";
+ url = "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz";
+ hash = "sha256-Veg7FtCRCCUCvxSb9FfzH0IJLFmCZQ4/+657SIcb8Ro=";
+ };
+ }
+ {
+ name = "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs";
+ path = fetchZigArtifact {
+ name = "plasma_wayland_protocols";
+ url = "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz";
+ hash = "sha256-XFi6IUrNjmvKNCbcCLAixGqN2Zeymhs+KLrfccIN9EE=";
+ };
+ }
+ {
+ name = "N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG";
+ path = fetchZigArtifact {
+ name = "sentry";
+ url = "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz";
+ hash = "sha256-KsZJfMjWGo0xCT5HrduMmyxFsWsHBbszSoNbZCPDGN8=";
+ };
+ }
+ {
+ name = "N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv";
+ path = fetchZigArtifact {
+ name = "spirv_cross";
+ url = "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz";
+ hash = "sha256-tStvz8Ref6abHwahNiwVVHNETizAmZVVaxVsU7pmV+M=";
+ };
+ }
+ {
+ name = "N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH";
+ path = fetchZigArtifact {
+ name = "utfcpp";
+ url = "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz";
+ hash = "sha256-/8ZooxDndgfTk/PBizJxXyI9oerExNbgV5oR345rWc8=";
+ };
+ }
+ {
+ name = "uucode-0.1.0-ZZjBPj96QADXyt5sqwBJUnhaDYs_qBeeKijZvlRa0eqM";
+ path = fetchZigArtifact {
+ name = "uucode";
+ url = "git+https://github.com/jacobsandlund/uucode#5f05f8f83a75caea201f12cc8ea32a2d82ea9732";
+ hash = "sha256-sHPh+TQSdUGus/QTbj7KSJJkTuNTrK4VNmQDjS30Lf8=";
+ };
+ }
+ {
+ name = "uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6o-Exj6m9";
+ path = fetchZigArtifact {
+ name = "uucode";
+ url = "https://deps.files.ghostty.org/uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6o-Exj6m9.tar.gz";
+ hash = "sha256-0KvuD0+L1urjwFF3fhbnxC2JZKqqAVWRxOVlcD9GX5U=";
+ };
+ }
+ {
+ name = "vaxis-0.5.1-BWNV_LosCQAGmCCNOLljCIw6j6-yt53tji6n6rwJ2BhS";
+ path = fetchZigArtifact {
+ name = "vaxis";
+ url = "https://deps.files.ghostty.org/vaxis-7dbb9fd3122e4ffad262dd7c151d80d863b68558.tar.gz";
+ hash = "sha256-LnIzK8icW1Qexua9SHaeHz+3V8QAbz0a+UC1T5sIjvY=";
+ };
+ }
+ {
+ name = "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t";
+ path = fetchZigArtifact {
+ name = "wayland";
+ url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz";
+ hash = "sha256-6kGR1o5DdnflHzqs3ieCmBAUTpMdOXoyfcYDXiw5xQ0=";
+ };
+ }
+ {
+ name = "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S";
+ path = fetchZigArtifact {
+ name = "wayland_protocols";
+ url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz";
+ hash = "sha256-XO3K3egbdeYPI+XoO13SuOtO+5+Peb16NH0UiusFMPg=";
+ };
+ }
+ {
+ name = "N-V-__8AAFdWDwA0ktbNUi9pFBHCRN4weXIgIfCrVjfGxqgA";
+ path = fetchZigArtifact {
+ name = "wayland_protocols";
+ url = "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.47/wayland-protocols-1.47.tar.gz";
+ hash = "sha256-3S3xSrX0EDgleq7cxLX7msDuAY8/D5SvkJcCjmDTMiM=";
+ };
+ }
+ {
+ name = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs";
+ path = fetchZigArtifact {
+ name = "wuffs";
+ url = "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz";
+ hash = "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM=";
+ };
+ }
+ {
+ name = "z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ";
+ path = fetchZigArtifact {
+ name = "z2d";
+ url = "https://deps.files.ghostty.org/z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ.tar.gz";
+ hash = "sha256-afIdou/V7gk3/lXE0J5Ir8T7L5GgHvFnyMJ1rgRnl/c=";
+ };
+ }
+ {
+ name = "zf-0.10.3-OIRy8RuJAACKA3Lohoumrt85nRbHwbpMcUaLES8vxDnh";
+ path = fetchZigArtifact {
+ name = "zf";
+ url = "https://deps.files.ghostty.org/zf-3c52637b7e937c5ae61fd679717da3e276765b23.tar.gz";
+ hash = "sha256-OwFdkorwTp4mJyvBXrTbtNmp1GnrbSkKDdrmc7d8RWg=";
+ };
+ }
+ {
+ name = "zig_js-0.0.0-rjCAV-6GAADxFug7rDmPH-uM_XcnJ5NmuAMJCAscMjhi";
+ path = fetchZigArtifact {
+ name = "zig_js";
+ url = "https://deps.files.ghostty.org/zig_js-04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz";
+ hash = "sha256-TCAY5WAV05UEuAkDhq2c6Tk/ODgAhdnDI3O/flb8c6M=";
+ };
+ }
+ {
+ name = "zig_objc-0.0.0-Ir_Sp5gTAQCvxxR7oVIrPXxXwsfKgVP7_wqoOQrZjFeK";
+ path = fetchZigArtifact {
+ name = "zig_objc";
+ url = "https://deps.files.ghostty.org/zig_objc-f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz";
+ hash = "sha256-3YSvc3YlNW/NciyzCQnzsujXAmZ89XlxSqfqvArAjsw=";
+ };
+ }
+ {
+ name = "wayland-0.5.0-dev-lQa1khrMAQDJDwYFKpdH3HizherB7sHo5dKMECfvxQHe";
+ path = fetchZigArtifact {
+ name = "zig_wayland";
+ url = "https://deps.files.ghostty.org/zig_wayland-1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz";
+ hash = "sha256-TxRrc17Q1Sf1IOO/cdPpP3LD0PpYOujt06SFH3B5Ek4=";
+ };
+ }
+ {
+ name = "zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms";
+ path = fetchZigArtifact {
+ name = "zigimg";
+ url = "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz";
+ hash = "sha256-LB7Xa6KzVRRUSwwnyWM+y6fDG+kIDjfnoBDJO1obxVM=";
+ };
+ }
+ {
+ name = "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o";
+ path = fetchZigArtifact {
+ name = "zlib";
+ url = "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz";
+ hash = "sha256-F+iIY/NgBnKrSRgvIXKBtvxNPHYr3jYZNeQ2qVIU0Fw=";
+ };
+ }
+ ]
diff --git a/vendor/libghostty-vt/build.zig.zon.txt b/vendor/libghostty-vt/build.zig.zon.txt
new file mode 100644
index 00000000..f9b0322d
--- /dev/null
+++ b/vendor/libghostty-vt/build.zig.zon.txt
@@ -0,0 +1,37 @@
+git+https://github.com/jacobsandlund/uucode#5f05f8f83a75caea201f12cc8ea32a2d82ea9732
+https://deps.files.ghostty.org/DearBindings_v0.17_ImGui_v1.92.5-docking.tar.gz
+https://deps.files.ghostty.org/JetBrainsMono-2.304.tar.gz
+https://deps.files.ghostty.org/NerdFontsSymbolsOnly-3.4.0.tar.gz
+https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz
+https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz
+https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz
+https://deps.files.ghostty.org/gettext-0.24.tar.gz
+https://deps.files.ghostty.org/ghostty-themes-release-20260323-152405-a2c7b60.tgz
+https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz
+https://deps.files.ghostty.org/gobject-2025-11-08-23-1.tar.zst
+https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz
+https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz
+https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz
+https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz
+https://deps.files.ghostty.org/libxev-34fa50878aec6e5fa8f532867001ab3c36fae23e.tar.gz
+https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz
+https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz
+https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz
+https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz
+https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz
+https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz
+https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz
+https://deps.files.ghostty.org/uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6o-Exj6m9.tar.gz
+https://deps.files.ghostty.org/vaxis-7dbb9fd3122e4ffad262dd7c151d80d863b68558.tar.gz
+https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz
+https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz
+https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz
+https://deps.files.ghostty.org/z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ.tar.gz
+https://deps.files.ghostty.org/zf-3c52637b7e937c5ae61fd679717da3e276765b23.tar.gz
+https://deps.files.ghostty.org/zig_js-04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz
+https://deps.files.ghostty.org/zig_objc-f356ed02833f0f1b8e84d50bed9e807bf7cdc0ae.tar.gz
+https://deps.files.ghostty.org/zig_wayland-1b5c038ec10da20ed3a15b0b2a6db1c21383e8ea.tar.gz
+https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz
+https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz
+https://github.com/ocornut/imgui/archive/refs/tags/v1.92.5-docking.tar.gz
+https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.47/wayland-protocols-1.47.tar.gz
diff --git a/vendor/libghostty-vt/default.nix b/vendor/libghostty-vt/default.nix
new file mode 100644
index 00000000..d6bf5743
--- /dev/null
+++ b/vendor/libghostty-vt/default.nix
@@ -0,0 +1,13 @@
+(import (
+ let
+ lock = builtins.fromJSON (builtins.readFile ./flake.lock);
+ nodeName = lock.nodes.root.inputs.flake-compat;
+ in
+ fetchTarball {
+ url =
+ lock.nodes.${nodeName}.locked.url
+ or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
+ sha256 = lock.nodes.${nodeName}.locked.narHash;
+ }
+) {src = ./.;})
+.defaultNix
diff --git a/vendor/libghostty-vt/dist/cmake/README.md b/vendor/libghostty-vt/dist/cmake/README.md
new file mode 100644
index 00000000..ed8b8645
--- /dev/null
+++ b/vendor/libghostty-vt/dist/cmake/README.md
@@ -0,0 +1,67 @@
+# CMake Support for libghostty-vt
+
+The top-level `CMakeLists.txt` wraps the Zig build system so that CMake
+projects can consume libghostty-vt without invoking `zig build` manually.
+Running `cmake --build` triggers `zig build -Demit-lib-vt` automatically.
+
+This means downstream projects do require a working Zig compiler on
+`PATH` to build, but don't need to know any Zig-specific details.
+
+## Using FetchContent (recommended)
+
+Add the following to your project's `CMakeLists.txt`:
+
+```cmake
+include(FetchContent)
+FetchContent_Declare(ghostty
+ GIT_REPOSITORY https://github.com/ghostty-org/ghostty.git
+ GIT_TAG main
+)
+FetchContent_MakeAvailable(ghostty)
+
+add_executable(myapp main.c)
+target_link_libraries(myapp PRIVATE ghostty-vt)
+```
+
+This fetches the Ghostty source, builds libghostty-vt via Zig during your
+CMake build, and links it into your target. Headers are added to the
+include path automatically.
+
+### Using a local checkout
+
+If you already have the Ghostty source checked out, skip the download by
+pointing CMake at it:
+
+```shell-session
+cmake -B build -DFETCHCONTENT_SOURCE_DIR_GHOSTTY=/path/to/ghostty
+cmake --build build
+```
+
+## Using find_package (install-based)
+
+Build and install libghostty-vt first:
+
+```shell-session
+cd /path/to/ghostty
+cmake -B build
+cmake --build build
+cmake --install build --prefix /usr/local
+```
+
+Then in your project:
+
+```cmake
+find_package(ghostty-vt REQUIRED)
+
+add_executable(myapp main.c)
+target_link_libraries(myapp PRIVATE ghostty-vt::ghostty-vt)
+```
+
+## Files
+
+- `ghostty-vt-config.cmake.in` — template for the CMake package config
+ file installed alongside the library, enabling `find_package()` support.
+
+## Example
+
+See `example/c-vt-cmake/` for a complete working example.
diff --git a/vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in b/vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in
new file mode 100644
index 00000000..8e1d7572
--- /dev/null
+++ b/vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in
@@ -0,0 +1,65 @@
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+
+set(_ghostty_vt_libdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
+
+# Shared library target
+if(NOT TARGET ghostty-vt::ghostty-vt)
+ add_library(ghostty-vt::ghostty-vt SHARED IMPORTED)
+
+ if(WIN32)
+ set(_ghostty_vt_shared_location "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_BINDIR@/@GHOSTTY_VT_REALNAME@")
+ else()
+ set(_ghostty_vt_shared_location "${_ghostty_vt_libdir}/@GHOSTTY_VT_REALNAME@")
+ endif()
+
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_LOCATION "${_ghostty_vt_shared_location}"
+ INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@"
+ )
+ unset(_ghostty_vt_shared_location)
+
+ if(APPLE)
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_SONAME "@rpath/@GHOSTTY_VT_SONAME@"
+ INTERFACE_LINK_DIRECTORIES "${_ghostty_vt_libdir}"
+ )
+ # Ensure consumers can find the @rpath dylib at runtime
+ set_property(TARGET ghostty-vt::ghostty-vt APPEND PROPERTY
+ INTERFACE_LINK_OPTIONS "LINKER:-rpath,${_ghostty_vt_libdir}"
+ )
+ elseif(WIN32)
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_IMPLIB "${_ghostty_vt_libdir}/@GHOSTTY_VT_IMPLIB@"
+ )
+ else()
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_SONAME "@GHOSTTY_VT_SONAME@"
+ )
+ endif()
+endif()
+
+# Static library target
+#
+# Consumers must link transitive dependencies themselves. By default (with
+# SIMD enabled): libc, libc++ (or libstdc++ on Linux), highway, and
+# simdutf. Building with -Dsimd=false removes the C++ / highway / simdutf
+# dependencies.
+if(NOT TARGET ghostty-vt::ghostty-vt-static)
+ add_library(ghostty-vt::ghostty-vt-static STATIC IMPORTED)
+
+ set_target_properties(ghostty-vt::ghostty-vt-static PROPERTIES
+ IMPORTED_LOCATION "${_ghostty_vt_libdir}/@GHOSTTY_VT_STATIC_REALNAME@"
+ INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@"
+ )
+ if(WIN32)
+ set_target_properties(ghostty-vt::ghostty-vt-static PROPERTIES
+ INTERFACE_LINK_LIBRARIES "ntdll;kernel32"
+ )
+ endif()
+endif()
+
+unset(_ghostty_vt_libdir)
+
+check_required_components(ghostty-vt)
diff --git a/vendor/libghostty-vt/flake.lock b/vendor/libghostty-vt/flake.lock
new file mode 100644
index 00000000..f3a4814b
--- /dev/null
+++ b/vendor/libghostty-vt/flake.lock
@@ -0,0 +1,128 @@
+{
+ "nodes": {
+ "flake-compat": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1761588595,
+ "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
+ "type": "github"
+ },
+ "original": {
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "home-manager": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1770586272,
+ "narHash": "sha256-Ucci8mu8QfxwzyfER2DQDbvW9t1BnTUJhBmY7ybralo=",
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "rev": "b1f916ba052341edc1f80d4b2399f1092a4873ca",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1770537093,
+ "narHash": "sha256-XV30uo8tXuxdzuV8l3sojmlPRLd/8tpMsOp4lNzLGUo=",
+ "rev": "fef9403a3e4d31b0a23f0bacebbec52c248fbb51",
+ "type": "tarball",
+ "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre942631.fef9403a3e4d/nixexprs.tar.xz"
+ },
+ "original": {
+ "type": "tarball",
+ "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-compat": "flake-compat",
+ "home-manager": "home-manager",
+ "nixpkgs": "nixpkgs",
+ "systems": "systems",
+ "zig": "zig",
+ "zon2nix": "zon2nix"
+ }
+ },
+ "systems": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ },
+ "zig": {
+ "inputs": {
+ "flake-compat": [
+ "flake-compat"
+ ],
+ "nixpkgs": [
+ "nixpkgs"
+ ],
+ "systems": [
+ "systems"
+ ]
+ },
+ "locked": {
+ "lastModified": 1773145353,
+ "narHash": "sha256-dE8zx8WA54TRmFFQBvA48x/sXGDTP7YaDmY6nNKMAYw=",
+ "owner": "mitchellh",
+ "repo": "zig-overlay",
+ "rev": "8666155d83bf792956a7c40915508e6d4b2b8716",
+ "type": "github"
+ },
+ "original": {
+ "owner": "mitchellh",
+ "repo": "zig-overlay",
+ "type": "github"
+ }
+ },
+ "zon2nix": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1768231828,
+ "narHash": "sha256-wL/8Iij4T2OLkhHcc4NieOjf7YeJffaUYbCiCqKv/+0=",
+ "owner": "jcollie",
+ "repo": "zon2nix",
+ "rev": "c28e93f3ba133d4c1b1d65224e2eebede61fd071",
+ "type": "github"
+ },
+ "original": {
+ "owner": "jcollie",
+ "repo": "zon2nix",
+ "rev": "c28e93f3ba133d4c1b1d65224e2eebede61fd071",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/vendor/libghostty-vt/flake.nix b/vendor/libghostty-vt/flake.nix
new file mode 100644
index 00000000..59ced2de
--- /dev/null
+++ b/vendor/libghostty-vt/flake.nix
@@ -0,0 +1,163 @@
+{
+ description = "👻";
+
+ inputs = {
+ # We want to stay as up to date as possible but need to be careful that the
+ # glibc versions used by our dependencies from Nix are compatible with the
+ # system glibc that the user is building for.
+ #
+ # We are currently on nixpkgs-unstable to get Zig 0.15 for our package.nix and
+ # Gnome 49/Gtk 4.20.
+ #
+ nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
+
+ # Used for shell.nix
+ flake-compat = {
+ url = "github:edolstra/flake-compat";
+ flake = false;
+ };
+
+ systems = {
+ url = "github:nix-systems/default";
+ flake = false;
+ };
+
+ zig = {
+ url = "github:mitchellh/zig-overlay";
+ inputs = {
+ nixpkgs.follows = "nixpkgs";
+ flake-compat.follows = "flake-compat";
+ systems.follows = "systems";
+ };
+ };
+
+ zon2nix = {
+ url = "github:jcollie/zon2nix?rev=c28e93f3ba133d4c1b1d65224e2eebede61fd071";
+ inputs = {
+ nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ home-manager = {
+ url = "github:nix-community/home-manager";
+ inputs = {
+ nixpkgs.follows = "nixpkgs";
+ };
+ };
+ };
+
+ outputs = {
+ self,
+ nixpkgs,
+ zig,
+ zon2nix,
+ home-manager,
+ ...
+ }: let
+ inherit (nixpkgs) lib legacyPackages;
+
+ # Our supported systems are the same supported systems as the Zig binaries.
+ platforms = lib.attrNames zig.packages;
+
+ # It's not always possible to build Ghostty with Nix for each system,
+ # one such example being macOS due to missing Swift 6 and xcodebuild
+ # support in the Nix ecosystem. Therefore for things like package outputs
+ # we need to limit the attributes we expose.
+ buildablePlatforms = lib.filter (p: !(lib.systems.elaborate p).isDarwin) platforms;
+
+ forAllPlatforms = f: lib.genAttrs platforms (s: f legacyPackages.${s});
+ forBuildablePlatforms = f: lib.genAttrs buildablePlatforms (s: f legacyPackages.${s});
+
+ mkPkgArgs = optimize: {
+ inherit optimize;
+ revision = self.shortRev or self.dirtyShortRev or "dirty";
+ };
+ in {
+ devShells = forAllPlatforms (pkgs: {
+ default = pkgs.callPackage ./nix/devShell.nix {
+ zig = zig.packages.${pkgs.stdenv.hostPlatform.system}."0.15.2";
+ wraptest = pkgs.callPackage ./nix/pkgs/wraptest.nix {};
+ zon2nix = zon2nix;
+
+ python3 = pkgs.python3.override {
+ self = pkgs.python3;
+ packageOverrides = pyfinal: pyprev: {
+ blessed = pyfinal.callPackage ./nix/pkgs/blessed.nix {};
+ ucs-detect = pyfinal.callPackage ./nix/pkgs/ucs-detect.nix {};
+ wcwidth = pyfinal.callPackage ./nix/pkgs/wcwidth.nix {};
+ };
+ };
+ };
+ });
+
+ packages =
+ forAllPlatforms (pkgs: {
+ # Deps are needed for environmental setup on macOS
+ deps = pkgs.callPackage ./build.zig.zon.nix {};
+ })
+ // forBuildablePlatforms (pkgs: rec {
+ ghostty-debug = pkgs.callPackage ./nix/package.nix (mkPkgArgs "Debug");
+ ghostty-releasesafe = pkgs.callPackage ./nix/package.nix (mkPkgArgs "ReleaseSafe");
+ ghostty-releasefast = pkgs.callPackage ./nix/package.nix (mkPkgArgs "ReleaseFast");
+
+ ghostty = ghostty-releasefast;
+ default = ghostty;
+
+ libghostty-vt-debug = pkgs.callPackage ./nix/libghostty-vt.nix (mkPkgArgs "Debug");
+ libghostty-vt-releasesafe = pkgs.callPackage ./nix/libghostty-vt.nix (mkPkgArgs "ReleaseSafe");
+ libghostty-vt-releasefast = pkgs.callPackage ./nix/libghostty-vt.nix (mkPkgArgs "ReleaseFast");
+
+ libghostty-vt = libghostty-vt-releasefast;
+ });
+
+ formatter = forAllPlatforms (pkgs: pkgs.alejandra);
+
+ apps = forBuildablePlatforms (pkgs: let
+ runVM = module: let
+ vm = import ./nix/vm/create.nix {
+ inherit (pkgs.stdenv.hostPlatform) system;
+ inherit module nixpkgs;
+ overlay = self.overlays.debug;
+ };
+ program = pkgs.writeShellScript "run-ghostty-vm" ''
+ SHARED_DIR=$(pwd)
+ export SHARED_DIR
+
+ ${pkgs.lib.getExe vm.config.system.build.vm} "$@"
+ '';
+ in {
+ type = "app";
+ program = "${program}";
+ meta.description = "start a vm from ${toString module}";
+ };
+ in {
+ wayland-cinnamon = runVM ./nix/vm/wayland-cinnamon.nix;
+ wayland-gnome = runVM ./nix/vm/wayland-gnome.nix;
+ wayland-plasma6 = runVM ./nix/vm/wayland-plasma6.nix;
+ x11-cinnamon = runVM ./nix/vm/x11-cinnamon.nix;
+ x11-plasma6 = runVM ./nix/vm/x11-plasma6.nix;
+ x11-xfce = runVM ./nix/vm/x11-xfce.nix;
+ });
+
+ checks = forAllPlatforms (pkgs:
+ import ./nix/tests.nix {
+ inherit home-manager nixpkgs self;
+ inherit (pkgs.stdenv.hostPlatform) system;
+ });
+
+ overlays = {
+ default = self.overlays.releasefast;
+ releasefast = final: prev: {
+ ghostty = final.callPackage ./nix/package.nix (mkPkgArgs "ReleaseFast");
+ };
+ debug = final: prev: {
+ ghostty = final.callPackage ./nix/package.nix (mkPkgArgs "Debug");
+ };
+ };
+ };
+
+ nixConfig = {
+ extra-substituters = ["https://ghostty.cachix.org"];
+ extra-trusted-public-keys = ["ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="];
+ };
+}
diff --git a/vendor/libghostty-vt/include/ghostty.h b/vendor/libghostty-vt/include/ghostty.h
new file mode 100644
index 00000000..afc20bb3
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty.h
@@ -0,0 +1,1206 @@
+// Ghostty embedding API. The documentation for the embedding API is
+// only within the Zig source files that define the implementations. This
+// isn't meant to be a general purpose embedding API (yet) so there hasn't
+// been documentation or example work beyond that.
+//
+// The only consumer of this API is the macOS app, but the API is built to
+// be more general purpose.
+#ifndef GHOSTTY_H
+#define GHOSTTY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#ifdef _MSC_VER
+#include
+typedef SSIZE_T ssize_t;
+#else
+#include
+#endif
+
+//-------------------------------------------------------------------
+// Macros
+
+#define GHOSTTY_SUCCESS 0
+
+// Symbol visibility for shared library builds. On Windows, functions
+// are exported from the DLL when building and imported when consuming.
+// On other platforms with GCC/Clang, functions are marked with default
+// visibility so they remain accessible when the library is built with
+// -fvisibility=hidden. For static library builds, define GHOSTTY_STATIC
+// before including this header to make this a no-op.
+#ifndef GHOSTTY_API
+#if defined(GHOSTTY_STATIC)
+ #define GHOSTTY_API
+#elif defined(_WIN32) || defined(_WIN64)
+ #ifdef GHOSTTY_BUILD_SHARED
+ #define GHOSTTY_API __declspec(dllexport)
+ #else
+ #define GHOSTTY_API __declspec(dllimport)
+ #endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+ #define GHOSTTY_API __attribute__((visibility("default")))
+#else
+ #define GHOSTTY_API
+#endif
+#endif
+
+//-------------------------------------------------------------------
+// Types
+
+// Opaque types
+typedef void* ghostty_app_t;
+typedef void* ghostty_config_t;
+typedef void* ghostty_surface_t;
+typedef void* ghostty_inspector_t;
+
+// All the types below are fully defined and must be kept in sync with
+// their Zig counterparts. Any changes to these types MUST have an associated
+// Zig change.
+typedef enum {
+ GHOSTTY_PLATFORM_INVALID,
+ GHOSTTY_PLATFORM_MACOS,
+ GHOSTTY_PLATFORM_IOS,
+} ghostty_platform_e;
+
+typedef enum {
+ GHOSTTY_CLIPBOARD_STANDARD,
+ GHOSTTY_CLIPBOARD_SELECTION,
+} ghostty_clipboard_e;
+
+typedef struct {
+ const char *mime;
+ const char *data;
+} ghostty_clipboard_content_s;
+
+typedef enum {
+ GHOSTTY_CLIPBOARD_REQUEST_PASTE,
+ GHOSTTY_CLIPBOARD_REQUEST_OSC_52_READ,
+ GHOSTTY_CLIPBOARD_REQUEST_OSC_52_WRITE,
+} ghostty_clipboard_request_e;
+
+typedef enum {
+ GHOSTTY_MOUSE_RELEASE,
+ GHOSTTY_MOUSE_PRESS,
+} ghostty_input_mouse_state_e;
+
+typedef enum {
+ GHOSTTY_MOUSE_UNKNOWN,
+ GHOSTTY_MOUSE_LEFT,
+ GHOSTTY_MOUSE_RIGHT,
+ GHOSTTY_MOUSE_MIDDLE,
+ GHOSTTY_MOUSE_FOUR,
+ GHOSTTY_MOUSE_FIVE,
+ GHOSTTY_MOUSE_SIX,
+ GHOSTTY_MOUSE_SEVEN,
+ GHOSTTY_MOUSE_EIGHT,
+ GHOSTTY_MOUSE_NINE,
+ GHOSTTY_MOUSE_TEN,
+ GHOSTTY_MOUSE_ELEVEN,
+} ghostty_input_mouse_button_e;
+
+typedef enum {
+ GHOSTTY_MOUSE_MOMENTUM_NONE,
+ GHOSTTY_MOUSE_MOMENTUM_BEGAN,
+ GHOSTTY_MOUSE_MOMENTUM_STATIONARY,
+ GHOSTTY_MOUSE_MOMENTUM_CHANGED,
+ GHOSTTY_MOUSE_MOMENTUM_ENDED,
+ GHOSTTY_MOUSE_MOMENTUM_CANCELLED,
+ GHOSTTY_MOUSE_MOMENTUM_MAY_BEGIN,
+} ghostty_input_mouse_momentum_e;
+
+typedef enum {
+ GHOSTTY_COLOR_SCHEME_LIGHT = 0,
+ GHOSTTY_COLOR_SCHEME_DARK = 1,
+} ghostty_color_scheme_e;
+
+// This is a packed struct (see src/input/mouse.zig) but the C standard
+// afaik doesn't let us reliably define packed structs so we build it up
+// from scratch.
+typedef int ghostty_input_scroll_mods_t;
+
+typedef enum {
+ GHOSTTY_MODS_NONE = 0,
+ GHOSTTY_MODS_SHIFT = 1 << 0,
+ GHOSTTY_MODS_CTRL = 1 << 1,
+ GHOSTTY_MODS_ALT = 1 << 2,
+ GHOSTTY_MODS_SUPER = 1 << 3,
+ GHOSTTY_MODS_CAPS = 1 << 4,
+ GHOSTTY_MODS_NUM = 1 << 5,
+ GHOSTTY_MODS_SHIFT_RIGHT = 1 << 6,
+ GHOSTTY_MODS_CTRL_RIGHT = 1 << 7,
+ GHOSTTY_MODS_ALT_RIGHT = 1 << 8,
+ GHOSTTY_MODS_SUPER_RIGHT = 1 << 9,
+} ghostty_input_mods_e;
+
+typedef enum {
+ GHOSTTY_BINDING_FLAGS_CONSUMED = 1 << 0,
+ GHOSTTY_BINDING_FLAGS_ALL = 1 << 1,
+ GHOSTTY_BINDING_FLAGS_GLOBAL = 1 << 2,
+ GHOSTTY_BINDING_FLAGS_PERFORMABLE = 1 << 3,
+} ghostty_binding_flags_e;
+
+typedef enum {
+ GHOSTTY_ACTION_RELEASE,
+ GHOSTTY_ACTION_PRESS,
+ GHOSTTY_ACTION_REPEAT,
+} ghostty_input_action_e;
+
+// Based on: https://www.w3.org/TR/uievents-code/
+typedef enum {
+ GHOSTTY_KEY_UNIDENTIFIED,
+
+ // "Writing System Keys" § 3.1.1
+ GHOSTTY_KEY_BACKQUOTE,
+ GHOSTTY_KEY_BACKSLASH,
+ GHOSTTY_KEY_BRACKET_LEFT,
+ GHOSTTY_KEY_BRACKET_RIGHT,
+ GHOSTTY_KEY_COMMA,
+ GHOSTTY_KEY_DIGIT_0,
+ GHOSTTY_KEY_DIGIT_1,
+ GHOSTTY_KEY_DIGIT_2,
+ GHOSTTY_KEY_DIGIT_3,
+ GHOSTTY_KEY_DIGIT_4,
+ GHOSTTY_KEY_DIGIT_5,
+ GHOSTTY_KEY_DIGIT_6,
+ GHOSTTY_KEY_DIGIT_7,
+ GHOSTTY_KEY_DIGIT_8,
+ GHOSTTY_KEY_DIGIT_9,
+ GHOSTTY_KEY_EQUAL,
+ GHOSTTY_KEY_INTL_BACKSLASH,
+ GHOSTTY_KEY_INTL_RO,
+ GHOSTTY_KEY_INTL_YEN,
+ GHOSTTY_KEY_A,
+ GHOSTTY_KEY_B,
+ GHOSTTY_KEY_C,
+ GHOSTTY_KEY_D,
+ GHOSTTY_KEY_E,
+ GHOSTTY_KEY_F,
+ GHOSTTY_KEY_G,
+ GHOSTTY_KEY_H,
+ GHOSTTY_KEY_I,
+ GHOSTTY_KEY_J,
+ GHOSTTY_KEY_K,
+ GHOSTTY_KEY_L,
+ GHOSTTY_KEY_M,
+ GHOSTTY_KEY_N,
+ GHOSTTY_KEY_O,
+ GHOSTTY_KEY_P,
+ GHOSTTY_KEY_Q,
+ GHOSTTY_KEY_R,
+ GHOSTTY_KEY_S,
+ GHOSTTY_KEY_T,
+ GHOSTTY_KEY_U,
+ GHOSTTY_KEY_V,
+ GHOSTTY_KEY_W,
+ GHOSTTY_KEY_X,
+ GHOSTTY_KEY_Y,
+ GHOSTTY_KEY_Z,
+ GHOSTTY_KEY_MINUS,
+ GHOSTTY_KEY_PERIOD,
+ GHOSTTY_KEY_QUOTE,
+ GHOSTTY_KEY_SEMICOLON,
+ GHOSTTY_KEY_SLASH,
+
+ // "Functional Keys" § 3.1.2
+ GHOSTTY_KEY_ALT_LEFT,
+ GHOSTTY_KEY_ALT_RIGHT,
+ GHOSTTY_KEY_BACKSPACE,
+ GHOSTTY_KEY_CAPS_LOCK,
+ GHOSTTY_KEY_CONTEXT_MENU,
+ GHOSTTY_KEY_CONTROL_LEFT,
+ GHOSTTY_KEY_CONTROL_RIGHT,
+ GHOSTTY_KEY_ENTER,
+ GHOSTTY_KEY_META_LEFT,
+ GHOSTTY_KEY_META_RIGHT,
+ GHOSTTY_KEY_SHIFT_LEFT,
+ GHOSTTY_KEY_SHIFT_RIGHT,
+ GHOSTTY_KEY_SPACE,
+ GHOSTTY_KEY_TAB,
+ GHOSTTY_KEY_CONVERT,
+ GHOSTTY_KEY_KANA_MODE,
+ GHOSTTY_KEY_NON_CONVERT,
+
+ // "Control Pad Section" § 3.2
+ GHOSTTY_KEY_DELETE,
+ GHOSTTY_KEY_END,
+ GHOSTTY_KEY_HELP,
+ GHOSTTY_KEY_HOME,
+ GHOSTTY_KEY_INSERT,
+ GHOSTTY_KEY_PAGE_DOWN,
+ GHOSTTY_KEY_PAGE_UP,
+
+ // "Arrow Pad Section" § 3.3
+ GHOSTTY_KEY_ARROW_DOWN,
+ GHOSTTY_KEY_ARROW_LEFT,
+ GHOSTTY_KEY_ARROW_RIGHT,
+ GHOSTTY_KEY_ARROW_UP,
+
+ // "Numpad Section" § 3.4
+ GHOSTTY_KEY_NUM_LOCK,
+ GHOSTTY_KEY_NUMPAD_0,
+ GHOSTTY_KEY_NUMPAD_1,
+ GHOSTTY_KEY_NUMPAD_2,
+ GHOSTTY_KEY_NUMPAD_3,
+ GHOSTTY_KEY_NUMPAD_4,
+ GHOSTTY_KEY_NUMPAD_5,
+ GHOSTTY_KEY_NUMPAD_6,
+ GHOSTTY_KEY_NUMPAD_7,
+ GHOSTTY_KEY_NUMPAD_8,
+ GHOSTTY_KEY_NUMPAD_9,
+ GHOSTTY_KEY_NUMPAD_ADD,
+ GHOSTTY_KEY_NUMPAD_BACKSPACE,
+ GHOSTTY_KEY_NUMPAD_CLEAR,
+ GHOSTTY_KEY_NUMPAD_CLEAR_ENTRY,
+ GHOSTTY_KEY_NUMPAD_COMMA,
+ GHOSTTY_KEY_NUMPAD_DECIMAL,
+ GHOSTTY_KEY_NUMPAD_DIVIDE,
+ GHOSTTY_KEY_NUMPAD_ENTER,
+ GHOSTTY_KEY_NUMPAD_EQUAL,
+ GHOSTTY_KEY_NUMPAD_MEMORY_ADD,
+ GHOSTTY_KEY_NUMPAD_MEMORY_CLEAR,
+ GHOSTTY_KEY_NUMPAD_MEMORY_RECALL,
+ GHOSTTY_KEY_NUMPAD_MEMORY_STORE,
+ GHOSTTY_KEY_NUMPAD_MEMORY_SUBTRACT,
+ GHOSTTY_KEY_NUMPAD_MULTIPLY,
+ GHOSTTY_KEY_NUMPAD_PAREN_LEFT,
+ GHOSTTY_KEY_NUMPAD_PAREN_RIGHT,
+ GHOSTTY_KEY_NUMPAD_SUBTRACT,
+ GHOSTTY_KEY_NUMPAD_SEPARATOR,
+ GHOSTTY_KEY_NUMPAD_UP,
+ GHOSTTY_KEY_NUMPAD_DOWN,
+ GHOSTTY_KEY_NUMPAD_RIGHT,
+ GHOSTTY_KEY_NUMPAD_LEFT,
+ GHOSTTY_KEY_NUMPAD_BEGIN,
+ GHOSTTY_KEY_NUMPAD_HOME,
+ GHOSTTY_KEY_NUMPAD_END,
+ GHOSTTY_KEY_NUMPAD_INSERT,
+ GHOSTTY_KEY_NUMPAD_DELETE,
+ GHOSTTY_KEY_NUMPAD_PAGE_UP,
+ GHOSTTY_KEY_NUMPAD_PAGE_DOWN,
+
+ // "Function Section" § 3.5
+ GHOSTTY_KEY_ESCAPE,
+ GHOSTTY_KEY_F1,
+ GHOSTTY_KEY_F2,
+ GHOSTTY_KEY_F3,
+ GHOSTTY_KEY_F4,
+ GHOSTTY_KEY_F5,
+ GHOSTTY_KEY_F6,
+ GHOSTTY_KEY_F7,
+ GHOSTTY_KEY_F8,
+ GHOSTTY_KEY_F9,
+ GHOSTTY_KEY_F10,
+ GHOSTTY_KEY_F11,
+ GHOSTTY_KEY_F12,
+ GHOSTTY_KEY_F13,
+ GHOSTTY_KEY_F14,
+ GHOSTTY_KEY_F15,
+ GHOSTTY_KEY_F16,
+ GHOSTTY_KEY_F17,
+ GHOSTTY_KEY_F18,
+ GHOSTTY_KEY_F19,
+ GHOSTTY_KEY_F20,
+ GHOSTTY_KEY_F21,
+ GHOSTTY_KEY_F22,
+ GHOSTTY_KEY_F23,
+ GHOSTTY_KEY_F24,
+ GHOSTTY_KEY_F25,
+ GHOSTTY_KEY_FN,
+ GHOSTTY_KEY_FN_LOCK,
+ GHOSTTY_KEY_PRINT_SCREEN,
+ GHOSTTY_KEY_SCROLL_LOCK,
+ GHOSTTY_KEY_PAUSE,
+
+ // "Media Keys" § 3.6
+ GHOSTTY_KEY_BROWSER_BACK,
+ GHOSTTY_KEY_BROWSER_FAVORITES,
+ GHOSTTY_KEY_BROWSER_FORWARD,
+ GHOSTTY_KEY_BROWSER_HOME,
+ GHOSTTY_KEY_BROWSER_REFRESH,
+ GHOSTTY_KEY_BROWSER_SEARCH,
+ GHOSTTY_KEY_BROWSER_STOP,
+ GHOSTTY_KEY_EJECT,
+ GHOSTTY_KEY_LAUNCH_APP_1,
+ GHOSTTY_KEY_LAUNCH_APP_2,
+ GHOSTTY_KEY_LAUNCH_MAIL,
+ GHOSTTY_KEY_MEDIA_PLAY_PAUSE,
+ GHOSTTY_KEY_MEDIA_SELECT,
+ GHOSTTY_KEY_MEDIA_STOP,
+ GHOSTTY_KEY_MEDIA_TRACK_NEXT,
+ GHOSTTY_KEY_MEDIA_TRACK_PREVIOUS,
+ GHOSTTY_KEY_POWER,
+ GHOSTTY_KEY_SLEEP,
+ GHOSTTY_KEY_AUDIO_VOLUME_DOWN,
+ GHOSTTY_KEY_AUDIO_VOLUME_MUTE,
+ GHOSTTY_KEY_AUDIO_VOLUME_UP,
+ GHOSTTY_KEY_WAKE_UP,
+
+ // "Legacy, Non-standard, and Special Keys" § 3.7
+ GHOSTTY_KEY_COPY,
+ GHOSTTY_KEY_CUT,
+ GHOSTTY_KEY_PASTE,
+} ghostty_input_key_e;
+
+typedef struct {
+ ghostty_input_action_e action;
+ ghostty_input_mods_e mods;
+ ghostty_input_mods_e consumed_mods;
+ uint32_t keycode;
+ const char* text;
+ uint32_t unshifted_codepoint;
+ bool composing;
+} ghostty_input_key_s;
+
+typedef enum {
+ GHOSTTY_TRIGGER_PHYSICAL,
+ GHOSTTY_TRIGGER_UNICODE,
+ GHOSTTY_TRIGGER_CATCH_ALL,
+} ghostty_input_trigger_tag_e;
+
+typedef union {
+ ghostty_input_key_e translated;
+ ghostty_input_key_e physical;
+ uint32_t unicode;
+ // catch_all has no payload
+} ghostty_input_trigger_key_u;
+
+typedef struct {
+ ghostty_input_trigger_tag_e tag;
+ ghostty_input_trigger_key_u key;
+ ghostty_input_mods_e mods;
+} ghostty_input_trigger_s;
+
+typedef struct {
+ const char* action_key;
+ const char* action;
+ const char* title;
+ const char* description;
+} ghostty_command_s;
+
+typedef enum {
+ GHOSTTY_BUILD_MODE_DEBUG,
+ GHOSTTY_BUILD_MODE_RELEASE_SAFE,
+ GHOSTTY_BUILD_MODE_RELEASE_FAST,
+ GHOSTTY_BUILD_MODE_RELEASE_SMALL,
+} ghostty_build_mode_e;
+
+typedef struct {
+ ghostty_build_mode_e build_mode;
+ const char* version;
+ uintptr_t version_len;
+} ghostty_info_s;
+
+typedef struct {
+ const char* message;
+} ghostty_diagnostic_s;
+
+typedef struct {
+ const char* ptr;
+ uintptr_t len;
+ bool sentinel;
+} ghostty_string_s;
+
+typedef struct {
+ double tl_px_x;
+ double tl_px_y;
+ uint32_t offset_start;
+ uint32_t offset_len;
+ const char* text;
+ uintptr_t text_len;
+} ghostty_text_s;
+
+typedef enum {
+ GHOSTTY_POINT_ACTIVE,
+ GHOSTTY_POINT_VIEWPORT,
+ GHOSTTY_POINT_SCREEN,
+ GHOSTTY_POINT_SURFACE,
+} ghostty_point_tag_e;
+
+typedef enum {
+ GHOSTTY_POINT_COORD_EXACT,
+ GHOSTTY_POINT_COORD_TOP_LEFT,
+ GHOSTTY_POINT_COORD_BOTTOM_RIGHT,
+} ghostty_point_coord_e;
+
+typedef struct {
+ ghostty_point_tag_e tag;
+ ghostty_point_coord_e coord;
+ uint32_t x;
+ uint32_t y;
+} ghostty_point_s;
+
+typedef struct {
+ ghostty_point_s top_left;
+ ghostty_point_s bottom_right;
+ bool rectangle;
+} ghostty_selection_s;
+
+typedef struct {
+ const char* key;
+ const char* value;
+} ghostty_env_var_s;
+
+typedef struct {
+ void* nsview;
+} ghostty_platform_macos_s;
+
+typedef struct {
+ void* uiview;
+} ghostty_platform_ios_s;
+
+typedef union {
+ ghostty_platform_macos_s macos;
+ ghostty_platform_ios_s ios;
+} ghostty_platform_u;
+
+typedef enum {
+ GHOSTTY_SURFACE_CONTEXT_WINDOW = 0,
+ GHOSTTY_SURFACE_CONTEXT_TAB = 1,
+ GHOSTTY_SURFACE_CONTEXT_SPLIT = 2,
+} ghostty_surface_context_e;
+
+typedef struct {
+ ghostty_platform_e platform_tag;
+ ghostty_platform_u platform;
+ void* userdata;
+ double scale_factor;
+ float font_size;
+ const char* working_directory;
+ const char* command;
+ ghostty_env_var_s* env_vars;
+ size_t env_var_count;
+ const char* initial_input;
+ bool wait_after_command;
+ ghostty_surface_context_e context;
+} ghostty_surface_config_s;
+
+typedef struct {
+ uint16_t columns;
+ uint16_t rows;
+ uint32_t width_px;
+ uint32_t height_px;
+ uint32_t cell_width_px;
+ uint32_t cell_height_px;
+} ghostty_surface_size_s;
+
+// Config types
+
+// config.Path
+typedef struct {
+ const char* path;
+ bool optional;
+} ghostty_config_path_s;
+
+// config.Color
+typedef struct {
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+} ghostty_config_color_s;
+
+// config.ColorList
+typedef struct {
+ const ghostty_config_color_s* colors;
+ size_t len;
+} ghostty_config_color_list_s;
+
+// config.RepeatableCommand
+typedef struct {
+ const ghostty_command_s* commands;
+ size_t len;
+} ghostty_config_command_list_s;
+
+// config.Palette
+typedef struct {
+ ghostty_config_color_s colors[256];
+} ghostty_config_palette_s;
+
+// config.QuickTerminalSize
+typedef enum {
+ GHOSTTY_QUICK_TERMINAL_SIZE_NONE,
+ GHOSTTY_QUICK_TERMINAL_SIZE_PERCENTAGE,
+ GHOSTTY_QUICK_TERMINAL_SIZE_PIXELS,
+} ghostty_quick_terminal_size_tag_e;
+
+typedef union {
+ float percentage;
+ uint32_t pixels;
+} ghostty_quick_terminal_size_value_u;
+
+typedef struct {
+ ghostty_quick_terminal_size_tag_e tag;
+ ghostty_quick_terminal_size_value_u value;
+} ghostty_quick_terminal_size_s;
+
+typedef struct {
+ ghostty_quick_terminal_size_s primary;
+ ghostty_quick_terminal_size_s secondary;
+} ghostty_config_quick_terminal_size_s;
+
+// config.Fullscreen
+typedef enum {
+ GHOSTTY_CONFIG_FULLSCREEN_FALSE,
+ GHOSTTY_CONFIG_FULLSCREEN_TRUE,
+ GHOSTTY_CONFIG_FULLSCREEN_NON_NATIVE,
+ GHOSTTY_CONFIG_FULLSCREEN_NON_NATIVE_VISIBLE_MENU,
+ GHOSTTY_CONFIG_FULLSCREEN_NON_NATIVE_PADDED_NOTCH,
+} ghostty_config_fullscreen_e;
+
+// apprt.Target.Key
+typedef enum {
+ GHOSTTY_TARGET_APP,
+ GHOSTTY_TARGET_SURFACE,
+} ghostty_target_tag_e;
+
+typedef union {
+ ghostty_surface_t surface;
+} ghostty_target_u;
+
+typedef struct {
+ ghostty_target_tag_e tag;
+ ghostty_target_u target;
+} ghostty_target_s;
+
+// apprt.action.SplitDirection
+typedef enum {
+ GHOSTTY_SPLIT_DIRECTION_RIGHT,
+ GHOSTTY_SPLIT_DIRECTION_DOWN,
+ GHOSTTY_SPLIT_DIRECTION_LEFT,
+ GHOSTTY_SPLIT_DIRECTION_UP,
+} ghostty_action_split_direction_e;
+
+// apprt.action.GotoSplit
+typedef enum {
+ GHOSTTY_GOTO_SPLIT_PREVIOUS,
+ GHOSTTY_GOTO_SPLIT_NEXT,
+ GHOSTTY_GOTO_SPLIT_UP,
+ GHOSTTY_GOTO_SPLIT_LEFT,
+ GHOSTTY_GOTO_SPLIT_DOWN,
+ GHOSTTY_GOTO_SPLIT_RIGHT,
+} ghostty_action_goto_split_e;
+
+// apprt.action.GotoWindow
+typedef enum {
+ GHOSTTY_GOTO_WINDOW_PREVIOUS,
+ GHOSTTY_GOTO_WINDOW_NEXT,
+} ghostty_action_goto_window_e;
+
+// apprt.action.ResizeSplit.Direction
+typedef enum {
+ GHOSTTY_RESIZE_SPLIT_UP,
+ GHOSTTY_RESIZE_SPLIT_DOWN,
+ GHOSTTY_RESIZE_SPLIT_LEFT,
+ GHOSTTY_RESIZE_SPLIT_RIGHT,
+} ghostty_action_resize_split_direction_e;
+
+// apprt.action.ResizeSplit
+typedef struct {
+ uint16_t amount;
+ ghostty_action_resize_split_direction_e direction;
+} ghostty_action_resize_split_s;
+
+// apprt.action.MoveTab
+typedef struct {
+ ssize_t amount;
+} ghostty_action_move_tab_s;
+
+// apprt.action.GotoTab
+typedef enum {
+ GHOSTTY_GOTO_TAB_PREVIOUS = -1,
+ GHOSTTY_GOTO_TAB_NEXT = -2,
+ GHOSTTY_GOTO_TAB_LAST = -3,
+} ghostty_action_goto_tab_e;
+
+// apprt.action.Fullscreen
+typedef enum {
+ GHOSTTY_FULLSCREEN_NATIVE,
+ GHOSTTY_FULLSCREEN_MACOS_NON_NATIVE,
+ GHOSTTY_FULLSCREEN_MACOS_NON_NATIVE_VISIBLE_MENU,
+ GHOSTTY_FULLSCREEN_MACOS_NON_NATIVE_PADDED_NOTCH,
+} ghostty_action_fullscreen_e;
+
+// apprt.action.FloatWindow
+typedef enum {
+ GHOSTTY_FLOAT_WINDOW_ON,
+ GHOSTTY_FLOAT_WINDOW_OFF,
+ GHOSTTY_FLOAT_WINDOW_TOGGLE,
+} ghostty_action_float_window_e;
+
+// apprt.action.SecureInput
+typedef enum {
+ GHOSTTY_SECURE_INPUT_ON,
+ GHOSTTY_SECURE_INPUT_OFF,
+ GHOSTTY_SECURE_INPUT_TOGGLE,
+} ghostty_action_secure_input_e;
+
+// apprt.action.Inspector
+typedef enum {
+ GHOSTTY_INSPECTOR_TOGGLE,
+ GHOSTTY_INSPECTOR_SHOW,
+ GHOSTTY_INSPECTOR_HIDE,
+} ghostty_action_inspector_e;
+
+// apprt.action.QuitTimer
+typedef enum {
+ GHOSTTY_QUIT_TIMER_START,
+ GHOSTTY_QUIT_TIMER_STOP,
+} ghostty_action_quit_timer_e;
+
+// apprt.action.Readonly
+typedef enum {
+ GHOSTTY_READONLY_OFF,
+ GHOSTTY_READONLY_ON,
+} ghostty_action_readonly_e;
+
+// apprt.action.DesktopNotification.C
+typedef struct {
+ const char* title;
+ const char* body;
+} ghostty_action_desktop_notification_s;
+
+// apprt.action.SetTitle.C
+typedef struct {
+ const char* title;
+} ghostty_action_set_title_s;
+
+// apprt.action.PromptTitle
+typedef enum {
+ GHOSTTY_PROMPT_TITLE_SURFACE,
+ GHOSTTY_PROMPT_TITLE_TAB,
+} ghostty_action_prompt_title_e;
+
+// apprt.action.Pwd.C
+typedef struct {
+ const char* pwd;
+} ghostty_action_pwd_s;
+
+// terminal.MouseShape
+typedef enum {
+ GHOSTTY_MOUSE_SHAPE_DEFAULT,
+ GHOSTTY_MOUSE_SHAPE_CONTEXT_MENU,
+ GHOSTTY_MOUSE_SHAPE_HELP,
+ GHOSTTY_MOUSE_SHAPE_POINTER,
+ GHOSTTY_MOUSE_SHAPE_PROGRESS,
+ GHOSTTY_MOUSE_SHAPE_WAIT,
+ GHOSTTY_MOUSE_SHAPE_CELL,
+ GHOSTTY_MOUSE_SHAPE_CROSSHAIR,
+ GHOSTTY_MOUSE_SHAPE_TEXT,
+ GHOSTTY_MOUSE_SHAPE_VERTICAL_TEXT,
+ GHOSTTY_MOUSE_SHAPE_ALIAS,
+ GHOSTTY_MOUSE_SHAPE_COPY,
+ GHOSTTY_MOUSE_SHAPE_MOVE,
+ GHOSTTY_MOUSE_SHAPE_NO_DROP,
+ GHOSTTY_MOUSE_SHAPE_NOT_ALLOWED,
+ GHOSTTY_MOUSE_SHAPE_GRAB,
+ GHOSTTY_MOUSE_SHAPE_GRABBING,
+ GHOSTTY_MOUSE_SHAPE_ALL_SCROLL,
+ GHOSTTY_MOUSE_SHAPE_COL_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_ROW_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_N_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_E_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_S_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_W_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_NE_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_NW_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_SE_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_SW_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_EW_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_NS_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_NESW_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_NWSE_RESIZE,
+ GHOSTTY_MOUSE_SHAPE_ZOOM_IN,
+ GHOSTTY_MOUSE_SHAPE_ZOOM_OUT,
+} ghostty_action_mouse_shape_e;
+
+// apprt.action.MouseVisibility
+typedef enum {
+ GHOSTTY_MOUSE_VISIBLE,
+ GHOSTTY_MOUSE_HIDDEN,
+} ghostty_action_mouse_visibility_e;
+
+// apprt.action.MouseOverLink
+typedef struct {
+ const char* url;
+ size_t len;
+} ghostty_action_mouse_over_link_s;
+
+// apprt.action.SizeLimit
+typedef struct {
+ uint32_t min_width;
+ uint32_t min_height;
+ uint32_t max_width;
+ uint32_t max_height;
+} ghostty_action_size_limit_s;
+
+// apprt.action.InitialSize
+typedef struct {
+ uint32_t width;
+ uint32_t height;
+} ghostty_action_initial_size_s;
+
+// apprt.action.CellSize
+typedef struct {
+ uint32_t width;
+ uint32_t height;
+} ghostty_action_cell_size_s;
+
+// renderer.Health
+typedef enum {
+ GHOSTTY_RENDERER_HEALTH_HEALTHY,
+ GHOSTTY_RENDERER_HEALTH_UNHEALTHY,
+} ghostty_action_renderer_health_e;
+
+// apprt.action.KeySequence
+typedef struct {
+ bool active;
+ ghostty_input_trigger_s trigger;
+} ghostty_action_key_sequence_s;
+
+// apprt.action.KeyTable.Tag
+typedef enum {
+ GHOSTTY_KEY_TABLE_ACTIVATE,
+ GHOSTTY_KEY_TABLE_DEACTIVATE,
+ GHOSTTY_KEY_TABLE_DEACTIVATE_ALL,
+} ghostty_action_key_table_tag_e;
+
+// apprt.action.KeyTable.CValue
+typedef union {
+ struct {
+ const char *name;
+ size_t len;
+ } activate;
+} ghostty_action_key_table_u;
+
+// apprt.action.KeyTable.C
+typedef struct {
+ ghostty_action_key_table_tag_e tag;
+ ghostty_action_key_table_u value;
+} ghostty_action_key_table_s;
+
+// apprt.action.ColorKind
+typedef enum {
+ GHOSTTY_ACTION_COLOR_KIND_FOREGROUND = -1,
+ GHOSTTY_ACTION_COLOR_KIND_BACKGROUND = -2,
+ GHOSTTY_ACTION_COLOR_KIND_CURSOR = -3,
+} ghostty_action_color_kind_e;
+
+// apprt.action.ColorChange
+typedef struct {
+ ghostty_action_color_kind_e kind;
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+} ghostty_action_color_change_s;
+
+// apprt.action.ConfigChange
+typedef struct {
+ ghostty_config_t config;
+} ghostty_action_config_change_s;
+
+// apprt.action.ReloadConfig
+typedef struct {
+ bool soft;
+} ghostty_action_reload_config_s;
+
+// apprt.action.OpenUrlKind
+typedef enum {
+ GHOSTTY_ACTION_OPEN_URL_KIND_UNKNOWN,
+ GHOSTTY_ACTION_OPEN_URL_KIND_TEXT,
+ GHOSTTY_ACTION_OPEN_URL_KIND_HTML,
+} ghostty_action_open_url_kind_e;
+
+// apprt.action.OpenUrl.C
+typedef struct {
+ ghostty_action_open_url_kind_e kind;
+ const char* url;
+ uintptr_t len;
+} ghostty_action_open_url_s;
+
+// apprt.action.CloseTabMode
+typedef enum {
+ GHOSTTY_ACTION_CLOSE_TAB_MODE_THIS,
+ GHOSTTY_ACTION_CLOSE_TAB_MODE_OTHER,
+ GHOSTTY_ACTION_CLOSE_TAB_MODE_RIGHT,
+} ghostty_action_close_tab_mode_e;
+
+// apprt.surface.Message.ChildExited
+typedef struct {
+ uint32_t exit_code;
+ uint64_t timetime_ms;
+} ghostty_surface_message_childexited_s;
+
+// terminal.osc.Command.ProgressReport.State
+typedef enum {
+ GHOSTTY_PROGRESS_STATE_REMOVE,
+ GHOSTTY_PROGRESS_STATE_SET,
+ GHOSTTY_PROGRESS_STATE_ERROR,
+ GHOSTTY_PROGRESS_STATE_INDETERMINATE,
+ GHOSTTY_PROGRESS_STATE_PAUSE,
+} ghostty_action_progress_report_state_e;
+
+// terminal.osc.Command.ProgressReport.C
+typedef struct {
+ ghostty_action_progress_report_state_e state;
+ // -1 if no progress was reported, otherwise 0-100 indicating percent
+ // completeness.
+ int8_t progress;
+} ghostty_action_progress_report_s;
+
+// apprt.action.CommandFinished.C
+typedef struct {
+ // -1 if no exit code was reported, otherwise 0-255
+ int16_t exit_code;
+ // number of nanoseconds that command was running for
+ uint64_t duration;
+} ghostty_action_command_finished_s;
+
+// apprt.action.StartSearch.C
+typedef struct {
+ const char* needle;
+} ghostty_action_start_search_s;
+
+// apprt.action.SearchTotal
+typedef struct {
+ ssize_t total;
+} ghostty_action_search_total_s;
+
+// apprt.action.SearchSelected
+typedef struct {
+ ssize_t selected;
+} ghostty_action_search_selected_s;
+
+// terminal.Scrollbar
+typedef struct {
+ uint64_t total;
+ uint64_t offset;
+ uint64_t len;
+} ghostty_action_scrollbar_s;
+
+// apprt.Action.Key
+typedef enum {
+ GHOSTTY_ACTION_QUIT,
+ GHOSTTY_ACTION_NEW_WINDOW,
+ GHOSTTY_ACTION_NEW_TAB,
+ GHOSTTY_ACTION_CLOSE_TAB,
+ GHOSTTY_ACTION_NEW_SPLIT,
+ GHOSTTY_ACTION_CLOSE_ALL_WINDOWS,
+ GHOSTTY_ACTION_TOGGLE_MAXIMIZE,
+ GHOSTTY_ACTION_TOGGLE_FULLSCREEN,
+ GHOSTTY_ACTION_TOGGLE_TAB_OVERVIEW,
+ GHOSTTY_ACTION_TOGGLE_WINDOW_DECORATIONS,
+ GHOSTTY_ACTION_TOGGLE_QUICK_TERMINAL,
+ GHOSTTY_ACTION_TOGGLE_COMMAND_PALETTE,
+ GHOSTTY_ACTION_TOGGLE_VISIBILITY,
+ GHOSTTY_ACTION_TOGGLE_BACKGROUND_OPACITY,
+ GHOSTTY_ACTION_MOVE_TAB,
+ GHOSTTY_ACTION_GOTO_TAB,
+ GHOSTTY_ACTION_GOTO_SPLIT,
+ GHOSTTY_ACTION_GOTO_WINDOW,
+ GHOSTTY_ACTION_RESIZE_SPLIT,
+ GHOSTTY_ACTION_EQUALIZE_SPLITS,
+ GHOSTTY_ACTION_TOGGLE_SPLIT_ZOOM,
+ GHOSTTY_ACTION_PRESENT_TERMINAL,
+ GHOSTTY_ACTION_SIZE_LIMIT,
+ GHOSTTY_ACTION_RESET_WINDOW_SIZE,
+ GHOSTTY_ACTION_INITIAL_SIZE,
+ GHOSTTY_ACTION_CELL_SIZE,
+ GHOSTTY_ACTION_SCROLLBAR,
+ GHOSTTY_ACTION_RENDER,
+ GHOSTTY_ACTION_INSPECTOR,
+ GHOSTTY_ACTION_SHOW_GTK_INSPECTOR,
+ GHOSTTY_ACTION_RENDER_INSPECTOR,
+ GHOSTTY_ACTION_DESKTOP_NOTIFICATION,
+ GHOSTTY_ACTION_SET_TITLE,
+ GHOSTTY_ACTION_SET_TAB_TITLE,
+ GHOSTTY_ACTION_PROMPT_TITLE,
+ GHOSTTY_ACTION_PWD,
+ GHOSTTY_ACTION_MOUSE_SHAPE,
+ GHOSTTY_ACTION_MOUSE_VISIBILITY,
+ GHOSTTY_ACTION_MOUSE_OVER_LINK,
+ GHOSTTY_ACTION_RENDERER_HEALTH,
+ GHOSTTY_ACTION_OPEN_CONFIG,
+ GHOSTTY_ACTION_QUIT_TIMER,
+ GHOSTTY_ACTION_FLOAT_WINDOW,
+ GHOSTTY_ACTION_SECURE_INPUT,
+ GHOSTTY_ACTION_KEY_SEQUENCE,
+ GHOSTTY_ACTION_KEY_TABLE,
+ GHOSTTY_ACTION_COLOR_CHANGE,
+ GHOSTTY_ACTION_RELOAD_CONFIG,
+ GHOSTTY_ACTION_CONFIG_CHANGE,
+ GHOSTTY_ACTION_CLOSE_WINDOW,
+ GHOSTTY_ACTION_RING_BELL,
+ GHOSTTY_ACTION_UNDO,
+ GHOSTTY_ACTION_REDO,
+ GHOSTTY_ACTION_CHECK_FOR_UPDATES,
+ GHOSTTY_ACTION_OPEN_URL,
+ GHOSTTY_ACTION_SHOW_CHILD_EXITED,
+ GHOSTTY_ACTION_PROGRESS_REPORT,
+ GHOSTTY_ACTION_SHOW_ON_SCREEN_KEYBOARD,
+ GHOSTTY_ACTION_COMMAND_FINISHED,
+ GHOSTTY_ACTION_START_SEARCH,
+ GHOSTTY_ACTION_END_SEARCH,
+ GHOSTTY_ACTION_SEARCH_TOTAL,
+ GHOSTTY_ACTION_SEARCH_SELECTED,
+ GHOSTTY_ACTION_READONLY,
+ GHOSTTY_ACTION_COPY_TITLE_TO_CLIPBOARD,
+} ghostty_action_tag_e;
+
+typedef union {
+ ghostty_action_split_direction_e new_split;
+ ghostty_action_fullscreen_e toggle_fullscreen;
+ ghostty_action_move_tab_s move_tab;
+ ghostty_action_goto_tab_e goto_tab;
+ ghostty_action_goto_split_e goto_split;
+ ghostty_action_goto_window_e goto_window;
+ ghostty_action_resize_split_s resize_split;
+ ghostty_action_size_limit_s size_limit;
+ ghostty_action_initial_size_s initial_size;
+ ghostty_action_cell_size_s cell_size;
+ ghostty_action_scrollbar_s scrollbar;
+ ghostty_action_inspector_e inspector;
+ ghostty_action_desktop_notification_s desktop_notification;
+ ghostty_action_set_title_s set_title;
+ ghostty_action_set_title_s set_tab_title;
+ ghostty_action_prompt_title_e prompt_title;
+ ghostty_action_pwd_s pwd;
+ ghostty_action_mouse_shape_e mouse_shape;
+ ghostty_action_mouse_visibility_e mouse_visibility;
+ ghostty_action_mouse_over_link_s mouse_over_link;
+ ghostty_action_renderer_health_e renderer_health;
+ ghostty_action_quit_timer_e quit_timer;
+ ghostty_action_float_window_e float_window;
+ ghostty_action_secure_input_e secure_input;
+ ghostty_action_key_sequence_s key_sequence;
+ ghostty_action_key_table_s key_table;
+ ghostty_action_color_change_s color_change;
+ ghostty_action_reload_config_s reload_config;
+ ghostty_action_config_change_s config_change;
+ ghostty_action_open_url_s open_url;
+ ghostty_action_close_tab_mode_e close_tab_mode;
+ ghostty_surface_message_childexited_s child_exited;
+ ghostty_action_progress_report_s progress_report;
+ ghostty_action_command_finished_s command_finished;
+ ghostty_action_start_search_s start_search;
+ ghostty_action_search_total_s search_total;
+ ghostty_action_search_selected_s search_selected;
+ ghostty_action_readonly_e readonly;
+} ghostty_action_u;
+
+typedef struct {
+ ghostty_action_tag_e tag;
+ ghostty_action_u action;
+} ghostty_action_s;
+
+typedef void (*ghostty_runtime_wakeup_cb)(void*);
+typedef bool (*ghostty_runtime_read_clipboard_cb)(void*,
+ ghostty_clipboard_e,
+ void*);
+typedef void (*ghostty_runtime_confirm_read_clipboard_cb)(
+ void*,
+ const char*,
+ void*,
+ ghostty_clipboard_request_e);
+typedef void (*ghostty_runtime_write_clipboard_cb)(void*,
+ ghostty_clipboard_e,
+ const ghostty_clipboard_content_s*,
+ size_t,
+ bool);
+typedef void (*ghostty_runtime_close_surface_cb)(void*, bool);
+typedef bool (*ghostty_runtime_action_cb)(ghostty_app_t,
+ ghostty_target_s,
+ ghostty_action_s);
+
+typedef struct {
+ void* userdata;
+ bool supports_selection_clipboard;
+ ghostty_runtime_wakeup_cb wakeup_cb;
+ ghostty_runtime_action_cb action_cb;
+ ghostty_runtime_read_clipboard_cb read_clipboard_cb;
+ ghostty_runtime_confirm_read_clipboard_cb confirm_read_clipboard_cb;
+ ghostty_runtime_write_clipboard_cb write_clipboard_cb;
+ ghostty_runtime_close_surface_cb close_surface_cb;
+} ghostty_runtime_config_s;
+
+// apprt.ipc.Target.Key
+typedef enum {
+ GHOSTTY_IPC_TARGET_CLASS,
+ GHOSTTY_IPC_TARGET_DETECT,
+} ghostty_ipc_target_tag_e;
+
+typedef union {
+ char *klass;
+} ghostty_ipc_target_u;
+
+typedef struct {
+ ghostty_ipc_target_tag_e tag;
+ ghostty_ipc_target_u target;
+} chostty_ipc_target_s;
+
+// apprt.ipc.Action.NewWindow
+typedef struct {
+ // This should be a null terminated list of strings.
+ const char **arguments;
+} ghostty_ipc_action_new_window_s;
+
+typedef union {
+ ghostty_ipc_action_new_window_s new_window;
+} ghostty_ipc_action_u;
+
+// apprt.ipc.Action.Key
+typedef enum {
+ GHOSTTY_IPC_ACTION_NEW_WINDOW,
+} ghostty_ipc_action_tag_e;
+
+//-------------------------------------------------------------------
+// Published API
+
+GHOSTTY_API int ghostty_init(uintptr_t, char**);
+GHOSTTY_API void ghostty_cli_try_action(void);
+GHOSTTY_API ghostty_info_s ghostty_info(void);
+GHOSTTY_API const char* ghostty_translate(const char*);
+GHOSTTY_API void ghostty_string_free(ghostty_string_s);
+
+GHOSTTY_API ghostty_config_t ghostty_config_new();
+GHOSTTY_API void ghostty_config_free(ghostty_config_t);
+GHOSTTY_API ghostty_config_t ghostty_config_clone(ghostty_config_t);
+GHOSTTY_API void ghostty_config_load_cli_args(ghostty_config_t);
+GHOSTTY_API void ghostty_config_load_file(ghostty_config_t, const char*);
+GHOSTTY_API void ghostty_config_load_default_files(ghostty_config_t);
+GHOSTTY_API void ghostty_config_load_recursive_files(ghostty_config_t);
+GHOSTTY_API void ghostty_config_finalize(ghostty_config_t);
+GHOSTTY_API bool ghostty_config_get(ghostty_config_t, void*, const char*, uintptr_t);
+GHOSTTY_API ghostty_input_trigger_s ghostty_config_trigger(ghostty_config_t,
+ const char*,
+ uintptr_t);
+GHOSTTY_API uint32_t ghostty_config_diagnostics_count(ghostty_config_t);
+GHOSTTY_API ghostty_diagnostic_s ghostty_config_get_diagnostic(ghostty_config_t, uint32_t);
+GHOSTTY_API ghostty_string_s ghostty_config_open_path(void);
+
+GHOSTTY_API ghostty_app_t ghostty_app_new(const ghostty_runtime_config_s*,
+ ghostty_config_t);
+GHOSTTY_API void ghostty_app_free(ghostty_app_t);
+GHOSTTY_API void ghostty_app_tick(ghostty_app_t);
+GHOSTTY_API void* ghostty_app_userdata(ghostty_app_t);
+GHOSTTY_API void ghostty_app_set_focus(ghostty_app_t, bool);
+GHOSTTY_API bool ghostty_app_key(ghostty_app_t, ghostty_input_key_s);
+GHOSTTY_API bool ghostty_app_key_is_binding(ghostty_app_t, ghostty_input_key_s);
+GHOSTTY_API void ghostty_app_keyboard_changed(ghostty_app_t);
+GHOSTTY_API void ghostty_app_open_config(ghostty_app_t);
+GHOSTTY_API void ghostty_app_update_config(ghostty_app_t, ghostty_config_t);
+GHOSTTY_API bool ghostty_app_needs_confirm_quit(ghostty_app_t);
+GHOSTTY_API bool ghostty_app_has_global_keybinds(ghostty_app_t);
+GHOSTTY_API void ghostty_app_set_color_scheme(ghostty_app_t, ghostty_color_scheme_e);
+
+GHOSTTY_API ghostty_surface_config_s ghostty_surface_config_new();
+
+GHOSTTY_API ghostty_surface_t ghostty_surface_new(ghostty_app_t,
+ const ghostty_surface_config_s*);
+GHOSTTY_API void ghostty_surface_free(ghostty_surface_t);
+GHOSTTY_API void* ghostty_surface_userdata(ghostty_surface_t);
+GHOSTTY_API ghostty_app_t ghostty_surface_app(ghostty_surface_t);
+GHOSTTY_API ghostty_surface_config_s ghostty_surface_inherited_config(ghostty_surface_t, ghostty_surface_context_e);
+GHOSTTY_API void ghostty_surface_update_config(ghostty_surface_t, ghostty_config_t);
+GHOSTTY_API bool ghostty_surface_needs_confirm_quit(ghostty_surface_t);
+GHOSTTY_API bool ghostty_surface_process_exited(ghostty_surface_t);
+GHOSTTY_API void ghostty_surface_refresh(ghostty_surface_t);
+GHOSTTY_API void ghostty_surface_draw(ghostty_surface_t);
+GHOSTTY_API void ghostty_surface_set_content_scale(ghostty_surface_t, double, double);
+GHOSTTY_API void ghostty_surface_set_focus(ghostty_surface_t, bool);
+GHOSTTY_API void ghostty_surface_set_occlusion(ghostty_surface_t, bool);
+GHOSTTY_API void ghostty_surface_set_size(ghostty_surface_t, uint32_t, uint32_t);
+GHOSTTY_API ghostty_surface_size_s ghostty_surface_size(ghostty_surface_t);
+GHOSTTY_API void ghostty_surface_set_color_scheme(ghostty_surface_t,
+ ghostty_color_scheme_e);
+GHOSTTY_API ghostty_input_mods_e ghostty_surface_key_translation_mods(ghostty_surface_t,
+ ghostty_input_mods_e);
+GHOSTTY_API bool ghostty_surface_key(ghostty_surface_t, ghostty_input_key_s);
+GHOSTTY_API bool ghostty_surface_key_is_binding(ghostty_surface_t,
+ ghostty_input_key_s,
+ ghostty_binding_flags_e*);
+GHOSTTY_API void ghostty_surface_text(ghostty_surface_t, const char*, uintptr_t);
+GHOSTTY_API void ghostty_surface_preedit(ghostty_surface_t, const char*, uintptr_t);
+GHOSTTY_API bool ghostty_surface_mouse_captured(ghostty_surface_t);
+GHOSTTY_API bool ghostty_surface_mouse_button(ghostty_surface_t,
+ ghostty_input_mouse_state_e,
+ ghostty_input_mouse_button_e,
+ ghostty_input_mods_e);
+GHOSTTY_API void ghostty_surface_mouse_pos(ghostty_surface_t,
+ double,
+ double,
+ ghostty_input_mods_e);
+GHOSTTY_API void ghostty_surface_mouse_scroll(ghostty_surface_t,
+ double,
+ double,
+ ghostty_input_scroll_mods_t);
+GHOSTTY_API void ghostty_surface_mouse_pressure(ghostty_surface_t, uint32_t, double);
+GHOSTTY_API void ghostty_surface_ime_point(ghostty_surface_t, double*, double*, double*, double*);
+GHOSTTY_API void ghostty_surface_request_close(ghostty_surface_t);
+GHOSTTY_API void ghostty_surface_split(ghostty_surface_t, ghostty_action_split_direction_e);
+GHOSTTY_API void ghostty_surface_split_focus(ghostty_surface_t,
+ ghostty_action_goto_split_e);
+GHOSTTY_API void ghostty_surface_split_resize(ghostty_surface_t,
+ ghostty_action_resize_split_direction_e,
+ uint16_t);
+GHOSTTY_API void ghostty_surface_split_equalize(ghostty_surface_t);
+GHOSTTY_API bool ghostty_surface_binding_action(ghostty_surface_t, const char*, uintptr_t);
+GHOSTTY_API void ghostty_surface_complete_clipboard_request(ghostty_surface_t,
+ const char*,
+ void*,
+ bool);
+GHOSTTY_API bool ghostty_surface_has_selection(ghostty_surface_t);
+GHOSTTY_API bool ghostty_surface_read_selection(ghostty_surface_t, ghostty_text_s*);
+GHOSTTY_API bool ghostty_surface_read_text(ghostty_surface_t,
+ ghostty_selection_s,
+ ghostty_text_s*);
+GHOSTTY_API void ghostty_surface_free_text(ghostty_surface_t, ghostty_text_s*);
+
+#ifdef __APPLE__
+GHOSTTY_API void ghostty_surface_set_display_id(ghostty_surface_t, uint32_t);
+GHOSTTY_API void* ghostty_surface_quicklook_font(ghostty_surface_t);
+GHOSTTY_API bool ghostty_surface_quicklook_word(ghostty_surface_t, ghostty_text_s*);
+#endif
+
+GHOSTTY_API ghostty_inspector_t ghostty_surface_inspector(ghostty_surface_t);
+GHOSTTY_API void ghostty_inspector_free(ghostty_surface_t);
+GHOSTTY_API void ghostty_inspector_set_focus(ghostty_inspector_t, bool);
+GHOSTTY_API void ghostty_inspector_set_content_scale(ghostty_inspector_t, double, double);
+GHOSTTY_API void ghostty_inspector_set_size(ghostty_inspector_t, uint32_t, uint32_t);
+GHOSTTY_API void ghostty_inspector_mouse_button(ghostty_inspector_t,
+ ghostty_input_mouse_state_e,
+ ghostty_input_mouse_button_e,
+ ghostty_input_mods_e);
+GHOSTTY_API void ghostty_inspector_mouse_pos(ghostty_inspector_t, double, double);
+GHOSTTY_API void ghostty_inspector_mouse_scroll(ghostty_inspector_t,
+ double,
+ double,
+ ghostty_input_scroll_mods_t);
+GHOSTTY_API void ghostty_inspector_key(ghostty_inspector_t,
+ ghostty_input_action_e,
+ ghostty_input_key_e,
+ ghostty_input_mods_e);
+GHOSTTY_API void ghostty_inspector_text(ghostty_inspector_t, const char*);
+
+#ifdef __APPLE__
+GHOSTTY_API bool ghostty_inspector_metal_init(ghostty_inspector_t, void*);
+GHOSTTY_API void ghostty_inspector_metal_render(ghostty_inspector_t, void*, void*);
+GHOSTTY_API bool ghostty_inspector_metal_shutdown(ghostty_inspector_t);
+#endif
+
+// APIs I'd like to get rid of eventually but are still needed for now.
+// Don't use these unless you know what you're doing.
+GHOSTTY_API void ghostty_set_window_background_blur(ghostty_app_t, void*);
+
+// Benchmark API, if available.
+GHOSTTY_API bool ghostty_benchmark_cli(const char*, const char*);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt.h b/vendor/libghostty-vt/include/ghostty/vt.h
new file mode 100644
index 00000000..2a52f4b0
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt.h
@@ -0,0 +1,133 @@
+/**
+ * @file vt.h
+ *
+ * libghostty-vt - Virtual terminal emulator library
+ *
+ * This library provides functionality for parsing and handling terminal
+ * escape sequences as well as maintaining terminal state such as styles,
+ * cursor position, screen, scrollback, and more.
+ *
+ * WARNING: This is an incomplete, work-in-progress API. It is not yet
+ * stable and is definitely going to change.
+ */
+
+/**
+ * @mainpage libghostty-vt - Virtual Terminal Emulator Library
+ *
+ * libghostty-vt is a C library which implements a modern terminal emulator,
+ * extracted from the [Ghostty](https://ghostty.org) terminal emulator.
+ *
+ * libghostty-vt contains the logic for handling the core parts of a terminal
+ * emulator: parsing terminal escape sequences, maintaining terminal state,
+ * encoding input events, etc. It can handle scrollback, line wrapping,
+ * reflow on resize, and more.
+ *
+ * @warning This library is currently in development and the API is not yet stable.
+ * Breaking changes are expected in future versions. Use with caution in production code.
+ *
+ * @section groups_sec API Reference
+ *
+ * The API is organized into the following groups:
+ * - @ref terminal "Terminal" - Complete terminal emulator state and rendering
+ * - @ref render "Render State" - Incremental render state updates for custom renderers
+ * - @ref formatter "Formatter" - Format terminal content as plain text, VT sequences, or HTML
+ * - @ref osc "OSC Parser" - Parse OSC (Operating System Command) sequences
+ * - @ref sgr "SGR Parser" - Parse SGR (Select Graphic Rendition) sequences
+ * - @ref paste "Paste Utilities" - Validate paste data safety
+ * - @ref build_info "Build Info" - Query compile-time build configuration
+ * - @ref allocator "Memory Management" - Memory management and custom allocators
+ * - @ref wasm "WebAssembly Utilities" - WebAssembly convenience functions
+ *
+ * Encoding related APIs:
+ * - @ref focus "Focus Encoding" - Encode focus in/out events into terminal sequences
+ * - @ref key "Key Encoding" - Encode key events into terminal sequences
+ * - @ref mouse "Mouse Encoding" - Encode mouse events into terminal sequences
+ *
+ * @section examples_sec Examples
+ *
+ * Complete working examples:
+ * - @ref c-vt-build-info/src/main.c - Build info query example
+ * - @ref c-vt/src/main.c - OSC parser example
+ * - @ref c-vt-encode-key/src/main.c - Key encoding example
+ * - @ref c-vt-encode-mouse/src/main.c - Mouse encoding example
+ * - @ref c-vt-paste/src/main.c - Paste safety check example
+ * - @ref c-vt-sgr/src/main.c - SGR parser example
+ * - @ref c-vt-formatter/src/main.c - Terminal formatter example
+ * - @ref c-vt-grid-traverse/src/main.c - Grid traversal example using grid refs
+ *
+ */
+
+/** @example c-vt-build-info/src/main.c
+ * This example demonstrates how to query compile-time build configuration
+ * such as SIMD support, Kitty graphics, and tmux control mode availability.
+ */
+
+/** @example c-vt/src/main.c
+ * This example demonstrates how to use the OSC parser to parse an OSC sequence,
+ * extract command information, and retrieve command-specific data like window titles.
+ */
+
+/** @example c-vt-encode-key/src/main.c
+ * This example demonstrates how to use the key encoder to convert key events
+ * into terminal escape sequences using the Kitty keyboard protocol.
+ */
+
+/** @example c-vt-encode-mouse/src/main.c
+ * This example demonstrates how to use the mouse encoder to convert mouse events
+ * into terminal escape sequences using the SGR mouse format.
+ */
+
+/** @example c-vt-paste/src/main.c
+ * This example demonstrates how to use the paste utilities to check if
+ * paste data is safe before sending it to the terminal.
+ */
+
+/** @example c-vt-sgr/src/main.c
+ * This example demonstrates how to use the SGR parser to parse terminal
+ * styling sequences and extract text attributes like colors and underline styles.
+ */
+
+/** @example c-vt-formatter/src/main.c
+ * This example demonstrates how to use the terminal and formatter APIs to
+ * create a terminal, write VT-encoded content into it, and format the screen
+ * contents as plain text.
+ */
+
+/** @example c-vt-grid-traverse/src/main.c
+ * This example demonstrates how to traverse the entire terminal grid using
+ * grid refs to inspect cell codepoints, row wrap state, and cell styles.
+ */
+
+#ifndef GHOSTTY_VT_H
+#define GHOSTTY_VT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/allocator.h b/vendor/libghostty-vt/include/ghostty/vt/allocator.h
new file mode 100644
index 00000000..2e8685e8
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/allocator.h
@@ -0,0 +1,255 @@
+/**
+ * @file allocator.h
+ *
+ * Memory management interface for libghostty-vt.
+ */
+
+#ifndef GHOSTTY_VT_ALLOCATOR_H
+#define GHOSTTY_VT_ALLOCATOR_H
+
+#include
+#include
+#include
+#include
+
+/** @defgroup allocator Memory Management
+ *
+ * libghostty-vt does require memory allocation for various operations,
+ * but is resilient to allocation failures and will gracefully handle
+ * out-of-memory situations by returning error codes.
+ *
+ * The exact memory management semantics are documented in the relevant
+ * functions and data structures.
+ *
+ * libghostty-vt uses explicit memory allocation via an allocator
+ * interface provided by GhosttyAllocator. The interface is based on the
+ * [Zig](https://ziglang.org) allocator interface, since this has been
+ * shown to be a flexible and powerful interface in practice and enables
+ * a wide variety of allocation strategies.
+ *
+ * **For the common case, you can pass NULL as the allocator for any
+ * function that accepts one,** and libghostty will use a default allocator.
+ * The default allocator will be libc malloc/free if libc is linked.
+ * Otherwise, a custom allocator is used (currently Zig's SMP allocator)
+ * that doesn't require any external dependencies.
+ *
+ * ## Basic Usage
+ *
+ * For simple use cases, you can ignore this interface entirely by passing NULL
+ * as the allocator parameter to functions that accept one. This will use the
+ * default allocator (typically libc malloc/free, if libc is linked, but
+ * we provide our own default allocator if libc isn't linked).
+ *
+ * To use a custom allocator:
+ * 1. Implement the GhosttyAllocatorVtable function pointers
+ * 2. Create a GhosttyAllocator struct with your vtable and context
+ * 3. Pass the allocator to functions that accept one
+ *
+ * ## Alloc/Free Helpers
+ *
+ * ghostty_alloc() and ghostty_free() provide a simple malloc/free-style
+ * interface for allocating and freeing byte buffers through the library's
+ * allocator. These are useful when:
+ *
+ * - You need to allocate a buffer to pass into a libghostty-vt function
+ * (e.g. preparing input data for ghostty_terminal_vt_write()).
+ * - You need to free a buffer returned by a libghostty-vt function
+ * (e.g. the output of ghostty_formatter_format_alloc()).
+ * - You are on a platform where the library's internal allocator differs
+ * from the consumer's C runtime (e.g. Windows, where Zig's libc and
+ * MSVC's CRT maintain separate heaps), so calling the standard C
+ * free() on library-allocated memory would be undefined behavior.
+ *
+ * Always use the same allocator (or NULL) for both the allocation and
+ * the corresponding free.
+ *
+ * @{
+ */
+
+/**
+ * Function table for custom memory allocator operations.
+ *
+ * This vtable defines the interface for a custom memory allocator. All
+ * function pointers must be valid and non-NULL.
+ *
+ * @ingroup allocator
+ *
+ * If you're not going to use a custom allocator, you can ignore all of
+ * this. All functions that take an allocator pointer allow NULL to use a
+ * default allocator.
+ *
+ * The interface is based on the Zig allocator interface. I'll say up front
+ * that it is easy to look at this interface and think "wow, this is really
+ * overcomplicated". The reason for this complexity is well thought out by
+ * the Zig folks, and it enables a diverse set of allocation strategies
+ * as shown by the Zig ecosystem. As a consolation, please note that many
+ * of the arguments are only needed for advanced use cases and can be
+ * safely ignored in simple implementations. For example, if you look at
+ * the Zig implementation of the libc allocator in `lib/std/heap.zig`
+ * (search for CAllocator), you'll see it is very simple.
+ *
+ * We chose to align with the Zig allocator interface because:
+ *
+ * 1. It is a proven interface that serves a wide variety of use cases
+ * in the real world via the Zig ecosystem. It's shown to work.
+ *
+ * 2. Our core implementation itself is Zig, and this lets us very
+ * cheaply and easily convert between C and Zig allocators.
+ *
+ * NOTE(mitchellh): In the future, we can have default implementations of
+ * resize/remap and allow those to be null.
+ */
+typedef struct {
+ /**
+ * Return a pointer to `len` bytes with specified `alignment`, or return
+ * `NULL` indicating the allocation failed.
+ *
+ * @param ctx The allocator context
+ * @param len Number of bytes to allocate
+ * @param alignment Required alignment for the allocation. Guaranteed to
+ * be a power of two between 1 and 16 inclusive.
+ * @param ret_addr First return address of the allocation call stack (0 if not provided)
+ * @return Pointer to allocated memory, or NULL if allocation failed
+ */
+ void* (*alloc)(void *ctx, size_t len, uint8_t alignment, uintptr_t ret_addr);
+
+ /**
+ * Attempt to expand or shrink memory in place.
+ *
+ * `memory_len` must equal the length requested from the most recent
+ * successful call to `alloc`, `resize`, or `remap`. `alignment` must
+ * equal the same value that was passed as the `alignment` parameter to
+ * the original `alloc` call.
+ *
+ * `new_len` must be greater than zero.
+ *
+ * @param ctx The allocator context
+ * @param memory Pointer to the memory block to resize
+ * @param memory_len Current size of the memory block
+ * @param alignment Alignment (must match original allocation)
+ * @param new_len New requested size
+ * @param ret_addr First return address of the allocation call stack (0 if not provided)
+ * @return true if resize was successful in-place, false if relocation would be required
+ */
+ bool (*resize)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr);
+
+ /**
+ * Attempt to expand or shrink memory, allowing relocation.
+ *
+ * `memory_len` must equal the length requested from the most recent
+ * successful call to `alloc`, `resize`, or `remap`. `alignment` must
+ * equal the same value that was passed as the `alignment` parameter to
+ * the original `alloc` call.
+ *
+ * A non-`NULL` return value indicates the resize was successful. The
+ * allocation may have same address, or may have been relocated. In either
+ * case, the allocation now has size of `new_len`. A `NULL` return value
+ * indicates that the resize would be equivalent to allocating new memory,
+ * copying the bytes from the old memory, and then freeing the old memory.
+ * In such case, it is more efficient for the caller to perform the copy.
+ *
+ * `new_len` must be greater than zero.
+ *
+ * @param ctx The allocator context
+ * @param memory Pointer to the memory block to remap
+ * @param memory_len Current size of the memory block
+ * @param alignment Alignment (must match original allocation)
+ * @param new_len New requested size
+ * @param ret_addr First return address of the allocation call stack (0 if not provided)
+ * @return Pointer to resized memory (may be relocated), or NULL if manual copy is needed
+ */
+ void* (*remap)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr);
+
+ /**
+ * Free and invalidate a region of memory.
+ *
+ * `memory_len` must equal the length requested from the most recent
+ * successful call to `alloc`, `resize`, or `remap`. `alignment` must
+ * equal the same value that was passed as the `alignment` parameter to
+ * the original `alloc` call.
+ *
+ * @param ctx The allocator context
+ * @param memory Pointer to the memory block to free
+ * @param memory_len Size of the memory block
+ * @param alignment Alignment (must match original allocation)
+ * @param ret_addr First return address of the allocation call stack (0 if not provided)
+ */
+ void (*free)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, uintptr_t ret_addr);
+} GhosttyAllocatorVtable;
+
+/**
+ * Custom memory allocator.
+ *
+ * For functions that take an allocator pointer, a NULL pointer indicates
+ * that the default allocator should be used. The default allocator will
+ * be libc malloc/free if we're linking to libc. If libc isn't linked,
+ * a custom allocator is used (currently Zig's SMP allocator).
+ *
+ * @ingroup allocator
+ *
+ * Usage example:
+ * @code
+ * GhosttyAllocator allocator = {
+ * .vtable = &my_allocator_vtable,
+ * .ctx = my_allocator_state
+ * };
+ * @endcode
+ */
+typedef struct GhosttyAllocator {
+ /**
+ * Opaque context pointer passed to all vtable functions.
+ * This allows the allocator implementation to maintain state
+ * or reference external resources needed for memory management.
+ */
+ void *ctx;
+
+ /**
+ * Pointer to the allocator's vtable containing function pointers
+ * for memory operations (alloc, resize, remap, free).
+ */
+ const GhosttyAllocatorVtable *vtable;
+} GhosttyAllocator;
+
+/**
+ * Allocate a buffer of `len` bytes.
+ *
+ * Uses the provided allocator, or the default allocator if NULL is passed.
+ * The returned buffer must be freed with ghostty_free() using the same
+ * allocator.
+ *
+ * @param allocator Pointer to the allocator to use, or NULL for the default
+ * @param len Number of bytes to allocate
+ * @return Pointer to the allocated buffer, or NULL if allocation failed
+ *
+ * @ingroup allocator
+ */
+GHOSTTY_API uint8_t* ghostty_alloc(const GhosttyAllocator* allocator, size_t len);
+
+/**
+ * Free memory that was allocated by a libghostty-vt function.
+ *
+ * Use this to free buffers returned by functions such as
+ * ghostty_formatter_format_alloc(). Pass the same allocator that was
+ * used for the allocation, or NULL if the default allocator was used.
+ *
+ * On platforms where the library's internal allocator differs from the
+ * consumer's C runtime (e.g. Windows, where Zig's libc and MSVC's CRT
+ * maintain separate heaps), calling the standard C free() on memory
+ * allocated by the library causes undefined behavior. This function
+ * guarantees the correct allocator is used regardless of platform.
+ *
+ * It is safe to pass a NULL pointer; the call is a no-op in that case.
+ *
+ * @param allocator Pointer to the allocator that was used to allocate the
+ * memory, or NULL if the default allocator was used
+ * @param ptr Pointer to the memory to free (may be NULL)
+ * @param len Length of the allocation in bytes (must match the original
+ * allocation size)
+ *
+ * @ingroup allocator
+ */
+GHOSTTY_API void ghostty_free(const GhosttyAllocator* allocator, uint8_t* ptr, size_t len);
+
+/** @} */
+
+#endif /* GHOSTTY_VT_ALLOCATOR_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/build_info.h b/vendor/libghostty-vt/include/ghostty/vt/build_info.h
new file mode 100644
index 00000000..7f77a769
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/build_info.h
@@ -0,0 +1,140 @@
+/**
+ * @file build_info.h
+ *
+ * Build info - query compile-time build configuration of libghostty-vt.
+ */
+
+#ifndef GHOSTTY_VT_BUILD_INFO_H
+#define GHOSTTY_VT_BUILD_INFO_H
+
+/** @defgroup build_info Build Info
+ *
+ * Query compile-time build configuration of libghostty-vt.
+ *
+ * These values reflect the options the library was built with and are
+ * constant for the lifetime of the process.
+ *
+ * ## Basic Usage
+ *
+ * Use ghostty_build_info() to query individual build options:
+ *
+ * @snippet c-vt-build-info/src/main.c build-info-query
+ *
+ * @{
+ */
+
+#include
+#include
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Build optimization mode.
+ */
+typedef enum {
+ GHOSTTY_OPTIMIZE_DEBUG = 0,
+ GHOSTTY_OPTIMIZE_RELEASE_SAFE = 1,
+ GHOSTTY_OPTIMIZE_RELEASE_SMALL = 2,
+ GHOSTTY_OPTIMIZE_RELEASE_FAST = 3,
+} GhosttyOptimizeMode;
+
+/**
+ * Build info data types that can be queried.
+ *
+ * Each variant documents the expected output pointer type.
+ */
+typedef enum {
+ /** Invalid data type. Never results in any data extraction. */
+ GHOSTTY_BUILD_INFO_INVALID = 0,
+
+ /**
+ * Whether SIMD-accelerated code paths are enabled.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_BUILD_INFO_SIMD = 1,
+
+ /**
+ * Whether Kitty graphics protocol support is available.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_BUILD_INFO_KITTY_GRAPHICS = 2,
+
+ /**
+ * Whether tmux control mode support is available.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE = 3,
+
+ /**
+ * The optimization mode the library was built with.
+ *
+ * Output type: GhosttyOptimizeMode *
+ */
+ GHOSTTY_BUILD_INFO_OPTIMIZE = 4,
+
+ /**
+ * The full version string (e.g. "1.2.3" or "1.2.3-dev+abcdef").
+ *
+ * Output type: GhosttyString *
+ */
+ GHOSTTY_BUILD_INFO_VERSION_STRING = 5,
+
+ /**
+ * The major version number.
+ *
+ * Output type: size_t *
+ */
+ GHOSTTY_BUILD_INFO_VERSION_MAJOR = 6,
+
+ /**
+ * The minor version number.
+ *
+ * Output type: size_t *
+ */
+ GHOSTTY_BUILD_INFO_VERSION_MINOR = 7,
+
+ /**
+ * The patch version number.
+ *
+ * Output type: size_t *
+ */
+ GHOSTTY_BUILD_INFO_VERSION_PATCH = 8,
+
+ /**
+ * The build metadata string (e.g. commit hash). Has zero length if
+ * no build metadata is present.
+ *
+ * Output type: GhosttyString *
+ */
+ GHOSTTY_BUILD_INFO_VERSION_BUILD = 9,
+} GhosttyBuildInfo;
+
+/**
+ * Query a compile-time build configuration value.
+ *
+ * The caller must pass a pointer to the correct output type for the
+ * requested data (see GhosttyBuildInfo variants for types).
+ *
+ * @param data The build info field to query
+ * @param out Pointer to store the result (type depends on data parameter)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the
+ * data type is invalid
+ *
+ * @ingroup build_info
+ */
+GHOSTTY_API GhosttyResult ghostty_build_info(GhosttyBuildInfo data, void *out);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
+
+#endif /* GHOSTTY_VT_BUILD_INFO_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/color.h b/vendor/libghostty-vt/include/ghostty/vt/color.h
new file mode 100644
index 00000000..9dc21864
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/color.h
@@ -0,0 +1,97 @@
+/**
+ * @file color.h
+ *
+ * Color types and utilities.
+ */
+
+#ifndef GHOSTTY_VT_COLOR_H
+#define GHOSTTY_VT_COLOR_H
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * RGB color value.
+ *
+ * @ingroup sgr
+ */
+typedef struct {
+ uint8_t r; /**< Red component (0-255) */
+ uint8_t g; /**< Green component (0-255) */
+ uint8_t b; /**< Blue component (0-255) */
+} GhosttyColorRgb;
+
+/**
+ * Palette color index (0-255).
+ *
+ * @ingroup sgr
+ */
+typedef uint8_t GhosttyColorPaletteIndex;
+
+/** @addtogroup sgr
+ * @{
+ */
+
+/** Black color (0) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BLACK 0
+/** Red color (1) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_RED 1
+/** Green color (2) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_GREEN 2
+/** Yellow color (3) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_YELLOW 3
+/** Blue color (4) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BLUE 4
+/** Magenta color (5) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_MAGENTA 5
+/** Cyan color (6) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_CYAN 6
+/** White color (7) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_WHITE 7
+/** Bright black color (8) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_BLACK 8
+/** Bright red color (9) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_RED 9
+/** Bright green color (10) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_GREEN 10
+/** Bright yellow color (11) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_YELLOW 11
+/** Bright blue color (12) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_BLUE 12
+/** Bright magenta color (13) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_MAGENTA 13
+/** Bright cyan color (14) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_CYAN 14
+/** Bright white color (15) @ingroup sgr */
+#define GHOSTTY_COLOR_NAMED_BRIGHT_WHITE 15
+
+/** @} */
+
+/**
+ * Get the RGB color components.
+ *
+ * This function extracts the individual red, green, and blue components
+ * from a GhosttyColorRgb value. Primarily useful in WebAssembly environments
+ * where accessing struct fields directly is difficult.
+ *
+ * @param color The RGB color value
+ * @param r Pointer to store the red component (0-255)
+ * @param g Pointer to store the green component (0-255)
+ * @param b Pointer to store the blue component (0-255)
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API void ghostty_color_rgb_get(GhosttyColorRgb color,
+ uint8_t* r,
+ uint8_t* g,
+ uint8_t* b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_COLOR_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/device.h b/vendor/libghostty-vt/include/ghostty/vt/device.h
new file mode 100644
index 00000000..fdf6bca7
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/device.h
@@ -0,0 +1,150 @@
+/**
+ * @file device.h
+ *
+ * Device types used by the terminal for device status and device attribute
+ * queries.
+ */
+
+#ifndef GHOSTTY_VT_DEVICE_H
+#define GHOSTTY_VT_DEVICE_H
+
+#include
+#include
+
+/* DA1 conformance levels (Pp parameter). */
+#define GHOSTTY_DA_CONFORMANCE_VT100 1
+#define GHOSTTY_DA_CONFORMANCE_VT101 1
+#define GHOSTTY_DA_CONFORMANCE_VT102 6
+#define GHOSTTY_DA_CONFORMANCE_VT125 12
+#define GHOSTTY_DA_CONFORMANCE_VT131 7
+#define GHOSTTY_DA_CONFORMANCE_VT132 4
+#define GHOSTTY_DA_CONFORMANCE_VT220 62
+#define GHOSTTY_DA_CONFORMANCE_VT240 62
+#define GHOSTTY_DA_CONFORMANCE_VT320 63
+#define GHOSTTY_DA_CONFORMANCE_VT340 63
+#define GHOSTTY_DA_CONFORMANCE_VT420 64
+#define GHOSTTY_DA_CONFORMANCE_VT510 65
+#define GHOSTTY_DA_CONFORMANCE_VT520 65
+#define GHOSTTY_DA_CONFORMANCE_VT525 65
+#define GHOSTTY_DA_CONFORMANCE_LEVEL_2 62
+#define GHOSTTY_DA_CONFORMANCE_LEVEL_3 63
+#define GHOSTTY_DA_CONFORMANCE_LEVEL_4 64
+#define GHOSTTY_DA_CONFORMANCE_LEVEL_5 65
+
+/* DA1 feature codes (Ps parameters). */
+#define GHOSTTY_DA_FEATURE_COLUMNS_132 1
+#define GHOSTTY_DA_FEATURE_PRINTER 2
+#define GHOSTTY_DA_FEATURE_REGIS 3
+#define GHOSTTY_DA_FEATURE_SIXEL 4
+#define GHOSTTY_DA_FEATURE_SELECTIVE_ERASE 6
+#define GHOSTTY_DA_FEATURE_USER_DEFINED_KEYS 8
+#define GHOSTTY_DA_FEATURE_NATIONAL_REPLACEMENT 9
+#define GHOSTTY_DA_FEATURE_TECHNICAL_CHARACTERS 15
+#define GHOSTTY_DA_FEATURE_LOCATOR 16
+#define GHOSTTY_DA_FEATURE_TERMINAL_STATE 17
+#define GHOSTTY_DA_FEATURE_WINDOWING 18
+#define GHOSTTY_DA_FEATURE_HORIZONTAL_SCROLLING 21
+#define GHOSTTY_DA_FEATURE_ANSI_COLOR 22
+#define GHOSTTY_DA_FEATURE_RECTANGULAR_EDITING 28
+#define GHOSTTY_DA_FEATURE_ANSI_TEXT_LOCATOR 29
+#define GHOSTTY_DA_FEATURE_CLIPBOARD 52
+
+/* DA2 device type identifiers (Pp parameter). */
+#define GHOSTTY_DA_DEVICE_TYPE_VT100 0
+#define GHOSTTY_DA_DEVICE_TYPE_VT220 1
+#define GHOSTTY_DA_DEVICE_TYPE_VT240 2
+#define GHOSTTY_DA_DEVICE_TYPE_VT330 18
+#define GHOSTTY_DA_DEVICE_TYPE_VT340 19
+#define GHOSTTY_DA_DEVICE_TYPE_VT320 24
+#define GHOSTTY_DA_DEVICE_TYPE_VT382 32
+#define GHOSTTY_DA_DEVICE_TYPE_VT420 41
+#define GHOSTTY_DA_DEVICE_TYPE_VT510 61
+#define GHOSTTY_DA_DEVICE_TYPE_VT520 64
+#define GHOSTTY_DA_DEVICE_TYPE_VT525 65
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Color scheme reported in response to a CSI ? 996 n query.
+ *
+ * @ingroup terminal
+ */
+typedef enum {
+ GHOSTTY_COLOR_SCHEME_LIGHT = 0,
+ GHOSTTY_COLOR_SCHEME_DARK = 1,
+} GhosttyColorScheme;
+
+/**
+ * Primary device attributes (DA1) response data.
+ *
+ * Returned as part of GhosttyDeviceAttributes in response to a CSI c query.
+ * The conformance_level is the Pp parameter and features contains the Ps
+ * feature codes.
+ *
+ * @ingroup terminal
+ */
+typedef struct {
+ /** Conformance level (Pp parameter). E.g. 62 for VT220. */
+ uint16_t conformance_level;
+
+ /** DA1 feature codes. Only the first num_features entries are valid. */
+ uint16_t features[64];
+
+ /** Number of valid entries in the features array. */
+ size_t num_features;
+} GhosttyDeviceAttributesPrimary;
+
+/**
+ * Secondary device attributes (DA2) response data.
+ *
+ * Returned as part of GhosttyDeviceAttributes in response to a CSI > c query.
+ * Response format: CSI > Pp ; Pv ; Pc c
+ *
+ * @ingroup terminal
+ */
+typedef struct {
+ /** Terminal type identifier (Pp). E.g. 1 for VT220. */
+ uint16_t device_type;
+
+ /** Firmware/patch version number (Pv). */
+ uint16_t firmware_version;
+
+ /** ROM cartridge registration number (Pc). Always 0 for emulators. */
+ uint16_t rom_cartridge;
+} GhosttyDeviceAttributesSecondary;
+
+/**
+ * Tertiary device attributes (DA3) response data.
+ *
+ * Returned as part of GhosttyDeviceAttributes in response to a CSI = c query.
+ * Response format: DCS ! | D...D ST (DECRPTUI).
+ *
+ * @ingroup terminal
+ */
+typedef struct {
+ /** Unit ID encoded as 8 uppercase hex digits in the response. */
+ uint32_t unit_id;
+} GhosttyDeviceAttributesTertiary;
+
+/**
+ * Device attributes response data for all three DA levels.
+ *
+ * Filled by the device_attributes callback in response to CSI c,
+ * CSI > c, or CSI = c queries. The terminal uses whichever sub-struct
+ * matches the request type.
+ *
+ * @ingroup terminal
+ */
+typedef struct {
+ GhosttyDeviceAttributesPrimary primary;
+ GhosttyDeviceAttributesSecondary secondary;
+ GhosttyDeviceAttributesTertiary tertiary;
+} GhosttyDeviceAttributes;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_DEVICE_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/focus.h b/vendor/libghostty-vt/include/ghostty/vt/focus.h
new file mode 100644
index 00000000..6e4c9502
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/focus.h
@@ -0,0 +1,75 @@
+/**
+ * @file focus.h
+ *
+ * Focus encoding - encode focus in/out events into terminal escape sequences.
+ */
+
+#ifndef GHOSTTY_VT_FOCUS_H
+#define GHOSTTY_VT_FOCUS_H
+
+/** @defgroup focus Focus Encoding
+ *
+ * Utilities for encoding focus gained/lost events into terminal escape
+ * sequences (CSI I / CSI O) for focus reporting mode (mode 1004).
+ *
+ * ## Basic Usage
+ *
+ * Use ghostty_focus_encode() to encode a focus event into a caller-provided
+ * buffer. If the buffer is too small, the function returns
+ * GHOSTTY_OUT_OF_SPACE and sets the required size in the output parameter.
+ *
+ * ## Example
+ *
+ * @snippet c-vt-encode-focus/src/main.c focus-encode
+ *
+ * @{
+ */
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Focus event types for focus reporting mode (mode 1004).
+ */
+typedef enum {
+ /** Terminal window gained focus */
+ GHOSTTY_FOCUS_GAINED = 0,
+ /** Terminal window lost focus */
+ GHOSTTY_FOCUS_LOST = 1,
+} GhosttyFocusEvent;
+
+/**
+ * Encode a focus event into a terminal escape sequence.
+ *
+ * Encodes a focus gained (CSI I) or focus lost (CSI O) report into the
+ * provided buffer.
+ *
+ * If the buffer is too small, the function returns GHOSTTY_OUT_OF_SPACE
+ * and writes the required buffer size to @p out_written. The caller can
+ * then retry with a sufficiently sized buffer.
+ *
+ * @param event The focus event to encode
+ * @param buf Output buffer to write the encoded sequence into (may be NULL)
+ * @param buf_len Size of the output buffer in bytes
+ * @param[out] out_written On success, the number of bytes written. On
+ * GHOSTTY_OUT_OF_SPACE, the required buffer size.
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer
+ * is too small
+ */
+GHOSTTY_API GhosttyResult ghostty_focus_encode(
+ GhosttyFocusEvent event,
+ char* buf,
+ size_t buf_len,
+ size_t* out_written);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
+
+#endif /* GHOSTTY_VT_FOCUS_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/formatter.h b/vendor/libghostty-vt/include/ghostty/vt/formatter.h
new file mode 100644
index 00000000..81efdb27
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/formatter.h
@@ -0,0 +1,225 @@
+/**
+ * @file formatter.h
+ *
+ * Format terminal content as plain text, VT sequences, or HTML.
+ */
+
+#ifndef GHOSTTY_VT_FORMATTER_H
+#define GHOSTTY_VT_FORMATTER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup formatter Formatter
+ *
+ * Format terminal content as plain text, VT sequences, or HTML.
+ *
+ * A formatter captures a reference to a terminal and formatting options.
+ * It can be used repeatedly to produce output that reflects the current
+ * terminal state at the time of each format call.
+ *
+ * The terminal must outlive the formatter.
+ *
+ * @{
+ */
+
+/**
+ * Output format.
+ *
+ * @ingroup formatter
+ */
+typedef enum {
+ /** Plain text (no escape sequences). */
+ GHOSTTY_FORMATTER_FORMAT_PLAIN,
+
+ /** VT sequences preserving colors, styles, URLs, etc. */
+ GHOSTTY_FORMATTER_FORMAT_VT,
+
+ /** HTML with inline styles. */
+ GHOSTTY_FORMATTER_FORMAT_HTML,
+} GhosttyFormatterFormat;
+
+/**
+ * Extra screen state to include in styled output.
+ *
+ * @ingroup formatter
+ */
+typedef struct {
+ /** Size of this struct in bytes. Must be set to sizeof(GhosttyFormatterScreenExtra). */
+ size_t size;
+
+ /** Emit cursor position using CUP (CSI H). */
+ bool cursor;
+
+ /** Emit current SGR style state based on the cursor's active style_id. */
+ bool style;
+
+ /** Emit current hyperlink state using OSC 8 sequences. */
+ bool hyperlink;
+
+ /** Emit character protection mode using DECSCA. */
+ bool protection;
+
+ /** Emit Kitty keyboard protocol state using CSI > u and CSI = sequences. */
+ bool kitty_keyboard;
+
+ /** Emit character set designations and invocations. */
+ bool charsets;
+} GhosttyFormatterScreenExtra;
+
+/**
+ * Extra terminal state to include in styled output.
+ *
+ * @ingroup formatter
+ */
+typedef struct {
+ /** Size of this struct in bytes. Must be set to sizeof(GhosttyFormatterTerminalExtra). */
+ size_t size;
+
+ /** Emit the palette using OSC 4 sequences. */
+ bool palette;
+
+ /** Emit terminal modes that differ from their defaults using CSI h/l. */
+ bool modes;
+
+ /** Emit scrolling region state using DECSTBM and DECSLRM sequences. */
+ bool scrolling_region;
+
+ /** Emit tabstop positions by clearing all tabs and setting each one. */
+ bool tabstops;
+
+ /** Emit the present working directory using OSC 7. */
+ bool pwd;
+
+ /** Emit keyboard modes such as ModifyOtherKeys. */
+ bool keyboard;
+
+ /** Screen-level extras. */
+ GhosttyFormatterScreenExtra screen;
+} GhosttyFormatterTerminalExtra;
+
+/**
+ * Opaque handle to a formatter instance.
+ *
+ * @ingroup formatter
+ */
+typedef struct GhosttyFormatterImpl* GhosttyFormatter;
+
+/**
+ * Options for creating a terminal formatter.
+ *
+ * @ingroup formatter
+ */
+typedef struct {
+ /** Size of this struct in bytes. Must be set to sizeof(GhosttyFormatterTerminalOptions). */
+ size_t size;
+
+ /** Output format to emit. */
+ GhosttyFormatterFormat emit;
+
+ /** Whether to unwrap soft-wrapped lines. */
+ bool unwrap;
+
+ /** Whether to trim trailing whitespace on non-blank lines. */
+ bool trim;
+
+ /** Extra terminal state to include in styled output. */
+ GhosttyFormatterTerminalExtra extra;
+} GhosttyFormatterTerminalOptions;
+
+/**
+ * Create a formatter for a terminal's active screen.
+ *
+ * The terminal must outlive the formatter. The formatter stores a borrowed
+ * reference to the terminal and reads its current state on each format call.
+ *
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param formatter Pointer to store the created formatter handle
+ * @param terminal The terminal to format (must not be NULL)
+ * @param options Formatting options
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup formatter
+ */
+GHOSTTY_API GhosttyResult ghostty_formatter_terminal_new(
+ const GhosttyAllocator* allocator,
+ GhosttyFormatter* formatter,
+ GhosttyTerminal terminal,
+ GhosttyFormatterTerminalOptions options);
+
+/**
+ * Run the formatter and produce output into the caller-provided buffer.
+ *
+ * Each call formats the current terminal state. Pass NULL for buf to
+ * query the required buffer size without writing any output; in that case
+ * out_written receives the required size and the return value is
+ * GHOSTTY_OUT_OF_SPACE.
+ *
+ * If the buffer is too small, returns GHOSTTY_OUT_OF_SPACE and sets
+ * out_written to the required size. The caller can then retry with a
+ * larger buffer.
+ *
+ * @param formatter The formatter handle (must not be NULL)
+ * @param buf Pointer to the output buffer, or NULL to query size
+ * @param buf_len Length of the output buffer in bytes
+ * @param out_written Pointer to receive the number of bytes written,
+ * or the required size on failure
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup formatter
+ */
+GHOSTTY_API GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter formatter,
+ uint8_t* buf,
+ size_t buf_len,
+ size_t* out_written);
+
+/**
+ * Run the formatter and return an allocated buffer with the output.
+ *
+ * Each call formats the current terminal state. The buffer is allocated
+ * using the provided allocator (or the default allocator if NULL).
+ * The caller is responsible for freeing the returned buffer with
+ * ghostty_free(), passing the same allocator (or NULL for the default)
+ * that was used for the allocation.
+ *
+ * @param formatter The formatter handle (must not be NULL)
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param out_ptr Pointer to receive the allocated buffer
+ * @param out_len Pointer to receive the length of the output in bytes
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation
+ * failure
+ *
+ * @ingroup formatter
+ */
+GHOSTTY_API GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter formatter,
+ const GhosttyAllocator* allocator,
+ uint8_t** out_ptr,
+ size_t* out_len);
+
+/**
+ * Free a formatter instance.
+ *
+ * Releases all resources associated with the formatter. After this call,
+ * the formatter handle becomes invalid.
+ *
+ * @param formatter The formatter handle to free (may be NULL)
+ *
+ * @ingroup formatter
+ */
+GHOSTTY_API void ghostty_formatter_free(GhosttyFormatter formatter);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_FORMATTER_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/grid_ref.h b/vendor/libghostty-vt/include/ghostty/vt/grid_ref.h
new file mode 100644
index 00000000..d3489ea7
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/grid_ref.h
@@ -0,0 +1,131 @@
+/**
+ * @file grid_ref.h
+ *
+ * Terminal grid reference type for referencing a resolved position in the
+ * terminal grid.
+ */
+
+#ifndef GHOSTTY_VT_GRID_REF_H
+#define GHOSTTY_VT_GRID_REF_H
+
+#include
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup grid_ref Grid Reference
+ *
+ * A grid reference is a resolved reference to a specific cell position in the
+ * terminal's internal page structure. Obtain a grid reference from
+ * ghostty_terminal_grid_ref(), then extract the cell or row via
+ * ghostty_grid_ref_cell() and ghostty_grid_ref_row().
+ *
+ * A grid reference is only valid until the next update to the terminal
+ * instance. There is no guarantee that a grid reference will remain
+ * valid after ANY operation, even if a seemingly unrelated part of
+ * the grid is changed, so any information related to the grid reference
+ * should be read and cached immediately after obtaining the grid reference.
+ *
+ * This API is not meant to be used as the core of render loop. It isn't
+ * built to sustain the framerates needed for rendering large screens.
+ * Use the render state API for that.
+ *
+ * ## Example
+ *
+ * @snippet c-vt-grid-traverse/src/main.c grid-ref-traverse
+ *
+ * @{
+ */
+
+/**
+ * A resolved reference to a terminal cell position.
+ *
+ * This is a sized struct. Use GHOSTTY_INIT_SIZED() to initialize it.
+ *
+ * @ingroup grid_ref
+ */
+typedef struct {
+ size_t size;
+ void *node;
+ uint16_t x;
+ uint16_t y;
+} GhosttyGridRef;
+
+/**
+ * Get the cell from a grid reference.
+ *
+ * @param ref Pointer to the grid reference
+ * @param[out] out_cell On success, set to the cell at the ref's position (may be NULL)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's
+ * node is NULL
+ *
+ * @ingroup grid_ref
+ */
+GHOSTTY_API GhosttyResult ghostty_grid_ref_cell(const GhosttyGridRef *ref,
+ GhosttyCell *out_cell);
+
+/**
+ * Get the row from a grid reference.
+ *
+ * @param ref Pointer to the grid reference
+ * @param[out] out_row On success, set to the row at the ref's position (may be NULL)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's
+ * node is NULL
+ *
+ * @ingroup grid_ref
+ */
+GHOSTTY_API GhosttyResult ghostty_grid_ref_row(const GhosttyGridRef *ref,
+ GhosttyRow *out_row);
+
+/**
+ * Get the grapheme cluster codepoints for the cell at the grid reference's
+ * position.
+ *
+ * Writes the full grapheme cluster (the cell's primary codepoint followed by
+ * any combining codepoints) into the provided buffer. If the cell has no text,
+ * out_len is set to 0 and GHOSTTY_SUCCESS is returned.
+ *
+ * If the buffer is too small (or NULL), the function returns
+ * GHOSTTY_OUT_OF_SPACE and writes the required number of codepoints to
+ * out_len. The caller can then retry with a sufficiently sized buffer.
+ *
+ * @param ref Pointer to the grid reference
+ * @param buf Output buffer of uint32_t codepoints (may be NULL)
+ * @param buf_len Number of uint32_t elements in the buffer
+ * @param[out] out_len On success, the number of codepoints written. On
+ * GHOSTTY_OUT_OF_SPACE, the required buffer size in codepoints.
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's
+ * node is NULL, GHOSTTY_OUT_OF_SPACE if the buffer is too small
+ *
+ * @ingroup grid_ref
+ */
+GHOSTTY_API GhosttyResult ghostty_grid_ref_graphemes(const GhosttyGridRef *ref,
+ uint32_t *buf,
+ size_t buf_len,
+ size_t *out_len);
+
+/**
+ * Get the style of the cell at the grid reference's position.
+ *
+ * @param ref Pointer to the grid reference
+ * @param[out] out_style On success, set to the cell's style (may be NULL)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's
+ * node is NULL
+ *
+ * @ingroup grid_ref
+ */
+GHOSTTY_API GhosttyResult ghostty_grid_ref_style(const GhosttyGridRef *ref,
+ GhosttyStyle *out_style);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_GRID_REF_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/key.h b/vendor/libghostty-vt/include/ghostty/vt/key.h
new file mode 100644
index 00000000..61b95475
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/key.h
@@ -0,0 +1,73 @@
+/**
+ * @file key.h
+ *
+ * Key encoding module - encode key events into terminal escape sequences.
+ */
+
+#ifndef GHOSTTY_VT_KEY_H
+#define GHOSTTY_VT_KEY_H
+
+/** @defgroup key Key Encoding
+ *
+ * Utilities for encoding key events into terminal escape sequences,
+ * supporting both legacy encoding as well as Kitty Keyboard Protocol.
+ *
+ * ## Basic Usage
+ *
+ * 1. Create an encoder instance with ghostty_key_encoder_new()
+ * 2. Configure encoder options with ghostty_key_encoder_setopt()
+ * or ghostty_key_encoder_setopt_from_terminal() if you have a
+ * GhosttyTerminal.
+ * 3. For each key event:
+ * - Create a key event with ghostty_key_event_new()
+ * - Set event properties (action, key, modifiers, etc.)
+ * - Encode with ghostty_key_encoder_encode()
+ * - Free the event with ghostty_key_event_free()
+ * - Note: You can also reuse the same key event multiple times by
+ * changing its properties.
+ * 4. Free the encoder with ghostty_key_encoder_free() when done
+ *
+ * For a complete working example, see example/c-vt-encode-key in the
+ * repository.
+ *
+ * ## Example
+ *
+ * @snippet c-vt-encode-key/src/main.c key-encode
+ *
+ * ## Example: Encoding with Terminal State
+ *
+ * When you have a GhosttyTerminal, you can sync its modes (cursor key
+ * application, Kitty flags, etc.) into the encoder automatically:
+ *
+ * @code{.c}
+ * // Create a terminal and feed it some VT data that changes modes
+ * GhosttyTerminal terminal;
+ * ghostty_terminal_new(NULL, &terminal,
+ * (GhosttyTerminalOptions){.cols = 80, .rows = 24, .max_scrollback = 0});
+ *
+ * // Application might write data that enables Kitty keyboard protocol, etc.
+ * ghostty_terminal_vt_write(terminal, vt_data, vt_len);
+ *
+ * // Create an encoder and sync its options from the terminal
+ * GhosttyKeyEncoder encoder;
+ * ghostty_key_encoder_new(NULL, &encoder);
+ * ghostty_key_encoder_setopt_from_terminal(encoder, terminal);
+ *
+ * // Encode a key event using the terminal-derived options
+ * char buf[128];
+ * size_t written = 0;
+ * ghostty_key_encoder_encode(encoder, event, buf, sizeof(buf), &written);
+ *
+ * ghostty_key_encoder_free(encoder);
+ * ghostty_terminal_free(terminal);
+ * @endcode
+ *
+ * @{
+ */
+
+#include
+#include
+
+/** @} */
+
+#endif /* GHOSTTY_VT_KEY_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/key/encoder.h b/vendor/libghostty-vt/include/ghostty/vt/key/encoder.h
new file mode 100644
index 00000000..9d8282ce
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/key/encoder.h
@@ -0,0 +1,245 @@
+/**
+ * @file encoder.h
+ *
+ * Key event encoding to terminal escape sequences.
+ */
+
+#ifndef GHOSTTY_VT_KEY_ENCODER_H
+#define GHOSTTY_VT_KEY_ENCODER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * Opaque handle to a key encoder instance.
+ *
+ * This handle represents a key encoder that converts key events into terminal
+ * escape sequences.
+ *
+ * @ingroup key
+ */
+typedef struct GhosttyKeyEncoderImpl *GhosttyKeyEncoder;
+
+/**
+ * Kitty keyboard protocol flags.
+ *
+ * Bitflags representing the various modes of the Kitty keyboard protocol.
+ * These can be combined using bitwise OR operations. Valid values all
+ * start with `GHOSTTY_KITTY_KEY_`.
+ *
+ * @ingroup key
+ */
+typedef uint8_t GhosttyKittyKeyFlags;
+
+/** Kitty keyboard protocol disabled (all flags off) */
+#define GHOSTTY_KITTY_KEY_DISABLED 0
+
+/** Disambiguate escape codes */
+#define GHOSTTY_KITTY_KEY_DISAMBIGUATE (1 << 0)
+
+/** Report key press and release events */
+#define GHOSTTY_KITTY_KEY_REPORT_EVENTS (1 << 1)
+
+/** Report alternate key codes */
+#define GHOSTTY_KITTY_KEY_REPORT_ALTERNATES (1 << 2)
+
+/** Report all key events including those normally handled by the terminal */
+#define GHOSTTY_KITTY_KEY_REPORT_ALL (1 << 3)
+
+/** Report associated text with key events */
+#define GHOSTTY_KITTY_KEY_REPORT_ASSOCIATED (1 << 4)
+
+/** All Kitty keyboard protocol flags enabled */
+#define GHOSTTY_KITTY_KEY_ALL (GHOSTTY_KITTY_KEY_DISAMBIGUATE | GHOSTTY_KITTY_KEY_REPORT_EVENTS | GHOSTTY_KITTY_KEY_REPORT_ALTERNATES | GHOSTTY_KITTY_KEY_REPORT_ALL | GHOSTTY_KITTY_KEY_REPORT_ASSOCIATED)
+
+/**
+ * macOS option key behavior.
+ *
+ * Determines whether the "option" key on macOS is treated as "alt" or not.
+ * See the Ghostty `macos-option-as-alt` configuration option for more details.
+ *
+ * @ingroup key
+ */
+typedef enum {
+ /** Option key is not treated as alt */
+ GHOSTTY_OPTION_AS_ALT_FALSE = 0,
+ /** Option key is treated as alt */
+ GHOSTTY_OPTION_AS_ALT_TRUE = 1,
+ /** Only left option key is treated as alt */
+ GHOSTTY_OPTION_AS_ALT_LEFT = 2,
+ /** Only right option key is treated as alt */
+ GHOSTTY_OPTION_AS_ALT_RIGHT = 3,
+} GhosttyOptionAsAlt;
+
+/**
+ * Key encoder option identifiers.
+ *
+ * These values are used with ghostty_key_encoder_setopt() to configure
+ * the behavior of the key encoder.
+ *
+ * @ingroup key
+ */
+typedef enum {
+ /** Terminal DEC mode 1: cursor key application mode (value: bool) */
+ GHOSTTY_KEY_ENCODER_OPT_CURSOR_KEY_APPLICATION = 0,
+
+ /** Terminal DEC mode 66: keypad key application mode (value: bool) */
+ GHOSTTY_KEY_ENCODER_OPT_KEYPAD_KEY_APPLICATION = 1,
+
+ /** Terminal DEC mode 1035: ignore keypad with numlock (value: bool) */
+ GHOSTTY_KEY_ENCODER_OPT_IGNORE_KEYPAD_WITH_NUMLOCK = 2,
+
+ /** Terminal DEC mode 1036: alt sends escape prefix (value: bool) */
+ GHOSTTY_KEY_ENCODER_OPT_ALT_ESC_PREFIX = 3,
+
+ /** xterm modifyOtherKeys mode 2 (value: bool) */
+ GHOSTTY_KEY_ENCODER_OPT_MODIFY_OTHER_KEYS_STATE_2 = 4,
+
+ /** Kitty keyboard protocol flags (value: GhosttyKittyKeyFlags bitmask) */
+ GHOSTTY_KEY_ENCODER_OPT_KITTY_FLAGS = 5,
+
+ /** macOS option-as-alt setting (value: GhosttyOptionAsAlt) */
+ GHOSTTY_KEY_ENCODER_OPT_MACOS_OPTION_AS_ALT = 6,
+} GhosttyKeyEncoderOption;
+
+/**
+ * Create a new key encoder instance.
+ *
+ * Creates a new key encoder with default options. The encoder can be configured
+ * using ghostty_key_encoder_setopt() and must be freed using
+ * ghostty_key_encoder_free() when no longer needed.
+ *
+ * @param allocator Pointer to the allocator to use for memory management, or NULL to use the default allocator
+ * @param encoder Pointer to store the created encoder handle
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup key
+ */
+GHOSTTY_API GhosttyResult ghostty_key_encoder_new(const GhosttyAllocator *allocator, GhosttyKeyEncoder *encoder);
+
+/**
+ * Free a key encoder instance.
+ *
+ * Releases all resources associated with the key encoder. After this call,
+ * the encoder handle becomes invalid and must not be used.
+ *
+ * @param encoder The encoder handle to free (may be NULL)
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_encoder_free(GhosttyKeyEncoder encoder);
+
+/**
+ * Set an option on the key encoder.
+ *
+ * Configures the behavior of the key encoder. Options control various aspects
+ * of encoding such as terminal modes (cursor key application mode, keypad mode),
+ * protocol selection (Kitty keyboard protocol flags), and platform-specific
+ * behaviors (macOS option-as-alt).
+ *
+ * If you are using a terminal instance, you can set the key encoding
+ * options based on the active terminal state (e.g. legacy vs Kitty mode
+ * and associated flags) with ghostty_key_encoder_setopt_from_terminal().
+ *
+ * A null pointer value does nothing. It does not reset the value to the
+ * default. The setopt call will do nothing.
+ *
+ * @param encoder The encoder handle, must not be NULL
+ * @param option The option to set
+ * @param value Pointer to the value to set (type depends on the option)
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_encoder_setopt(GhosttyKeyEncoder encoder, GhosttyKeyEncoderOption option, const void *value);
+
+/**
+ * Set encoder options from a terminal's current state.
+ *
+ * Reads the terminal's current modes and flags and applies them to the
+ * encoder's options. This sets cursor key application mode, keypad mode,
+ * alt escape prefix, modifyOtherKeys state, and Kitty keyboard protocol
+ * flags from the terminal state.
+ *
+ * Note that the `macos_option_as_alt` option cannot be determined from
+ * terminal state and is reset to `GHOSTTY_OPTION_AS_ALT_FALSE` by this
+ * call. Use ghostty_key_encoder_setopt() to set it afterward if needed.
+ *
+ * @param encoder The encoder handle, must not be NULL
+ * @param terminal The terminal handle, must not be NULL
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_encoder_setopt_from_terminal(GhosttyKeyEncoder encoder, GhosttyTerminal terminal);
+
+/**
+ * Encode a key event into a terminal escape sequence.
+ *
+ * Converts a key event into the appropriate terminal escape sequence based on
+ * the encoder's current options. The sequence is written to the provided buffer.
+ *
+ * Not all key events produce output. For example, unmodified modifier keys
+ * typically don't generate escape sequences. Check the out_len parameter to
+ * determine if any data was written.
+ *
+ * If the output buffer is too small, this function returns GHOSTTY_OUT_OF_SPACE
+ * and out_len will contain the required buffer size. The caller can then
+ * allocate a larger buffer and call the function again.
+ *
+ * @param encoder The encoder handle, must not be NULL
+ * @param event The key event to encode, must not be NULL
+ * @param out_buf Buffer to write the encoded sequence to
+ * @param out_buf_size Size of the output buffer in bytes
+ * @param out_len Pointer to store the number of bytes written (may be NULL)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if buffer too small, or other error code
+ *
+ * ## Example: Calculate required buffer size
+ *
+ * @code{.c}
+ * // Query the required size with a NULL buffer (always returns OUT_OF_SPACE)
+ * size_t required = 0;
+ * GhosttyResult result = ghostty_key_encoder_encode(encoder, event, NULL, 0, &required);
+ * assert(result == GHOSTTY_OUT_OF_SPACE);
+ *
+ * // Allocate buffer of required size
+ * char *buf = malloc(required);
+ *
+ * // Encode with properly sized buffer
+ * size_t written = 0;
+ * result = ghostty_key_encoder_encode(encoder, event, buf, required, &written);
+ * assert(result == GHOSTTY_SUCCESS);
+ *
+ * // Use the encoded sequence...
+ *
+ * free(buf);
+ * @endcode
+ *
+ * ## Example: Direct encoding with static buffer
+ *
+ * @code{.c}
+ * // Most escape sequences are short, so a static buffer often suffices
+ * char buf[128];
+ * size_t written = 0;
+ * GhosttyResult result = ghostty_key_encoder_encode(encoder, event, buf, sizeof(buf), &written);
+ *
+ * if (result == GHOSTTY_SUCCESS) {
+ * // Write the encoded sequence to the terminal
+ * write(pty_fd, buf, written);
+ * } else if (result == GHOSTTY_OUT_OF_SPACE) {
+ * // Buffer too small, written contains required size
+ * char *dynamic_buf = malloc(written);
+ * result = ghostty_key_encoder_encode(encoder, event, dynamic_buf, written, &written);
+ * assert(result == GHOSTTY_SUCCESS);
+ * write(pty_fd, dynamic_buf, written);
+ * free(dynamic_buf);
+ * }
+ * @endcode
+ *
+ * @ingroup key
+ */
+GHOSTTY_API GhosttyResult ghostty_key_encoder_encode(GhosttyKeyEncoder encoder, GhosttyKeyEvent event, char *out_buf, size_t out_buf_size, size_t *out_len);
+
+#endif /* GHOSTTY_VT_KEY_ENCODER_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/key/event.h b/vendor/libghostty-vt/include/ghostty/vt/key/event.h
new file mode 100644
index 00000000..bcc9d8de
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/key/event.h
@@ -0,0 +1,480 @@
+/**
+ * @file event.h
+ *
+ * Key event representation and manipulation.
+ */
+
+#ifndef GHOSTTY_VT_KEY_EVENT_H
+#define GHOSTTY_VT_KEY_EVENT_H
+
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * Opaque handle to a key event.
+ *
+ * This handle represents a keyboard input event containing information about
+ * the physical key pressed, modifiers, and generated text.
+ *
+ * @ingroup key
+ */
+typedef struct GhosttyKeyEventImpl *GhosttyKeyEvent;
+
+/**
+ * Keyboard input event types.
+ *
+ * @ingroup key
+ */
+typedef enum {
+ /** Key was released */
+ GHOSTTY_KEY_ACTION_RELEASE = 0,
+ /** Key was pressed */
+ GHOSTTY_KEY_ACTION_PRESS = 1,
+ /** Key is being repeated (held down) */
+ GHOSTTY_KEY_ACTION_REPEAT = 2,
+} GhosttyKeyAction;
+
+/**
+ * Keyboard modifier keys bitmask.
+ *
+ * A bitmask representing all keyboard modifiers. This tracks which modifier keys
+ * are pressed and, where supported by the platform, which side (left or right)
+ * of each modifier is active.
+ *
+ * Use the GHOSTTY_MODS_* constants to test and set individual modifiers.
+ *
+ * Modifier side bits are only meaningful when the corresponding modifier bit is set.
+ * Not all platforms support distinguishing between left and right modifier
+ * keys and Ghostty is built to expect that some platforms may not provide this
+ * information.
+ *
+ * @ingroup key
+ */
+typedef uint16_t GhosttyMods;
+
+/** Shift key is pressed */
+#define GHOSTTY_MODS_SHIFT (1 << 0)
+/** Control key is pressed */
+#define GHOSTTY_MODS_CTRL (1 << 1)
+/** Alt/Option key is pressed */
+#define GHOSTTY_MODS_ALT (1 << 2)
+/** Super/Command/Windows key is pressed */
+#define GHOSTTY_MODS_SUPER (1 << 3)
+/** Caps Lock is active */
+#define GHOSTTY_MODS_CAPS_LOCK (1 << 4)
+/** Num Lock is active */
+#define GHOSTTY_MODS_NUM_LOCK (1 << 5)
+
+/**
+ * Right shift is pressed (0 = left, 1 = right).
+ * Only meaningful when GHOSTTY_MODS_SHIFT is set.
+ */
+#define GHOSTTY_MODS_SHIFT_SIDE (1 << 6)
+/**
+ * Right ctrl is pressed (0 = left, 1 = right).
+ * Only meaningful when GHOSTTY_MODS_CTRL is set.
+ */
+#define GHOSTTY_MODS_CTRL_SIDE (1 << 7)
+/**
+ * Right alt is pressed (0 = left, 1 = right).
+ * Only meaningful when GHOSTTY_MODS_ALT is set.
+ */
+#define GHOSTTY_MODS_ALT_SIDE (1 << 8)
+/**
+ * Right super is pressed (0 = left, 1 = right).
+ * Only meaningful when GHOSTTY_MODS_SUPER is set.
+ */
+#define GHOSTTY_MODS_SUPER_SIDE (1 << 9)
+
+/**
+ * Physical key codes.
+ *
+ * The set of key codes that Ghostty is aware of. These represent physical keys
+ * on the keyboard and are layout-independent. For example, the "a" key on a US
+ * keyboard is the same as the "ф" key on a Russian keyboard, but both will
+ * report the same key_a value.
+ *
+ * Layout-dependent strings are provided separately as UTF-8 text and are produced
+ * by the platform. These values are based on the W3C UI Events KeyboardEvent code
+ * standard. See: https://www.w3.org/TR/uievents-code
+ *
+ * @ingroup key
+ */
+typedef enum {
+ GHOSTTY_KEY_UNIDENTIFIED = 0,
+
+ // Writing System Keys (W3C § 3.1.1)
+ GHOSTTY_KEY_BACKQUOTE,
+ GHOSTTY_KEY_BACKSLASH,
+ GHOSTTY_KEY_BRACKET_LEFT,
+ GHOSTTY_KEY_BRACKET_RIGHT,
+ GHOSTTY_KEY_COMMA,
+ GHOSTTY_KEY_DIGIT_0,
+ GHOSTTY_KEY_DIGIT_1,
+ GHOSTTY_KEY_DIGIT_2,
+ GHOSTTY_KEY_DIGIT_3,
+ GHOSTTY_KEY_DIGIT_4,
+ GHOSTTY_KEY_DIGIT_5,
+ GHOSTTY_KEY_DIGIT_6,
+ GHOSTTY_KEY_DIGIT_7,
+ GHOSTTY_KEY_DIGIT_8,
+ GHOSTTY_KEY_DIGIT_9,
+ GHOSTTY_KEY_EQUAL,
+ GHOSTTY_KEY_INTL_BACKSLASH,
+ GHOSTTY_KEY_INTL_RO,
+ GHOSTTY_KEY_INTL_YEN,
+ GHOSTTY_KEY_A,
+ GHOSTTY_KEY_B,
+ GHOSTTY_KEY_C,
+ GHOSTTY_KEY_D,
+ GHOSTTY_KEY_E,
+ GHOSTTY_KEY_F,
+ GHOSTTY_KEY_G,
+ GHOSTTY_KEY_H,
+ GHOSTTY_KEY_I,
+ GHOSTTY_KEY_J,
+ GHOSTTY_KEY_K,
+ GHOSTTY_KEY_L,
+ GHOSTTY_KEY_M,
+ GHOSTTY_KEY_N,
+ GHOSTTY_KEY_O,
+ GHOSTTY_KEY_P,
+ GHOSTTY_KEY_Q,
+ GHOSTTY_KEY_R,
+ GHOSTTY_KEY_S,
+ GHOSTTY_KEY_T,
+ GHOSTTY_KEY_U,
+ GHOSTTY_KEY_V,
+ GHOSTTY_KEY_W,
+ GHOSTTY_KEY_X,
+ GHOSTTY_KEY_Y,
+ GHOSTTY_KEY_Z,
+ GHOSTTY_KEY_MINUS,
+ GHOSTTY_KEY_PERIOD,
+ GHOSTTY_KEY_QUOTE,
+ GHOSTTY_KEY_SEMICOLON,
+ GHOSTTY_KEY_SLASH,
+
+ // Functional Keys (W3C § 3.1.2)
+ GHOSTTY_KEY_ALT_LEFT,
+ GHOSTTY_KEY_ALT_RIGHT,
+ GHOSTTY_KEY_BACKSPACE,
+ GHOSTTY_KEY_CAPS_LOCK,
+ GHOSTTY_KEY_CONTEXT_MENU,
+ GHOSTTY_KEY_CONTROL_LEFT,
+ GHOSTTY_KEY_CONTROL_RIGHT,
+ GHOSTTY_KEY_ENTER,
+ GHOSTTY_KEY_META_LEFT,
+ GHOSTTY_KEY_META_RIGHT,
+ GHOSTTY_KEY_SHIFT_LEFT,
+ GHOSTTY_KEY_SHIFT_RIGHT,
+ GHOSTTY_KEY_SPACE,
+ GHOSTTY_KEY_TAB,
+ GHOSTTY_KEY_CONVERT,
+ GHOSTTY_KEY_KANA_MODE,
+ GHOSTTY_KEY_NON_CONVERT,
+
+ // Control Pad Section (W3C § 3.2)
+ GHOSTTY_KEY_DELETE,
+ GHOSTTY_KEY_END,
+ GHOSTTY_KEY_HELP,
+ GHOSTTY_KEY_HOME,
+ GHOSTTY_KEY_INSERT,
+ GHOSTTY_KEY_PAGE_DOWN,
+ GHOSTTY_KEY_PAGE_UP,
+
+ // Arrow Pad Section (W3C § 3.3)
+ GHOSTTY_KEY_ARROW_DOWN,
+ GHOSTTY_KEY_ARROW_LEFT,
+ GHOSTTY_KEY_ARROW_RIGHT,
+ GHOSTTY_KEY_ARROW_UP,
+
+ // Numpad Section (W3C § 3.4)
+ GHOSTTY_KEY_NUM_LOCK,
+ GHOSTTY_KEY_NUMPAD_0,
+ GHOSTTY_KEY_NUMPAD_1,
+ GHOSTTY_KEY_NUMPAD_2,
+ GHOSTTY_KEY_NUMPAD_3,
+ GHOSTTY_KEY_NUMPAD_4,
+ GHOSTTY_KEY_NUMPAD_5,
+ GHOSTTY_KEY_NUMPAD_6,
+ GHOSTTY_KEY_NUMPAD_7,
+ GHOSTTY_KEY_NUMPAD_8,
+ GHOSTTY_KEY_NUMPAD_9,
+ GHOSTTY_KEY_NUMPAD_ADD,
+ GHOSTTY_KEY_NUMPAD_BACKSPACE,
+ GHOSTTY_KEY_NUMPAD_CLEAR,
+ GHOSTTY_KEY_NUMPAD_CLEAR_ENTRY,
+ GHOSTTY_KEY_NUMPAD_COMMA,
+ GHOSTTY_KEY_NUMPAD_DECIMAL,
+ GHOSTTY_KEY_NUMPAD_DIVIDE,
+ GHOSTTY_KEY_NUMPAD_ENTER,
+ GHOSTTY_KEY_NUMPAD_EQUAL,
+ GHOSTTY_KEY_NUMPAD_MEMORY_ADD,
+ GHOSTTY_KEY_NUMPAD_MEMORY_CLEAR,
+ GHOSTTY_KEY_NUMPAD_MEMORY_RECALL,
+ GHOSTTY_KEY_NUMPAD_MEMORY_STORE,
+ GHOSTTY_KEY_NUMPAD_MEMORY_SUBTRACT,
+ GHOSTTY_KEY_NUMPAD_MULTIPLY,
+ GHOSTTY_KEY_NUMPAD_PAREN_LEFT,
+ GHOSTTY_KEY_NUMPAD_PAREN_RIGHT,
+ GHOSTTY_KEY_NUMPAD_SUBTRACT,
+ GHOSTTY_KEY_NUMPAD_SEPARATOR,
+ GHOSTTY_KEY_NUMPAD_UP,
+ GHOSTTY_KEY_NUMPAD_DOWN,
+ GHOSTTY_KEY_NUMPAD_RIGHT,
+ GHOSTTY_KEY_NUMPAD_LEFT,
+ GHOSTTY_KEY_NUMPAD_BEGIN,
+ GHOSTTY_KEY_NUMPAD_HOME,
+ GHOSTTY_KEY_NUMPAD_END,
+ GHOSTTY_KEY_NUMPAD_INSERT,
+ GHOSTTY_KEY_NUMPAD_DELETE,
+ GHOSTTY_KEY_NUMPAD_PAGE_UP,
+ GHOSTTY_KEY_NUMPAD_PAGE_DOWN,
+
+ // Function Section (W3C § 3.5)
+ GHOSTTY_KEY_ESCAPE,
+ GHOSTTY_KEY_F1,
+ GHOSTTY_KEY_F2,
+ GHOSTTY_KEY_F3,
+ GHOSTTY_KEY_F4,
+ GHOSTTY_KEY_F5,
+ GHOSTTY_KEY_F6,
+ GHOSTTY_KEY_F7,
+ GHOSTTY_KEY_F8,
+ GHOSTTY_KEY_F9,
+ GHOSTTY_KEY_F10,
+ GHOSTTY_KEY_F11,
+ GHOSTTY_KEY_F12,
+ GHOSTTY_KEY_F13,
+ GHOSTTY_KEY_F14,
+ GHOSTTY_KEY_F15,
+ GHOSTTY_KEY_F16,
+ GHOSTTY_KEY_F17,
+ GHOSTTY_KEY_F18,
+ GHOSTTY_KEY_F19,
+ GHOSTTY_KEY_F20,
+ GHOSTTY_KEY_F21,
+ GHOSTTY_KEY_F22,
+ GHOSTTY_KEY_F23,
+ GHOSTTY_KEY_F24,
+ GHOSTTY_KEY_F25,
+ GHOSTTY_KEY_FN,
+ GHOSTTY_KEY_FN_LOCK,
+ GHOSTTY_KEY_PRINT_SCREEN,
+ GHOSTTY_KEY_SCROLL_LOCK,
+ GHOSTTY_KEY_PAUSE,
+
+ // Media Keys (W3C § 3.6)
+ GHOSTTY_KEY_BROWSER_BACK,
+ GHOSTTY_KEY_BROWSER_FAVORITES,
+ GHOSTTY_KEY_BROWSER_FORWARD,
+ GHOSTTY_KEY_BROWSER_HOME,
+ GHOSTTY_KEY_BROWSER_REFRESH,
+ GHOSTTY_KEY_BROWSER_SEARCH,
+ GHOSTTY_KEY_BROWSER_STOP,
+ GHOSTTY_KEY_EJECT,
+ GHOSTTY_KEY_LAUNCH_APP_1,
+ GHOSTTY_KEY_LAUNCH_APP_2,
+ GHOSTTY_KEY_LAUNCH_MAIL,
+ GHOSTTY_KEY_MEDIA_PLAY_PAUSE,
+ GHOSTTY_KEY_MEDIA_SELECT,
+ GHOSTTY_KEY_MEDIA_STOP,
+ GHOSTTY_KEY_MEDIA_TRACK_NEXT,
+ GHOSTTY_KEY_MEDIA_TRACK_PREVIOUS,
+ GHOSTTY_KEY_POWER,
+ GHOSTTY_KEY_SLEEP,
+ GHOSTTY_KEY_AUDIO_VOLUME_DOWN,
+ GHOSTTY_KEY_AUDIO_VOLUME_MUTE,
+ GHOSTTY_KEY_AUDIO_VOLUME_UP,
+ GHOSTTY_KEY_WAKE_UP,
+
+ // Legacy, Non-standard, and Special Keys (W3C § 3.7)
+ GHOSTTY_KEY_COPY,
+ GHOSTTY_KEY_CUT,
+ GHOSTTY_KEY_PASTE,
+} GhosttyKey;
+
+/**
+ * Create a new key event instance.
+ *
+ * Creates a new key event with default values. The event must be freed using
+ * ghostty_key_event_free() when no longer needed.
+ *
+ * @param allocator Pointer to the allocator to use for memory management, or NULL to use the default allocator
+ * @param event Pointer to store the created key event handle
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup key
+ */
+GHOSTTY_API GhosttyResult ghostty_key_event_new(const GhosttyAllocator *allocator, GhosttyKeyEvent *event);
+
+/**
+ * Free a key event instance.
+ *
+ * Releases all resources associated with the key event. After this call,
+ * the event handle becomes invalid and must not be used.
+ *
+ * @param event The key event handle to free (may be NULL)
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_free(GhosttyKeyEvent event);
+
+/**
+ * Set the key action (press, release, repeat).
+ *
+ * @param event The key event handle, must not be NULL
+ * @param action The action to set
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_set_action(GhosttyKeyEvent event, GhosttyKeyAction action);
+
+/**
+ * Get the key action (press, release, repeat).
+ *
+ * @param event The key event handle, must not be NULL
+ * @return The key action
+ *
+ * @ingroup key
+ */
+GHOSTTY_API GhosttyKeyAction ghostty_key_event_get_action(GhosttyKeyEvent event);
+
+/**
+ * Set the physical key code.
+ *
+ * @param event The key event handle, must not be NULL
+ * @param key The physical key code to set
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_set_key(GhosttyKeyEvent event, GhosttyKey key);
+
+/**
+ * Get the physical key code.
+ *
+ * @param event The key event handle, must not be NULL
+ * @return The physical key code
+ *
+ * @ingroup key
+ */
+GHOSTTY_API GhosttyKey ghostty_key_event_get_key(GhosttyKeyEvent event);
+
+/**
+ * Set the modifier keys bitmask.
+ *
+ * @param event The key event handle, must not be NULL
+ * @param mods The modifier keys bitmask to set
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_set_mods(GhosttyKeyEvent event, GhosttyMods mods);
+
+/**
+ * Get the modifier keys bitmask.
+ *
+ * @param event The key event handle, must not be NULL
+ * @return The modifier keys bitmask
+ *
+ * @ingroup key
+ */
+GHOSTTY_API GhosttyMods ghostty_key_event_get_mods(GhosttyKeyEvent event);
+
+/**
+ * Set the consumed modifiers bitmask.
+ *
+ * @param event The key event handle, must not be NULL
+ * @param consumed_mods The consumed modifiers bitmask to set
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_set_consumed_mods(GhosttyKeyEvent event, GhosttyMods consumed_mods);
+
+/**
+ * Get the consumed modifiers bitmask.
+ *
+ * @param event The key event handle, must not be NULL
+ * @return The consumed modifiers bitmask
+ *
+ * @ingroup key
+ */
+GHOSTTY_API GhosttyMods ghostty_key_event_get_consumed_mods(GhosttyKeyEvent event);
+
+/**
+ * Set whether the key event is part of a composition sequence.
+ *
+ * @param event The key event handle, must not be NULL
+ * @param composing Whether the key event is part of a composition sequence
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_set_composing(GhosttyKeyEvent event, bool composing);
+
+/**
+ * Get whether the key event is part of a composition sequence.
+ *
+ * @param event The key event handle, must not be NULL
+ * @return Whether the key event is part of a composition sequence
+ *
+ * @ingroup key
+ */
+GHOSTTY_API bool ghostty_key_event_get_composing(GhosttyKeyEvent event);
+
+/**
+ * Set the UTF-8 text generated by the key for the current keyboard layout.
+ *
+ * Must contain the unmodified character before any Ctrl/Meta transformations.
+ * The encoder derives modifier sequences from the logical key and mods
+ * bitmask, not from this text. Do not pass C0 control characters
+ * (U+0000-U+001F, U+007F) or platform function key codes (e.g. macOS PUA
+ * U+F700-U+F8FF); pass NULL instead and let the encoder use the logical key.
+ *
+ * The key event does NOT take ownership of the text pointer. The caller
+ * must ensure the string remains valid for the lifetime needed by the event.
+ *
+ * @param event The key event handle, must not be NULL
+ * @param utf8 The UTF-8 text to set (or NULL for empty)
+ * @param len Length of the UTF-8 text in bytes
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_set_utf8(GhosttyKeyEvent event, const char *utf8, size_t len);
+
+/**
+ * Get the UTF-8 text generated by the key event.
+ *
+ * The returned pointer is valid until the event is freed or the UTF-8 text is modified.
+ *
+ * @param event The key event handle, must not be NULL
+ * @param len Pointer to store the length of the UTF-8 text in bytes (may be NULL)
+ * @return The UTF-8 text (or NULL for empty)
+ *
+ * @ingroup key
+ */
+GHOSTTY_API const char *ghostty_key_event_get_utf8(GhosttyKeyEvent event, size_t *len);
+
+/**
+ * Set the unshifted Unicode codepoint.
+ *
+ * @param event The key event handle, must not be NULL
+ * @param codepoint The unshifted Unicode codepoint to set
+ *
+ * @ingroup key
+ */
+GHOSTTY_API void ghostty_key_event_set_unshifted_codepoint(GhosttyKeyEvent event, uint32_t codepoint);
+
+/**
+ * Get the unshifted Unicode codepoint.
+ *
+ * @param event The key event handle, must not be NULL
+ * @return The unshifted Unicode codepoint
+ *
+ * @ingroup key
+ */
+GHOSTTY_API uint32_t ghostty_key_event_get_unshifted_codepoint(GhosttyKeyEvent event);
+
+#endif /* GHOSTTY_VT_KEY_EVENT_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/modes.h b/vendor/libghostty-vt/include/ghostty/vt/modes.h
new file mode 100644
index 00000000..513aaf5a
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/modes.h
@@ -0,0 +1,196 @@
+/**
+ * @file modes.h
+ *
+ * Terminal mode utilities - pack and unpack ANSI/DEC mode identifiers.
+ */
+
+#ifndef GHOSTTY_VT_MODES_H
+#define GHOSTTY_VT_MODES_H
+
+/** @defgroup modes Mode Utilities
+ *
+ * Utilities for working with terminal modes. A mode is a compact
+ * 16-bit representation of a terminal mode identifier that encodes both
+ * the numeric mode value (up to 15 bits) and whether the mode is an ANSI
+ * mode or a DEC private mode (?-prefixed).
+ *
+ * The packed layout (least-significant bit first) is:
+ * - Bits 0–14: mode value (u15)
+ * - Bit 15: ANSI flag (0 = DEC private mode, 1 = ANSI mode)
+ *
+ * ## Example
+ *
+ * @snippet c-vt-modes/src/main.c modes-pack-unpack
+ *
+ * ## DECRPM Report Encoding
+ *
+ * Use ghostty_mode_report_encode() to encode a DECRPM response into a
+ * caller-provided buffer:
+ *
+ * @snippet c-vt-modes/src/main.c modes-decrpm
+ *
+ * @{
+ */
+
+#include
+#include
+#include
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name ANSI Modes
+ * Modes for standard ANSI modes.
+ * @{
+ */
+#define GHOSTTY_MODE_KAM (ghostty_mode_new(2, true)) /**< Keyboard action (disable keyboard) */
+#define GHOSTTY_MODE_INSERT (ghostty_mode_new(4, true)) /**< Insert mode */
+#define GHOSTTY_MODE_SRM (ghostty_mode_new(12, true)) /**< Send/receive mode */
+#define GHOSTTY_MODE_LINEFEED (ghostty_mode_new(20, true)) /**< Linefeed/new line mode */
+/** @} */
+
+/** @name DEC Private Modes
+ * Modes for DEC private modes (?-prefixed).
+ * @{
+ */
+#define GHOSTTY_MODE_DECCKM (ghostty_mode_new(1, false)) /**< Cursor keys */
+#define GHOSTTY_MODE_132_COLUMN (ghostty_mode_new(3, false)) /**< 132/80 column mode */
+#define GHOSTTY_MODE_SLOW_SCROLL (ghostty_mode_new(4, false)) /**< Slow scroll */
+#define GHOSTTY_MODE_REVERSE_COLORS (ghostty_mode_new(5, false)) /**< Reverse video */
+#define GHOSTTY_MODE_ORIGIN (ghostty_mode_new(6, false)) /**< Origin mode */
+#define GHOSTTY_MODE_WRAPAROUND (ghostty_mode_new(7, false)) /**< Auto-wrap mode */
+#define GHOSTTY_MODE_AUTOREPEAT (ghostty_mode_new(8, false)) /**< Auto-repeat keys */
+#define GHOSTTY_MODE_X10_MOUSE (ghostty_mode_new(9, false)) /**< X10 mouse reporting */
+#define GHOSTTY_MODE_CURSOR_BLINKING (ghostty_mode_new(12, false)) /**< Cursor blink */
+#define GHOSTTY_MODE_CURSOR_VISIBLE (ghostty_mode_new(25, false)) /**< Cursor visible (DECTCEM) */
+#define GHOSTTY_MODE_ENABLE_MODE_3 (ghostty_mode_new(40, false)) /**< Allow 132 column mode */
+#define GHOSTTY_MODE_REVERSE_WRAP (ghostty_mode_new(45, false)) /**< Reverse wrap */
+#define GHOSTTY_MODE_ALT_SCREEN_LEGACY (ghostty_mode_new(47, false)) /**< Alternate screen (legacy) */
+#define GHOSTTY_MODE_KEYPAD_KEYS (ghostty_mode_new(66, false)) /**< Application keypad */
+#define GHOSTTY_MODE_LEFT_RIGHT_MARGIN (ghostty_mode_new(69, false)) /**< Left/right margin mode */
+#define GHOSTTY_MODE_NORMAL_MOUSE (ghostty_mode_new(1000, false)) /**< Normal mouse tracking */
+#define GHOSTTY_MODE_BUTTON_MOUSE (ghostty_mode_new(1002, false)) /**< Button-event mouse tracking */
+#define GHOSTTY_MODE_ANY_MOUSE (ghostty_mode_new(1003, false)) /**< Any-event mouse tracking */
+#define GHOSTTY_MODE_FOCUS_EVENT (ghostty_mode_new(1004, false)) /**< Focus in/out events */
+#define GHOSTTY_MODE_UTF8_MOUSE (ghostty_mode_new(1005, false)) /**< UTF-8 mouse format */
+#define GHOSTTY_MODE_SGR_MOUSE (ghostty_mode_new(1006, false)) /**< SGR mouse format */
+#define GHOSTTY_MODE_ALT_SCROLL (ghostty_mode_new(1007, false)) /**< Alternate scroll mode */
+#define GHOSTTY_MODE_URXVT_MOUSE (ghostty_mode_new(1015, false)) /**< URxvt mouse format */
+#define GHOSTTY_MODE_SGR_PIXELS_MOUSE (ghostty_mode_new(1016, false)) /**< SGR-Pixels mouse format */
+#define GHOSTTY_MODE_NUMLOCK_KEYPAD (ghostty_mode_new(1035, false)) /**< Ignore keypad with NumLock */
+#define GHOSTTY_MODE_ALT_ESC_PREFIX (ghostty_mode_new(1036, false)) /**< Alt key sends ESC prefix */
+#define GHOSTTY_MODE_ALT_SENDS_ESC (ghostty_mode_new(1039, false)) /**< Alt sends escape */
+#define GHOSTTY_MODE_REVERSE_WRAP_EXT (ghostty_mode_new(1045, false)) /**< Extended reverse wrap */
+#define GHOSTTY_MODE_ALT_SCREEN (ghostty_mode_new(1047, false)) /**< Alternate screen */
+#define GHOSTTY_MODE_SAVE_CURSOR (ghostty_mode_new(1048, false)) /**< Save cursor (DECSC) */
+#define GHOSTTY_MODE_ALT_SCREEN_SAVE (ghostty_mode_new(1049, false)) /**< Alt screen + save cursor + clear */
+#define GHOSTTY_MODE_BRACKETED_PASTE (ghostty_mode_new(2004, false)) /**< Bracketed paste mode */
+#define GHOSTTY_MODE_SYNC_OUTPUT (ghostty_mode_new(2026, false)) /**< Synchronized output */
+#define GHOSTTY_MODE_GRAPHEME_CLUSTER (ghostty_mode_new(2027, false)) /**< Grapheme cluster mode */
+#define GHOSTTY_MODE_COLOR_SCHEME_REPORT (ghostty_mode_new(2031, false)) /**< Report color scheme */
+#define GHOSTTY_MODE_IN_BAND_RESIZE (ghostty_mode_new(2048, false)) /**< In-band size reports */
+/** @} */
+
+/**
+ * A packed 16-bit terminal mode.
+ *
+ * Encodes a mode value (bits 0–14) and an ANSI flag (bit 15) into a
+ * single 16-bit integer. Use the inline helper functions to construct
+ * and inspect modes rather than manipulating bits directly.
+ */
+typedef uint16_t GhosttyMode;
+
+/**
+ * Create a mode from a mode value and ANSI flag.
+ *
+ * @param value The numeric mode value (0–32767)
+ * @param ansi true for an ANSI mode, false for a DEC private mode
+ * @return The packed mode
+ *
+ * @ingroup modes
+ */
+static inline GhosttyMode ghostty_mode_new(uint16_t value, bool ansi) {
+ return (GhosttyMode)((value & 0x7FFF) | ((uint16_t)ansi << 15));
+}
+
+/**
+ * Extract the numeric mode value from a mode.
+ *
+ * @param mode The mode
+ * @return The mode value (0–32767)
+ *
+ * @ingroup modes
+ */
+static inline uint16_t ghostty_mode_value(GhosttyMode mode) {
+ return mode & 0x7FFF;
+}
+
+/**
+ * Check whether a mode represents an ANSI mode.
+ *
+ * @param mode The mode
+ * @return true if this is an ANSI mode, false if it is a DEC private mode
+ *
+ * @ingroup modes
+ */
+static inline bool ghostty_mode_ansi(GhosttyMode mode) {
+ return (mode >> 15) != 0;
+}
+
+/**
+ * DECRPM report state values.
+ *
+ * These correspond to the Ps2 parameter in a DECRPM response
+ * sequence (CSI ? Ps1 ; Ps2 $ y).
+ */
+typedef enum {
+ /** Mode is not recognized */
+ GHOSTTY_MODE_REPORT_NOT_RECOGNIZED = 0,
+ /** Mode is set (enabled) */
+ GHOSTTY_MODE_REPORT_SET = 1,
+ /** Mode is reset (disabled) */
+ GHOSTTY_MODE_REPORT_RESET = 2,
+ /** Mode is permanently set */
+ GHOSTTY_MODE_REPORT_PERMANENTLY_SET = 3,
+ /** Mode is permanently reset */
+ GHOSTTY_MODE_REPORT_PERMANENTLY_RESET = 4,
+} GhosttyModeReportState;
+
+/**
+ * Encode a DECRPM (DEC Private Mode Report) response sequence.
+ *
+ * Writes a mode report escape sequence into the provided buffer.
+ * The generated sequence has the form:
+ * - DEC private mode: CSI ? Ps1 ; Ps2 $ y
+ * - ANSI mode: CSI Ps1 ; Ps2 $ y
+ *
+ * If the buffer is too small, the function returns GHOSTTY_OUT_OF_SPACE
+ * and writes the required buffer size to @p out_written. The caller can
+ * then retry with a sufficiently sized buffer.
+ *
+ * @param mode The mode identifying the mode to report on
+ * @param state The report state for this mode
+ * @param buf Output buffer to write the encoded sequence into (may be NULL)
+ * @param buf_len Size of the output buffer in bytes
+ * @param[out] out_written On success, the number of bytes written. On
+ * GHOSTTY_OUT_OF_SPACE, the required buffer size.
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer
+ * is too small
+ */
+GHOSTTY_API GhosttyResult ghostty_mode_report_encode(
+ GhosttyMode mode,
+ GhosttyModeReportState state,
+ char* buf,
+ size_t buf_len,
+ size_t* out_written);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
+
+#endif /* GHOSTTY_VT_MODES_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/mouse.h b/vendor/libghostty-vt/include/ghostty/vt/mouse.h
new file mode 100644
index 00000000..4ba5f52e
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/mouse.h
@@ -0,0 +1,70 @@
+/**
+ * @file mouse.h
+ *
+ * Mouse encoding module - encode mouse events into terminal escape sequences.
+ */
+
+#ifndef GHOSTTY_VT_MOUSE_H
+#define GHOSTTY_VT_MOUSE_H
+
+/** @defgroup mouse Mouse Encoding
+ *
+ * Utilities for encoding mouse events into terminal escape sequences,
+ * supporting X10, UTF-8, SGR, URxvt, and SGR-Pixels mouse protocols.
+ *
+ * ## Basic Usage
+ *
+ * 1. Create an encoder instance with ghostty_mouse_encoder_new().
+ * 2. Configure encoder options with ghostty_mouse_encoder_setopt() or
+ * ghostty_mouse_encoder_setopt_from_terminal().
+ * 3. For each mouse event:
+ * - Create a mouse event with ghostty_mouse_event_new().
+ * - Set event properties (action, button, modifiers, position).
+ * - Encode with ghostty_mouse_encoder_encode().
+ * - Free the event with ghostty_mouse_event_free() or reuse it.
+ * 4. Free the encoder with ghostty_mouse_encoder_free() when done.
+ *
+ * For a complete working example, see example/c-vt-encode-mouse in the
+ * repository.
+ *
+ * ## Example
+ *
+ * @snippet c-vt-encode-mouse/src/main.c mouse-encode
+ *
+ * ## Example: Encoding with Terminal State
+ *
+ * When you have a GhosttyTerminal, you can sync its tracking mode and
+ * output format into the encoder automatically:
+ *
+ * @code{.c}
+ * // Create a terminal and feed it some VT data that enables mouse tracking
+ * GhosttyTerminal terminal;
+ * ghostty_terminal_new(NULL, &terminal,
+ * (GhosttyTerminalOptions){.cols = 80, .rows = 24, .max_scrollback = 0});
+ *
+ * // Application might write data that enables mouse reporting, etc.
+ * ghostty_terminal_vt_write(terminal, vt_data, vt_len);
+ *
+ * // Create an encoder and sync its options from the terminal
+ * GhosttyMouseEncoder encoder;
+ * ghostty_mouse_encoder_new(NULL, &encoder);
+ * ghostty_mouse_encoder_setopt_from_terminal(encoder, terminal);
+ *
+ * // Encode a mouse event using the terminal-derived options
+ * char buf[128];
+ * size_t written = 0;
+ * ghostty_mouse_encoder_encode(encoder, event, buf, sizeof(buf), &written);
+ *
+ * ghostty_mouse_encoder_free(encoder);
+ * ghostty_terminal_free(terminal);
+ * @endcode
+ *
+ * @{
+ */
+
+#include
+#include
+
+/** @} */
+
+#endif /* GHOSTTY_VT_MOUSE_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/mouse/encoder.h b/vendor/libghostty-vt/include/ghostty/vt/mouse/encoder.h
new file mode 100644
index 00000000..744b9930
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/mouse/encoder.h
@@ -0,0 +1,211 @@
+/**
+ * @file encoder.h
+ *
+ * Mouse event encoding to terminal escape sequences.
+ */
+
+#ifndef GHOSTTY_VT_MOUSE_ENCODER_H
+#define GHOSTTY_VT_MOUSE_ENCODER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * Opaque handle to a mouse encoder instance.
+ *
+ * This handle represents a mouse encoder that converts normalized
+ * mouse events into terminal escape sequences.
+ *
+ * @ingroup mouse
+ */
+typedef struct GhosttyMouseEncoderImpl *GhosttyMouseEncoder;
+
+/**
+ * Mouse tracking mode.
+ *
+ * @ingroup mouse
+ */
+typedef enum {
+ /** Mouse reporting disabled. */
+ GHOSTTY_MOUSE_TRACKING_NONE = 0,
+
+ /** X10 mouse mode. */
+ GHOSTTY_MOUSE_TRACKING_X10 = 1,
+
+ /** Normal mouse mode (button press/release only). */
+ GHOSTTY_MOUSE_TRACKING_NORMAL = 2,
+
+ /** Button-event tracking mode. */
+ GHOSTTY_MOUSE_TRACKING_BUTTON = 3,
+
+ /** Any-event tracking mode. */
+ GHOSTTY_MOUSE_TRACKING_ANY = 4,
+} GhosttyMouseTrackingMode;
+
+/**
+ * Mouse output format.
+ *
+ * @ingroup mouse
+ */
+typedef enum {
+ GHOSTTY_MOUSE_FORMAT_X10 = 0,
+ GHOSTTY_MOUSE_FORMAT_UTF8 = 1,
+ GHOSTTY_MOUSE_FORMAT_SGR = 2,
+ GHOSTTY_MOUSE_FORMAT_URXVT = 3,
+ GHOSTTY_MOUSE_FORMAT_SGR_PIXELS = 4,
+} GhosttyMouseFormat;
+
+/**
+ * Mouse encoder size and geometry context.
+ *
+ * This describes the rendered terminal geometry used to convert
+ * surface-space positions into encoded coordinates.
+ *
+ * @ingroup mouse
+ */
+typedef struct {
+ /** Size of this struct in bytes. Must be set to sizeof(GhosttyMouseEncoderSize). */
+ size_t size;
+
+ /** Full screen width in pixels. */
+ uint32_t screen_width;
+
+ /** Full screen height in pixels. */
+ uint32_t screen_height;
+
+ /** Cell width in pixels. Must be non-zero. */
+ uint32_t cell_width;
+
+ /** Cell height in pixels. Must be non-zero. */
+ uint32_t cell_height;
+
+ /** Top padding in pixels. */
+ uint32_t padding_top;
+
+ /** Bottom padding in pixels. */
+ uint32_t padding_bottom;
+
+ /** Right padding in pixels. */
+ uint32_t padding_right;
+
+ /** Left padding in pixels. */
+ uint32_t padding_left;
+} GhosttyMouseEncoderSize;
+
+/**
+ * Mouse encoder option identifiers.
+ *
+ * These values are used with ghostty_mouse_encoder_setopt() to configure
+ * the behavior of the mouse encoder.
+ *
+ * @ingroup mouse
+ */
+typedef enum {
+ /** Mouse tracking mode (value: GhosttyMouseTrackingMode). */
+ GHOSTTY_MOUSE_ENCODER_OPT_EVENT = 0,
+
+ /** Mouse output format (value: GhosttyMouseFormat). */
+ GHOSTTY_MOUSE_ENCODER_OPT_FORMAT = 1,
+
+ /** Renderer size context (value: GhosttyMouseEncoderSize). */
+ GHOSTTY_MOUSE_ENCODER_OPT_SIZE = 2,
+
+ /** Whether any mouse button is currently pressed (value: bool). */
+ GHOSTTY_MOUSE_ENCODER_OPT_ANY_BUTTON_PRESSED = 3,
+
+ /** Whether to enable motion deduplication by last cell (value: bool). */
+ GHOSTTY_MOUSE_ENCODER_OPT_TRACK_LAST_CELL = 4,
+} GhosttyMouseEncoderOption;
+
+/**
+ * Create a new mouse encoder instance.
+ *
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param encoder Pointer to store the created encoder handle
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API GhosttyResult ghostty_mouse_encoder_new(const GhosttyAllocator *allocator,
+ GhosttyMouseEncoder *encoder);
+
+/**
+ * Free a mouse encoder instance.
+ *
+ * @param encoder The encoder handle to free (may be NULL)
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_encoder_free(GhosttyMouseEncoder encoder);
+
+/**
+ * Set an option on the mouse encoder.
+ *
+ * A null pointer value does nothing. It does not reset to defaults.
+ *
+ * @param encoder The encoder handle, must not be NULL
+ * @param option The option to set
+ * @param value Pointer to option value (type depends on option)
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_encoder_setopt(GhosttyMouseEncoder encoder,
+ GhosttyMouseEncoderOption option,
+ const void *value);
+
+/**
+ * Set encoder options from a terminal's current state.
+ *
+ * This sets tracking mode and output format from terminal state.
+ * It does not modify size or any-button state.
+ *
+ * @param encoder The encoder handle, must not be NULL
+ * @param terminal The terminal handle, must not be NULL
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_encoder_setopt_from_terminal(GhosttyMouseEncoder encoder,
+ GhosttyTerminal terminal);
+
+/**
+ * Reset internal encoder state.
+ *
+ * This clears motion deduplication state (last tracked cell).
+ *
+ * @param encoder The encoder handle (may be NULL)
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_encoder_reset(GhosttyMouseEncoder encoder);
+
+/**
+ * Encode a mouse event into a terminal escape sequence.
+ *
+ * Not all mouse events produce output. In such cases this returns
+ * GHOSTTY_SUCCESS with out_len set to 0.
+ *
+ * If the output buffer is too small, this returns GHOSTTY_OUT_OF_SPACE
+ * and out_len contains the required size.
+ *
+ * @param encoder The encoder handle, must not be NULL
+ * @param event The mouse event to encode, must not be NULL
+ * @param out_buf Buffer to write encoded bytes to, or NULL to query required size
+ * @param out_buf_size Size of out_buf in bytes
+ * @param out_len Pointer to store bytes written (or required bytes on failure)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if buffer is too small,
+ * or another error code
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API GhosttyResult ghostty_mouse_encoder_encode(GhosttyMouseEncoder encoder,
+ GhosttyMouseEvent event,
+ char *out_buf,
+ size_t out_buf_size,
+ size_t *out_len);
+
+#endif /* GHOSTTY_VT_MOUSE_ENCODER_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/mouse/event.h b/vendor/libghostty-vt/include/ghostty/vt/mouse/event.h
new file mode 100644
index 00000000..5b72735f
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/mouse/event.h
@@ -0,0 +1,193 @@
+/**
+ * @file event.h
+ *
+ * Mouse event representation and manipulation.
+ */
+
+#ifndef GHOSTTY_VT_MOUSE_EVENT_H
+#define GHOSTTY_VT_MOUSE_EVENT_H
+
+#include
+#include
+#include
+#include
+
+/**
+ * Opaque handle to a mouse event.
+ *
+ * This handle represents a normalized mouse input event containing
+ * action, button, modifiers, and surface-space position.
+ *
+ * @ingroup mouse
+ */
+typedef struct GhosttyMouseEventImpl *GhosttyMouseEvent;
+
+/**
+ * Mouse event action type.
+ *
+ * @ingroup mouse
+ */
+typedef enum {
+ /** Mouse button was pressed. */
+ GHOSTTY_MOUSE_ACTION_PRESS = 0,
+
+ /** Mouse button was released. */
+ GHOSTTY_MOUSE_ACTION_RELEASE = 1,
+
+ /** Mouse moved. */
+ GHOSTTY_MOUSE_ACTION_MOTION = 2,
+} GhosttyMouseAction;
+
+/**
+ * Mouse button identity.
+ *
+ * @ingroup mouse
+ */
+typedef enum {
+ GHOSTTY_MOUSE_BUTTON_UNKNOWN = 0,
+ GHOSTTY_MOUSE_BUTTON_LEFT = 1,
+ GHOSTTY_MOUSE_BUTTON_RIGHT = 2,
+ GHOSTTY_MOUSE_BUTTON_MIDDLE = 3,
+ GHOSTTY_MOUSE_BUTTON_FOUR = 4,
+ GHOSTTY_MOUSE_BUTTON_FIVE = 5,
+ GHOSTTY_MOUSE_BUTTON_SIX = 6,
+ GHOSTTY_MOUSE_BUTTON_SEVEN = 7,
+ GHOSTTY_MOUSE_BUTTON_EIGHT = 8,
+ GHOSTTY_MOUSE_BUTTON_NINE = 9,
+ GHOSTTY_MOUSE_BUTTON_TEN = 10,
+ GHOSTTY_MOUSE_BUTTON_ELEVEN = 11,
+} GhosttyMouseButton;
+
+/**
+ * Mouse position in surface-space pixels.
+ *
+ * @ingroup mouse
+ */
+typedef struct {
+ float x;
+ float y;
+} GhosttyMousePosition;
+
+/**
+ * Create a new mouse event instance.
+ *
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param event Pointer to store the created event handle
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *allocator,
+ GhosttyMouseEvent *event);
+
+/**
+ * Free a mouse event instance.
+ *
+ * @param event The mouse event handle to free (may be NULL)
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_event_free(GhosttyMouseEvent event);
+
+/**
+ * Set the event action.
+ *
+ * @param event The event handle, must not be NULL
+ * @param action The action to set
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_event_set_action(GhosttyMouseEvent event,
+ GhosttyMouseAction action);
+
+/**
+ * Get the event action.
+ *
+ * @param event The event handle, must not be NULL
+ * @return The event action
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEvent event);
+
+/**
+ * Set the event button.
+ *
+ * This sets a concrete button identity for the event.
+ * To represent "no button" (for motion events), use
+ * ghostty_mouse_event_clear_button().
+ *
+ * @param event The event handle, must not be NULL
+ * @param button The button to set
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_event_set_button(GhosttyMouseEvent event,
+ GhosttyMouseButton button);
+
+/**
+ * Clear the event button.
+ *
+ * This sets the event button to "none".
+ *
+ * @param event The event handle, must not be NULL
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_event_clear_button(GhosttyMouseEvent event);
+
+/**
+ * Get the event button.
+ *
+ * @param event The event handle, must not be NULL
+ * @param out_button Output pointer for the button value (may be NULL)
+ * @return true if a button is set, false if no button is set
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API bool ghostty_mouse_event_get_button(GhosttyMouseEvent event,
+ GhosttyMouseButton *out_button);
+
+/**
+ * Set keyboard modifiers held during the event.
+ *
+ * @param event The event handle, must not be NULL
+ * @param mods Modifier bitmask
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_event_set_mods(GhosttyMouseEvent event,
+ GhosttyMods mods);
+
+/**
+ * Get keyboard modifiers held during the event.
+ *
+ * @param event The event handle, must not be NULL
+ * @return Modifier bitmask
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event);
+
+/**
+ * Set the event position in surface-space pixels.
+ *
+ * @param event The event handle, must not be NULL
+ * @param position The position to set
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API void ghostty_mouse_event_set_position(GhosttyMouseEvent event,
+ GhosttyMousePosition position);
+
+/**
+ * Get the event position in surface-space pixels.
+ *
+ * @param event The event handle, must not be NULL
+ * @return The current event position
+ *
+ * @ingroup mouse
+ */
+GHOSTTY_API GhosttyMousePosition ghostty_mouse_event_get_position(GhosttyMouseEvent event);
+
+#endif /* GHOSTTY_VT_MOUSE_EVENT_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/osc.h b/vendor/libghostty-vt/include/ghostty/vt/osc.h
new file mode 100644
index 00000000..c8649809
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/osc.h
@@ -0,0 +1,233 @@
+/**
+ * @file osc.h
+ *
+ * OSC (Operating System Command) sequence parser and command handling.
+ */
+
+#ifndef GHOSTTY_VT_OSC_H
+#define GHOSTTY_VT_OSC_H
+
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * Opaque handle to an OSC parser instance.
+ *
+ * This handle represents an OSC (Operating System Command) parser that can
+ * be used to parse the contents of OSC sequences.
+ *
+ * @ingroup osc
+ */
+typedef struct GhosttyOscParserImpl *GhosttyOscParser;
+
+/**
+ * Opaque handle to a single OSC command.
+ *
+ * This handle represents a parsed OSC (Operating System Command) command.
+ * The command can be queried for its type and associated data.
+ *
+ * @ingroup osc
+ */
+typedef struct GhosttyOscCommandImpl *GhosttyOscCommand;
+
+/** @defgroup osc OSC Parser
+ *
+ * OSC (Operating System Command) sequence parser and command handling.
+ *
+ * The parser operates in a streaming fashion, processing input byte-by-byte
+ * to handle OSC sequences that may arrive in fragments across multiple reads.
+ * This interface makes it easy to integrate into most environments and avoids
+ * over-allocating buffers.
+ *
+ * ## Basic Usage
+ *
+ * 1. Create a parser instance with ghostty_osc_new()
+ * 2. Feed bytes to the parser using ghostty_osc_next()
+ * 3. Finalize parsing with ghostty_osc_end() to get the command
+ * 4. Query command type and extract data using ghostty_osc_command_type()
+ * and ghostty_osc_command_data()
+ * 5. Free the parser with ghostty_osc_free() when done
+ *
+ * @{
+ */
+
+/**
+ * OSC command types.
+ *
+ * @ingroup osc
+ */
+typedef enum {
+ GHOSTTY_OSC_COMMAND_INVALID = 0,
+ GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_TITLE = 1,
+ GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_ICON = 2,
+ GHOSTTY_OSC_COMMAND_SEMANTIC_PROMPT = 3,
+ GHOSTTY_OSC_COMMAND_CLIPBOARD_CONTENTS = 4,
+ GHOSTTY_OSC_COMMAND_REPORT_PWD = 5,
+ GHOSTTY_OSC_COMMAND_MOUSE_SHAPE = 6,
+ GHOSTTY_OSC_COMMAND_COLOR_OPERATION = 7,
+ GHOSTTY_OSC_COMMAND_KITTY_COLOR_PROTOCOL = 8,
+ GHOSTTY_OSC_COMMAND_SHOW_DESKTOP_NOTIFICATION = 9,
+ GHOSTTY_OSC_COMMAND_HYPERLINK_START = 10,
+ GHOSTTY_OSC_COMMAND_HYPERLINK_END = 11,
+ GHOSTTY_OSC_COMMAND_CONEMU_SLEEP = 12,
+ GHOSTTY_OSC_COMMAND_CONEMU_SHOW_MESSAGE_BOX = 13,
+ GHOSTTY_OSC_COMMAND_CONEMU_CHANGE_TAB_TITLE = 14,
+ GHOSTTY_OSC_COMMAND_CONEMU_PROGRESS_REPORT = 15,
+ GHOSTTY_OSC_COMMAND_CONEMU_WAIT_INPUT = 16,
+ GHOSTTY_OSC_COMMAND_CONEMU_GUIMACRO = 17,
+ GHOSTTY_OSC_COMMAND_CONEMU_RUN_PROCESS = 18,
+ GHOSTTY_OSC_COMMAND_CONEMU_OUTPUT_ENVIRONMENT_VARIABLE = 19,
+ GHOSTTY_OSC_COMMAND_CONEMU_XTERM_EMULATION = 20,
+ GHOSTTY_OSC_COMMAND_CONEMU_COMMENT = 21,
+ GHOSTTY_OSC_COMMAND_KITTY_TEXT_SIZING = 22,
+} GhosttyOscCommandType;
+
+/**
+ * OSC command data types.
+ *
+ * These values specify what type of data to extract from an OSC command
+ * using `ghostty_osc_command_data`.
+ *
+ * @ingroup osc
+ */
+typedef enum {
+ /** Invalid data type. Never results in any data extraction. */
+ GHOSTTY_OSC_DATA_INVALID = 0,
+
+ /**
+ * Window title string data.
+ *
+ * Valid for: GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_TITLE
+ *
+ * Output type: const char ** (pointer to null-terminated string)
+ *
+ * Lifetime: Valid until the next call to any ghostty_osc_* function with
+ * the same parser instance. Memory is owned by the parser.
+ */
+ GHOSTTY_OSC_DATA_CHANGE_WINDOW_TITLE_STR = 1,
+} GhosttyOscCommandData;
+
+/**
+ * Create a new OSC parser instance.
+ *
+ * Creates a new OSC (Operating System Command) parser using the provided
+ * allocator. The parser must be freed using ghostty_vt_osc_free() when
+ * no longer needed.
+ *
+ * @param allocator Pointer to the allocator to use for memory management, or NULL to use the default allocator
+ * @param parser Pointer to store the created parser handle
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup osc
+ */
+GHOSTTY_API GhosttyResult ghostty_osc_new(const GhosttyAllocator *allocator, GhosttyOscParser *parser);
+
+/**
+ * Free an OSC parser instance.
+ *
+ * Releases all resources associated with the OSC parser. After this call,
+ * the parser handle becomes invalid and must not be used.
+ *
+ * @param parser The parser handle to free (may be NULL)
+ *
+ * @ingroup osc
+ */
+GHOSTTY_API void ghostty_osc_free(GhosttyOscParser parser);
+
+/**
+ * Reset an OSC parser instance to its initial state.
+ *
+ * Resets the parser state, clearing any partially parsed OSC sequences
+ * and returning the parser to its initial state. This is useful for
+ * reusing a parser instance or recovering from parse errors.
+ *
+ * @param parser The parser handle to reset, must not be null.
+ *
+ * @ingroup osc
+ */
+GHOSTTY_API void ghostty_osc_reset(GhosttyOscParser parser);
+
+/**
+ * Parse the next byte in an OSC sequence.
+ *
+ * Processes a single byte as part of an OSC sequence. The parser maintains
+ * internal state to track the progress through the sequence. Call this
+ * function for each byte in the sequence data.
+ *
+ * When finished pumping the parser with bytes, call ghostty_osc_end
+ * to get the final result.
+ *
+ * @param parser The parser handle, must not be null.
+ * @param byte The next byte to parse
+ *
+ * @ingroup osc
+ */
+GHOSTTY_API void ghostty_osc_next(GhosttyOscParser parser, uint8_t byte);
+
+/**
+ * Finalize OSC parsing and retrieve the parsed command.
+ *
+ * Call this function after feeding all bytes of an OSC sequence to the parser
+ * using ghostty_osc_next() with the exception of the terminating character
+ * (ESC or ST). This function finalizes the parsing process and returns the
+ * parsed OSC command.
+ *
+ * The return value is never NULL. Invalid commands will return a command
+ * with type GHOSTTY_OSC_COMMAND_INVALID.
+ *
+ * The terminator parameter specifies the byte that terminated the OSC sequence
+ * (typically 0x07 for BEL or 0x5C for ST after ESC). This information is
+ * preserved in the parsed command so that responses can use the same terminator
+ * format for better compatibility with the calling program. For commands that
+ * do not require a response, this parameter is ignored and the resulting
+ * command will not retain the terminator information.
+ *
+ * The returned command handle is valid until the next call to any
+ * `ghostty_osc_*` function with the same parser instance with the exception
+ * of command introspection functions such as `ghostty_osc_command_type`.
+ *
+ * @param parser The parser handle, must not be null.
+ * @param terminator The terminating byte of the OSC sequence (0x07 for BEL, 0x5C for ST)
+ * @return Handle to the parsed OSC command
+ *
+ * @ingroup osc
+ */
+GHOSTTY_API GhosttyOscCommand ghostty_osc_end(GhosttyOscParser parser, uint8_t terminator);
+
+/**
+ * Get the type of an OSC command.
+ *
+ * Returns the type identifier for the given OSC command. This can be used
+ * to determine what kind of command was parsed and what data might be
+ * available from it.
+ *
+ * @param command The OSC command handle to query (may be NULL)
+ * @return The command type, or GHOSTTY_OSC_COMMAND_INVALID if command is NULL
+ *
+ * @ingroup osc
+ */
+GHOSTTY_API GhosttyOscCommandType ghostty_osc_command_type(GhosttyOscCommand command);
+
+/**
+ * Extract data from an OSC command.
+ *
+ * Extracts typed data from the given OSC command based on the specified
+ * data type. The output pointer must be of the appropriate type for the
+ * requested data kind. Valid command types, output types, and memory
+ * safety information are documented in the `GhosttyOscCommandData` enum.
+ *
+ * @param command The OSC command handle to query (may be NULL)
+ * @param data The type of data to extract
+ * @param out Pointer to store the extracted data (type depends on data parameter)
+ * @return true if data extraction was successful, false otherwise
+ *
+ * @ingroup osc
+ */
+GHOSTTY_API bool ghostty_osc_command_data(GhosttyOscCommand command, GhosttyOscCommandData data, void *out);
+
+/** @} */
+
+#endif /* GHOSTTY_VT_OSC_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/paste.h b/vendor/libghostty-vt/include/ghostty/vt/paste.h
new file mode 100644
index 00000000..b3df5be4
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/paste.h
@@ -0,0 +1,101 @@
+/**
+ * @file paste.h
+ *
+ * Paste utilities - validate and encode paste data for terminal input.
+ */
+
+#ifndef GHOSTTY_VT_PASTE_H
+#define GHOSTTY_VT_PASTE_H
+
+/** @defgroup paste Paste Utilities
+ *
+ * Utilities for validating and encoding paste data for terminal input.
+ *
+ * ## Basic Usage
+ *
+ * Use ghostty_paste_is_safe() to check if paste data contains potentially
+ * dangerous sequences before sending it to the terminal.
+ *
+ * Use ghostty_paste_encode() to encode paste data for writing to the pty,
+ * including bracketed paste wrapping and unsafe byte stripping.
+ *
+ * ## Examples
+ *
+ * ### Safety Check
+ *
+ * @snippet c-vt-paste/src/main.c paste-safety
+ *
+ * ### Encoding
+ *
+ * @snippet c-vt-paste/src/main.c paste-encode
+ *
+ * @{
+ */
+
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Check if paste data is safe to paste into the terminal.
+ *
+ * Data is considered unsafe if it contains:
+ * - Newlines (`\n`) which can inject commands
+ * - The bracketed paste end sequence (`\x1b[201~`) which can be used
+ * to exit bracketed paste mode and inject commands
+ *
+ * This check is conservative and considers data unsafe regardless of
+ * current terminal state.
+ *
+ * @param data The paste data to check (must not be NULL)
+ * @param len The length of the data in bytes
+ * @return true if the data is safe to paste, false otherwise
+ */
+GHOSTTY_API bool ghostty_paste_is_safe(const char* data, size_t len);
+
+/**
+ * Encode paste data for writing to the terminal pty.
+ *
+ * This function prepares paste data for terminal input by:
+ * - Stripping unsafe control bytes (NUL, ESC, DEL, etc.) by replacing
+ * them with spaces
+ * - Wrapping the data in bracketed paste sequences if @p bracketed is true
+ * - Replacing newlines with carriage returns if @p bracketed is false
+ *
+ * The input @p data buffer is modified in place during encoding. The
+ * encoded result (potentially with bracketed paste prefix/suffix) is
+ * written to the output buffer.
+ *
+ * If the output buffer is too small, the function returns
+ * GHOSTTY_OUT_OF_SPACE and sets the required size in @p out_written.
+ * The caller can then retry with a sufficiently sized buffer.
+ *
+ * @param data The paste data to encode (modified in place, may be NULL)
+ * @param data_len The length of the input data in bytes
+ * @param bracketed Whether bracketed paste mode is active
+ * @param buf Output buffer to write the encoded result into (may be NULL)
+ * @param buf_len Size of the output buffer in bytes
+ * @param[out] out_written On success, the number of bytes written. On
+ * GHOSTTY_OUT_OF_SPACE, the required buffer size.
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer
+ * is too small
+ */
+GHOSTTY_API GhosttyResult ghostty_paste_encode(
+ char* data,
+ size_t data_len,
+ bool bracketed,
+ char* buf,
+ size_t buf_len,
+ size_t* out_written);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
+
+#endif /* GHOSTTY_VT_PASTE_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/point.h b/vendor/libghostty-vt/include/ghostty/vt/point.h
new file mode 100644
index 00000000..f152a5c4
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/point.h
@@ -0,0 +1,88 @@
+/**
+ * @file point.h
+ *
+ * Terminal point types for referencing locations in the terminal grid.
+ */
+
+#ifndef GHOSTTY_VT_POINT_H
+#define GHOSTTY_VT_POINT_H
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup point Point
+ *
+ * Types for referencing x/y positions in the terminal grid under
+ * different coordinate systems (active area, viewport, full screen,
+ * scrollback history).
+ *
+ * @{
+ */
+
+/**
+ * A coordinate in the terminal grid.
+ *
+ * @ingroup point
+ */
+typedef struct {
+ /** Column (0-indexed). */
+ uint16_t x;
+
+ /** Row (0-indexed). May exceed page size for screen/history tags. */
+ uint32_t y;
+} GhosttyPointCoordinate;
+
+/**
+ * Point reference tag.
+ *
+ * Determines which coordinate system a point uses.
+ *
+ * @ingroup point
+ */
+typedef enum {
+ /** Active area where the cursor can move. */
+ GHOSTTY_POINT_TAG_ACTIVE = 0,
+
+ /** Visible viewport (changes when scrolled). */
+ GHOSTTY_POINT_TAG_VIEWPORT = 1,
+
+ /** Full screen including scrollback. */
+ GHOSTTY_POINT_TAG_SCREEN = 2,
+
+ /** Scrollback history only (before active area). */
+ GHOSTTY_POINT_TAG_HISTORY = 3,
+} GhosttyPointTag;
+
+/**
+ * Point value union.
+ *
+ * @ingroup point
+ */
+typedef union {
+ /** Coordinate (used for all tag variants). */
+ GhosttyPointCoordinate coordinate;
+
+ /** Padding for ABI compatibility. Do not use. */
+ uint64_t _padding[2];
+} GhosttyPointValue;
+
+/**
+ * Tagged union for a point in the terminal grid.
+ *
+ * @ingroup point
+ */
+typedef struct {
+ GhosttyPointTag tag;
+ GhosttyPointValue value;
+} GhosttyPoint;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_POINT_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/render.h b/vendor/libghostty-vt/include/ghostty/vt/render.h
new file mode 100644
index 00000000..163a4e1d
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/render.h
@@ -0,0 +1,603 @@
+/**
+ * @file render.h
+ *
+ * Render state for creating high performance renderers.
+ */
+
+#ifndef GHOSTTY_VT_RENDER_H
+#define GHOSTTY_VT_RENDER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup render Render State
+ *
+ * Represents the state required to render a visible screen (a viewport)
+ * of a terminal instance. This is stateful and optimized for repeated
+ * updates from a single terminal instance and only updating dirty regions
+ * of the screen.
+ *
+ * The key design principle of this API is that it only needs read/write
+ * access to the terminal instance during the update call. This allows
+ * the render state to minimally impact terminal IO performance and also
+ * allows the renderer to be safely multi-threaded (as long as a lock is
+ * held during the update call to ensure exclusive access to the terminal
+ * instance).
+ *
+ * The basic usage of this API is:
+ *
+ * 1. Create an empty render state
+ * 2. Update it from a terminal instance whenever you need.
+ * 3. Read from the render state to get the data needed to draw your frame.
+ *
+ * ## Dirty Tracking
+ *
+ * Dirty tracking is a key feature of the render state that allows renderers
+ * to efficiently determine what parts of the screen have changed and only
+ * redraw changed regions.
+ *
+ * The render state API keeps track of dirty state at two independent layers:
+ * a global dirty state that indicates whether the entire frame is clean,
+ * partially dirty, or fully dirty, and a per-row dirty state that allows
+ * tracking which rows in a partially dirty frame have changed.
+ *
+ * The user of the render state API is expected to unset both of these.
+ * The `update` call does not unset dirty state, it only updates it.
+ *
+ * An extremely important detail: setting one dirty state doesn't unset
+ * the other. For example, setting the global dirty state to false does not
+ * reset the row-level dirty flags. So, the caller of the render state API must
+ * be careful to manage both layers of dirty state correctly.
+ *
+ * ## Examples
+ *
+ * ### Creating and updating render state
+ * @snippet c-vt-render/src/main.c render-state-update
+ *
+ * ### Checking dirty state
+ * @snippet c-vt-render/src/main.c render-dirty-check
+ *
+ * ### Reading colors
+ * @snippet c-vt-render/src/main.c render-colors
+ *
+ * ### Reading cursor state
+ * @snippet c-vt-render/src/main.c render-cursor
+ *
+ * ### Iterating rows and cells
+ * @snippet c-vt-render/src/main.c render-row-iterate
+ *
+ * ### Resetting dirty state after rendering
+ * @snippet c-vt-render/src/main.c render-dirty-reset
+ *
+ * @{
+ */
+
+/**
+ * Opaque handle to a render state instance.
+ *
+ * @ingroup render
+ */
+typedef struct GhosttyRenderStateImpl* GhosttyRenderState;
+
+/**
+ * Opaque handle to a render-state row iterator.
+ *
+ * @ingroup render
+ */
+typedef struct GhosttyRenderStateRowIteratorImpl* GhosttyRenderStateRowIterator;
+
+/**
+ * Opaque handle to render-state row cells.
+ *
+ * @ingroup render
+ */
+typedef struct GhosttyRenderStateRowCellsImpl* GhosttyRenderStateRowCells;
+
+/**
+ * Dirty state of a render state after update.
+ *
+ * @ingroup render
+ */
+typedef enum {
+ /** Not dirty at all; rendering can be skipped. */
+ GHOSTTY_RENDER_STATE_DIRTY_FALSE = 0,
+
+ /** Some rows changed; renderer can redraw incrementally. */
+ GHOSTTY_RENDER_STATE_DIRTY_PARTIAL = 1,
+
+ /** Global state changed; renderer should redraw everything. */
+ GHOSTTY_RENDER_STATE_DIRTY_FULL = 2,
+} GhosttyRenderStateDirty;
+
+/**
+ * Visual style of the cursor.
+ *
+ * @ingroup render
+ */
+typedef enum {
+ /** Bar cursor (DECSCUSR 5, 6). */
+ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR = 0,
+
+ /** Block cursor (DECSCUSR 1, 2). */
+ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK = 1,
+
+ /** Underline cursor (DECSCUSR 3, 4). */
+ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE = 2,
+
+ /** Hollow block cursor. */
+ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW = 3,
+} GhosttyRenderStateCursorVisualStyle;
+
+/**
+ * Queryable data kinds for ghostty_render_state_get().
+ *
+ * @ingroup render
+ */
+typedef enum {
+ /** Invalid / sentinel value. */
+ GHOSTTY_RENDER_STATE_DATA_INVALID = 0,
+
+ /** Viewport width in cells (uint16_t). */
+ GHOSTTY_RENDER_STATE_DATA_COLS = 1,
+
+ /** Viewport height in cells (uint16_t). */
+ GHOSTTY_RENDER_STATE_DATA_ROWS = 2,
+
+ /** Current dirty state (GhosttyRenderStateDirty). */
+ GHOSTTY_RENDER_STATE_DATA_DIRTY = 3,
+
+ /** Populate a pre-allocated GhosttyRenderStateRowIterator with row data
+ * from the render state (GhosttyRenderStateRowIterator). Row data is
+ * only valid as long as the underlying render state is not updated.
+ * It is unsafe to use row data after updating the render state.
+ * */
+ GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR = 4,
+
+ /** Default/current background color (GhosttyColorRgb). */
+ GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND = 5,
+
+ /** Default/current foreground color (GhosttyColorRgb). */
+ GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND = 6,
+
+ /** Cursor color when explicitly set by terminal state (GhosttyColorRgb).
+ * Returns GHOSTTY_INVALID_VALUE if no explicit cursor color is set;
+ * use COLOR_CURSOR_HAS_VALUE to check first. */
+ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR = 7,
+
+ /** Whether an explicit cursor color is set (bool). */
+ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE = 8,
+
+ /** The active 256-color palette (GhosttyColorRgb[256]). */
+ GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE = 9,
+
+ /** The visual style of the cursor (GhosttyRenderStateCursorVisualStyle). */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE = 10,
+
+ /** Whether the cursor is visible based on terminal modes (bool). */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE = 11,
+
+ /** Whether the cursor should blink based on terminal modes (bool). */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING = 12,
+
+ /** Whether the cursor is at a password input field (bool). */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT = 13,
+
+ /** Whether the cursor is visible within the viewport (bool).
+ * If false, the cursor viewport position values are undefined. */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE = 14,
+
+ /** Cursor viewport x position in cells (uint16_t).
+ * Only valid when CURSOR_VIEWPORT_HAS_VALUE is true. */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X = 15,
+
+ /** Cursor viewport y position in cells (uint16_t).
+ * Only valid when CURSOR_VIEWPORT_HAS_VALUE is true. */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y = 16,
+
+ /** Whether the cursor is on the tail of a wide character (bool).
+ * Only valid when CURSOR_VIEWPORT_HAS_VALUE is true. */
+ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL = 17,
+} GhosttyRenderStateData;
+
+/**
+ * Settable options for ghostty_render_state_set().
+ *
+ * @ingroup render
+ */
+typedef enum {
+ /** Set dirty state (GhosttyRenderStateDirty). */
+ GHOSTTY_RENDER_STATE_OPTION_DIRTY = 0,
+} GhosttyRenderStateOption;
+
+/**
+ * Queryable data kinds for ghostty_render_state_row_get().
+ *
+ * @ingroup render
+ */
+typedef enum {
+ /** Invalid / sentinel value. */
+ GHOSTTY_RENDER_STATE_ROW_DATA_INVALID = 0,
+
+ /** Whether the current row is dirty (bool). */
+ GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY = 1,
+
+ /** The raw row value (GhosttyRow). */
+ GHOSTTY_RENDER_STATE_ROW_DATA_RAW = 2,
+
+ /** Populate a pre-allocated GhosttyRenderStateRowCells with cell data for
+ * the current row (GhosttyRenderStateRowCells). Cell data is only
+ * valid as long as the underlying render state is not updated.
+ * It is unsafe to use cell data after updating the render state. */
+ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS = 3,
+} GhosttyRenderStateRowData;
+
+/**
+ * Settable options for ghostty_render_state_row_set().
+ *
+ * @ingroup render
+ */
+typedef enum {
+ /** Set dirty state for the current row (bool). */
+ GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY = 0,
+} GhosttyRenderStateRowOption;
+
+/**
+ * Render-state color information.
+ *
+ * This struct uses the sized-struct ABI pattern. Initialize with
+ * GHOSTTY_INIT_SIZED(GhosttyRenderStateColors) before calling
+ * ghostty_render_state_colors_get().
+ *
+ * Example:
+ * @code
+ * GhosttyRenderStateColors colors = GHOSTTY_INIT_SIZED(GhosttyRenderStateColors);
+ * GhosttyResult result = ghostty_render_state_colors_get(state, &colors);
+ * @endcode
+ *
+ * @ingroup render
+ */
+typedef struct {
+ /** Size of this struct in bytes. Must be set to sizeof(GhosttyRenderStateColors). */
+ size_t size;
+
+ /** The default/current background color for the render state. */
+ GhosttyColorRgb background;
+
+ /** The default/current foreground color for the render state. */
+ GhosttyColorRgb foreground;
+
+ /** The cursor color when explicitly set by terminal state. */
+ GhosttyColorRgb cursor;
+
+ /**
+ * True when cursor contains a valid explicit cursor color value.
+ * If this is false, the cursor color should be ignored; it will
+ * contain undefined data.
+ * */
+ bool cursor_has_value;
+
+ /** The active 256-color palette for this render state. */
+ GhosttyColorRgb palette[256];
+} GhosttyRenderStateColors;
+
+/**
+ * Create a new render state instance.
+ *
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param state Pointer to store the created render state handle
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation
+ * failure
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_new(const GhosttyAllocator* allocator,
+ GhosttyRenderState* state);
+
+/**
+ * Free a render state instance.
+ *
+ * Releases all resources associated with the render state. After this call,
+ * the render state handle becomes invalid.
+ *
+ * @param state The render state handle to free (may be NULL)
+ *
+ * @ingroup render
+ */
+GHOSTTY_API void ghostty_render_state_free(GhosttyRenderState state);
+
+/**
+ * Update a render state instance from a terminal.
+ *
+ * This consumes terminal/screen dirty state in the same way as the internal
+ * render state update path.
+ *
+ * @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param terminal The terminal handle to read from (NULL returns GHOSTTY_INVALID_VALUE)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` or
+ * `terminal` is NULL, GHOSTTY_OUT_OF_MEMORY if updating the state requires
+ * allocation and that allocation fails
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_update(GhosttyRenderState state,
+ GhosttyTerminal terminal);
+
+/**
+ * Get a value from a render state.
+ *
+ * The `out` pointer must point to a value of the type corresponding to the
+ * requested data kind (see GhosttyRenderStateData).
+ *
+ * @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param data The data kind to query
+ * @param[out] out Pointer to receive the queried value
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` is
+ * NULL or `data` is not a recognized enum value
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_get(GhosttyRenderState state,
+ GhosttyRenderStateData data,
+ void* out);
+
+/**
+ * Set an option on a render state.
+ *
+ * The `value` pointer must point to a value of the type corresponding to the
+ * requested option kind (see GhosttyRenderStateOption).
+ *
+ * @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param option The option to set
+ * @param[in] value Pointer to the value to set (NULL returns
+ * GHOSTTY_INVALID_VALUE)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` or
+ * `value` is NULL
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_set(GhosttyRenderState state,
+ GhosttyRenderStateOption option,
+ const void* value);
+
+/**
+ * Get the current color information from a render state.
+ *
+ * This writes as many fields as fit in the caller-provided sized struct.
+ * `out_colors->size` must be set by the caller (typically via
+ * GHOSTTY_INIT_SIZED(GhosttyRenderStateColors)).
+ *
+ * @param state The render state handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param[out] out_colors Sized output struct to receive render-state colors
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `state` or
+ * `out_colors` is NULL, or if `out_colors->size` is smaller than
+ * `sizeof(size_t)`
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_colors_get(GhosttyRenderState state,
+ GhosttyRenderStateColors* out_colors);
+
+/**
+ * Create a new row iterator instance.
+ *
+ * All fields except the allocator are left undefined until populated
+ * via ghostty_render_state_get() with
+ * GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR.
+ *
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param[out] out_iterator On success, receives the created iterator handle
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation
+ * failure
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_row_iterator_new(
+ const GhosttyAllocator* allocator,
+ GhosttyRenderStateRowIterator* out_iterator);
+
+/**
+ * Free a render-state row iterator.
+ *
+ * @param iterator The iterator handle to free (may be NULL)
+ *
+ * @ingroup render
+ */
+GHOSTTY_API void ghostty_render_state_row_iterator_free(GhosttyRenderStateRowIterator iterator);
+
+/**
+ * Move a render-state row iterator to the next row.
+ *
+ * Returns true if the iterator moved successfully and row data is
+ * available to read at the new position.
+ *
+ * @param iterator The iterator handle to advance (may be NULL)
+ * @return true if advanced to the next row, false if `iterator` is
+ * NULL or if the iterator has reached the end
+ *
+ * @ingroup render
+ */
+GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator);
+
+/**
+ * Get a value from the current row in a render-state row iterator.
+ *
+ * The `out` pointer must point to a value of the type corresponding to the
+ * requested data kind (see GhosttyRenderStateRowData).
+ * Call ghostty_render_state_row_iterator_next() at least once before
+ * calling this function.
+ *
+ * @param iterator The iterator handle to query (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param data The data kind to query
+ * @param[out] out Pointer to receive the queried value
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if
+ * `iterator` is NULL or the iterator is not positioned on a row
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_row_get(
+ GhosttyRenderStateRowIterator iterator,
+ GhosttyRenderStateRowData data,
+ void* out);
+
+/**
+ * Set an option on the current row in a render-state row iterator.
+ *
+ * The `value` pointer must point to a value of the type corresponding to the
+ * requested option kind (see GhosttyRenderStateRowOption).
+ * Call ghostty_render_state_row_iterator_next() at least once before
+ * calling this function.
+ *
+ * @param iterator The iterator handle to update (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param option The option to set
+ * @param[in] value Pointer to the value to set (NULL returns
+ * GHOSTTY_INVALID_VALUE)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if
+ * `iterator` is NULL or the iterator is not positioned on a row
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_row_set(
+ GhosttyRenderStateRowIterator iterator,
+ GhosttyRenderStateRowOption option,
+ const void* value);
+
+/**
+ * Create a new row cells instance.
+ *
+ * All fields except the allocator are left undefined until populated
+ * via ghostty_render_state_row_get() with
+ * GHOSTTY_RENDER_STATE_ROW_DATA_CELLS.
+ *
+ * You can reuse this value repeatedly with ghostty_render_state_row_get() to
+ * avoid allocating a new cells container for every row.
+ *
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param[out] out_cells On success, receives the created row cells handle
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_MEMORY on allocation
+ * failure
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new(
+ const GhosttyAllocator* allocator,
+ GhosttyRenderStateRowCells* out_cells);
+
+/**
+ * Queryable data kinds for ghostty_render_state_row_cells_get().
+ *
+ * @ingroup render
+ */
+typedef enum {
+ /** Invalid / sentinel value. */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID = 0,
+
+ /** The raw cell value (GhosttyCell). */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW = 1,
+
+ /** The style for the current cell (GhosttyStyle). */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE = 2,
+
+ /** The total number of grapheme codepoints including the base codepoint
+ * (uint32_t). Returns 0 if the cell has no text. */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN = 3,
+
+ /** Write grapheme codepoints into a caller-provided buffer (uint32_t*).
+ * The buffer must be at least graphemes_len elements. The base codepoint
+ * is written first, followed by any extra codepoints. */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF = 4,
+
+ /** The resolved background color of the cell (GhosttyColorRgb).
+ * Flattens the three possible sources: content-tag bg_color_rgb,
+ * content-tag bg_color_palette (looked up in the palette), or the
+ * style's bg_color. Returns GHOSTTY_INVALID_VALUE if the cell has
+ * no background color, in which case the caller should use whatever
+ * default background color it wants (e.g. the terminal background). */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR = 5,
+
+ /** The resolved foreground color of the cell (GhosttyColorRgb).
+ * Resolves palette indices through the palette. Bold color handling
+ * is not applied; the caller should handle bold styling separately.
+ * Returns GHOSTTY_INVALID_VALUE if the cell has no explicit foreground
+ * color, in which case the caller should use whatever default foreground
+ * color it wants (e.g. the terminal foreground). */
+ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR = 6,
+} GhosttyRenderStateRowCellsData;
+
+/**
+ * Move a render-state row cells iterator to the next cell.
+ *
+ * Returns true if the iterator moved successfully and cell data is
+ * available to read at the new position.
+ *
+ * @param cells The row cells handle to advance (may be NULL)
+ * @return true if advanced to the next cell, false if `cells` is
+ * NULL or if the iterator has reached the end
+ *
+ * @ingroup render
+ */
+GHOSTTY_API bool ghostty_render_state_row_cells_next(GhosttyRenderStateRowCells cells);
+
+/**
+ * Move a render-state row cells iterator to a specific column.
+ *
+ * Positions the iterator at the given x (column) index so that
+ * subsequent reads return data for that cell.
+ *
+ * @param cells The row cells handle to reposition (NULL returns
+ * GHOSTTY_INVALID_VALUE)
+ * @param x The zero-based column index to select
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if `cells`
+ * is NULL or `x` is out of range
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_select(
+ GhosttyRenderStateRowCells cells, uint16_t x);
+
+/**
+ * Get a value from the current cell in a render-state row cells iterator.
+ *
+ * The `out` pointer must point to a value of the type corresponding to the
+ * requested data kind (see GhosttyRenderStateRowCellsData).
+ * Call ghostty_render_state_row_cells_next() or
+ * ghostty_render_state_row_cells_select() at least once before
+ * calling this function.
+ *
+ * @param cells The row cells handle to query (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param data The data kind to query
+ * @param[out] out Pointer to receive the queried value
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if
+ * `cells` is NULL or the iterator is not positioned on a cell
+ *
+ * @ingroup render
+ */
+GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_get(
+ GhosttyRenderStateRowCells cells,
+ GhosttyRenderStateRowCellsData data,
+ void* out);
+
+/**
+ * Free a row cells instance.
+ *
+ * @param cells The row cells handle to free (may be NULL)
+ *
+ * @ingroup render
+ */
+GHOSTTY_API void ghostty_render_state_row_cells_free(GhosttyRenderStateRowCells cells);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_RENDER_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/screen.h b/vendor/libghostty-vt/include/ghostty/vt/screen.h
new file mode 100644
index 00000000..89b4825f
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/screen.h
@@ -0,0 +1,340 @@
+/**
+ * @file screen.h
+ *
+ * Terminal screen cell and row types.
+ */
+
+#ifndef GHOSTTY_VT_SCREEN_H
+#define GHOSTTY_VT_SCREEN_H
+
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup screen Screen
+ *
+ * Terminal screen cell and row types.
+ *
+ * These types represent the contents of a terminal screen. A GhosttyCell
+ * is a single grid cell and a GhosttyRow is a single row. Both are opaque
+ * values whose fields are accessed via ghostty_cell_get() and
+ * ghostty_row_get() respectively.
+ *
+ * @{
+ */
+
+/**
+ * Opaque cell value.
+ *
+ * Represents a single terminal cell. The internal layout is opaque and
+ * must be queried via ghostty_cell_get(). Obtain cell values from
+ * terminal query APIs.
+ *
+ * @ingroup screen
+ */
+typedef uint64_t GhosttyCell;
+
+/**
+ * Opaque row value.
+ *
+ * Represents a single terminal row. The internal layout is opaque and
+ * must be queried via ghostty_row_get(). Obtain row values from
+ * terminal query APIs.
+ *
+ * @ingroup screen
+ */
+typedef uint64_t GhosttyRow;
+
+/**
+ * Cell content tag.
+ *
+ * Describes what kind of content a cell holds.
+ *
+ * @ingroup screen
+ */
+typedef enum {
+ /** A single codepoint (may be zero for empty). */
+ GHOSTTY_CELL_CONTENT_CODEPOINT = 0,
+
+ /** A codepoint that is part of a multi-codepoint grapheme cluster. */
+ GHOSTTY_CELL_CONTENT_CODEPOINT_GRAPHEME = 1,
+
+ /** No text; background color from palette. */
+ GHOSTTY_CELL_CONTENT_BG_COLOR_PALETTE = 2,
+
+ /** No text; background color as RGB. */
+ GHOSTTY_CELL_CONTENT_BG_COLOR_RGB = 3,
+} GhosttyCellContentTag;
+
+/**
+ * Cell wide property.
+ *
+ * Describes the width behavior of a cell.
+ *
+ * @ingroup screen
+ */
+typedef enum {
+ /** Not a wide character, cell width 1. */
+ GHOSTTY_CELL_WIDE_NARROW = 0,
+
+ /** Wide character, cell width 2. */
+ GHOSTTY_CELL_WIDE_WIDE = 1,
+
+ /** Spacer after wide character. Do not render. */
+ GHOSTTY_CELL_WIDE_SPACER_TAIL = 2,
+
+ /** Spacer at end of soft-wrapped line for a wide character. */
+ GHOSTTY_CELL_WIDE_SPACER_HEAD = 3,
+} GhosttyCellWide;
+
+/**
+ * Semantic content type of a cell.
+ *
+ * Set by semantic prompt sequences (OSC 133) to distinguish between
+ * command output, user input, and shell prompt text.
+ *
+ * @ingroup screen
+ */
+typedef enum {
+ /** Regular output content, such as command output. */
+ GHOSTTY_CELL_SEMANTIC_OUTPUT = 0,
+
+ /** Content that is part of user input. */
+ GHOSTTY_CELL_SEMANTIC_INPUT = 1,
+
+ /** Content that is part of a shell prompt. */
+ GHOSTTY_CELL_SEMANTIC_PROMPT = 2,
+} GhosttyCellSemanticContent;
+
+/**
+ * Cell data types.
+ *
+ * These values specify what type of data to extract from a cell
+ * using `ghostty_cell_get`.
+ *
+ * @ingroup screen
+ */
+typedef enum {
+ /** Invalid data type. Never results in any data extraction. */
+ GHOSTTY_CELL_DATA_INVALID = 0,
+
+ /**
+ * The codepoint of the cell (0 if empty or bg-color-only).
+ *
+ * Output type: uint32_t *
+ */
+ GHOSTTY_CELL_DATA_CODEPOINT = 1,
+
+ /**
+ * The content tag describing what kind of content is in the cell.
+ *
+ * Output type: GhosttyCellContentTag *
+ */
+ GHOSTTY_CELL_DATA_CONTENT_TAG = 2,
+
+ /**
+ * The wide property of the cell.
+ *
+ * Output type: GhosttyCellWide *
+ */
+ GHOSTTY_CELL_DATA_WIDE = 3,
+
+ /**
+ * Whether the cell has text to render.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_CELL_DATA_HAS_TEXT = 4,
+
+ /**
+ * Whether the cell has non-default styling.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_CELL_DATA_HAS_STYLING = 5,
+
+ /**
+ * The style ID for the cell (for use with style lookups).
+ *
+ * Output type: uint16_t *
+ */
+ GHOSTTY_CELL_DATA_STYLE_ID = 6,
+
+ /**
+ * Whether the cell has a hyperlink.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_CELL_DATA_HAS_HYPERLINK = 7,
+
+ /**
+ * Whether the cell is protected.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_CELL_DATA_PROTECTED = 8,
+
+ /**
+ * The semantic content type of the cell (from OSC 133).
+ *
+ * Output type: GhosttyCellSemanticContent *
+ */
+ GHOSTTY_CELL_DATA_SEMANTIC_CONTENT = 9,
+
+ /**
+ * The palette index for the cell's background color.
+ * Only valid when content_tag is GHOSTTY_CELL_CONTENT_BG_COLOR_PALETTE.
+ *
+ * Output type: GhosttyColorPaletteIndex *
+ */
+ GHOSTTY_CELL_DATA_COLOR_PALETTE = 10,
+
+ /**
+ * The RGB value for the cell's background color.
+ * Only valid when content_tag is GHOSTTY_CELL_CONTENT_BG_COLOR_RGB.
+ *
+ * Output type: GhosttyColorRgb *
+ */
+ GHOSTTY_CELL_DATA_COLOR_RGB = 11,
+} GhosttyCellData;
+
+/**
+ * Row semantic prompt state.
+ *
+ * Indicates whether any cells in a row are part of a shell prompt,
+ * as reported by OSC 133 sequences.
+ *
+ * @ingroup screen
+ */
+typedef enum {
+ /** No prompt cells in this row. */
+ GHOSTTY_ROW_SEMANTIC_NONE = 0,
+
+ /** Prompt cells exist and this is a primary prompt line. */
+ GHOSTTY_ROW_SEMANTIC_PROMPT = 1,
+
+ /** Prompt cells exist and this is a continuation line. */
+ GHOSTTY_ROW_SEMANTIC_PROMPT_CONTINUATION = 2,
+} GhosttyRowSemanticPrompt;
+
+/**
+ * Row data types.
+ *
+ * These values specify what type of data to extract from a row
+ * using `ghostty_row_get`.
+ *
+ * @ingroup screen
+ */
+typedef enum {
+ /** Invalid data type. Never results in any data extraction. */
+ GHOSTTY_ROW_DATA_INVALID = 0,
+
+ /**
+ * Whether this row is soft-wrapped.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_ROW_DATA_WRAP = 1,
+
+ /**
+ * Whether this row is a continuation of a soft-wrapped row.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_ROW_DATA_WRAP_CONTINUATION = 2,
+
+ /**
+ * Whether any cells in this row have grapheme clusters.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_ROW_DATA_GRAPHEME = 3,
+
+ /**
+ * Whether any cells in this row have styling (may have false positives).
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_ROW_DATA_STYLED = 4,
+
+ /**
+ * Whether any cells in this row have hyperlinks (may have false positives).
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_ROW_DATA_HYPERLINK = 5,
+
+ /**
+ * The semantic prompt state of this row.
+ *
+ * Output type: GhosttyRowSemanticPrompt *
+ */
+ GHOSTTY_ROW_DATA_SEMANTIC_PROMPT = 6,
+
+ /**
+ * Whether this row contains a Kitty virtual placeholder.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_ROW_DATA_KITTY_VIRTUAL_PLACEHOLDER = 7,
+
+ /**
+ * Whether this row is dirty and requires a redraw.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_ROW_DATA_DIRTY = 8,
+} GhosttyRowData;
+
+/**
+ * Get data from a cell.
+ *
+ * Extracts typed data from the given cell based on the specified
+ * data type. The output pointer must be of the appropriate type for the
+ * requested data kind. Valid data types and output types are documented
+ * in the `GhosttyCellData` enum.
+ *
+ * @param cell The cell value
+ * @param data The type of data to extract
+ * @param out Pointer to store the extracted data (type depends on data parameter)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the
+ * data type is invalid
+ *
+ * @ingroup screen
+ */
+GHOSTTY_API GhosttyResult ghostty_cell_get(GhosttyCell cell,
+ GhosttyCellData data,
+ void *out);
+
+/**
+ * Get data from a row.
+ *
+ * Extracts typed data from the given row based on the specified
+ * data type. The output pointer must be of the appropriate type for the
+ * requested data kind. Valid data types and output types are documented
+ * in the `GhosttyRowData` enum.
+ *
+ * @param row The row value
+ * @param data The type of data to extract
+ * @param out Pointer to store the extracted data (type depends on data parameter)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the
+ * data type is invalid
+ *
+ * @ingroup screen
+ */
+GHOSTTY_API GhosttyResult ghostty_row_get(GhosttyRow row,
+ GhosttyRowData data,
+ void *out);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_SCREEN_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/sgr.h b/vendor/libghostty-vt/include/ghostty/vt/sgr.h
new file mode 100644
index 00000000..01ea3a35
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/sgr.h
@@ -0,0 +1,358 @@
+/**
+ * @file sgr.h
+ *
+ * SGR (Select Graphic Rendition) attribute parsing and handling.
+ */
+
+#ifndef GHOSTTY_VT_SGR_H
+#define GHOSTTY_VT_SGR_H
+
+/** @defgroup sgr SGR Parser
+ *
+ * SGR (Select Graphic Rendition) attribute parser.
+ *
+ * SGR sequences are the syntax used to set styling attributes such as
+ * bold, italic, underline, and colors for text in terminal emulators.
+ * For example, you may be familiar with sequences like `ESC[1;31m`. The
+ * `1;31` is the SGR attribute list.
+ *
+ * The parser processes SGR parameters from CSI sequences (e.g., `ESC[1;31m`)
+ * and returns individual text attributes like bold, italic, colors, etc.
+ * It supports both semicolon (`;`) and colon (`:`) separators, possibly mixed,
+ * and handles various color formats including 8-color, 16-color, 256-color,
+ * X11 named colors, and RGB in multiple formats.
+ *
+ * ## Basic Usage
+ *
+ * 1. Create a parser instance with ghostty_sgr_new()
+ * 2. Set SGR parameters with ghostty_sgr_set_params()
+ * 3. Iterate through attributes using ghostty_sgr_next()
+ * 4. Free the parser with ghostty_sgr_free() when done
+ *
+ * ## Example
+ *
+ * @snippet c-vt-sgr/src/main.c sgr-basic
+ *
+ * @{
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Opaque handle to an SGR parser instance.
+ *
+ * This handle represents an SGR (Select Graphic Rendition) parser that can
+ * be used to parse SGR sequences and extract individual text attributes.
+ *
+ * @ingroup sgr
+ */
+typedef struct GhosttySgrParserImpl* GhosttySgrParser;
+
+/**
+ * SGR attribute tags.
+ *
+ * These values identify the type of an SGR attribute in a tagged union.
+ * Use the tag to determine which field in the attribute value union to access.
+ *
+ * @ingroup sgr
+ */
+typedef enum {
+ GHOSTTY_SGR_ATTR_UNSET = 0,
+ GHOSTTY_SGR_ATTR_UNKNOWN = 1,
+ GHOSTTY_SGR_ATTR_BOLD = 2,
+ GHOSTTY_SGR_ATTR_RESET_BOLD = 3,
+ GHOSTTY_SGR_ATTR_ITALIC = 4,
+ GHOSTTY_SGR_ATTR_RESET_ITALIC = 5,
+ GHOSTTY_SGR_ATTR_FAINT = 6,
+ GHOSTTY_SGR_ATTR_UNDERLINE = 7,
+ GHOSTTY_SGR_ATTR_UNDERLINE_COLOR = 8,
+ GHOSTTY_SGR_ATTR_UNDERLINE_COLOR_256 = 9,
+ GHOSTTY_SGR_ATTR_RESET_UNDERLINE_COLOR = 10,
+ GHOSTTY_SGR_ATTR_OVERLINE = 11,
+ GHOSTTY_SGR_ATTR_RESET_OVERLINE = 12,
+ GHOSTTY_SGR_ATTR_BLINK = 13,
+ GHOSTTY_SGR_ATTR_RESET_BLINK = 14,
+ GHOSTTY_SGR_ATTR_INVERSE = 15,
+ GHOSTTY_SGR_ATTR_RESET_INVERSE = 16,
+ GHOSTTY_SGR_ATTR_INVISIBLE = 17,
+ GHOSTTY_SGR_ATTR_RESET_INVISIBLE = 18,
+ GHOSTTY_SGR_ATTR_STRIKETHROUGH = 19,
+ GHOSTTY_SGR_ATTR_RESET_STRIKETHROUGH = 20,
+ GHOSTTY_SGR_ATTR_DIRECT_COLOR_FG = 21,
+ GHOSTTY_SGR_ATTR_DIRECT_COLOR_BG = 22,
+ GHOSTTY_SGR_ATTR_BG_8 = 23,
+ GHOSTTY_SGR_ATTR_FG_8 = 24,
+ GHOSTTY_SGR_ATTR_RESET_FG = 25,
+ GHOSTTY_SGR_ATTR_RESET_BG = 26,
+ GHOSTTY_SGR_ATTR_BRIGHT_BG_8 = 27,
+ GHOSTTY_SGR_ATTR_BRIGHT_FG_8 = 28,
+ GHOSTTY_SGR_ATTR_BG_256 = 29,
+ GHOSTTY_SGR_ATTR_FG_256 = 30,
+} GhosttySgrAttributeTag;
+
+/**
+ * Underline style types.
+ *
+ * @ingroup sgr
+ */
+typedef enum {
+ GHOSTTY_SGR_UNDERLINE_NONE = 0,
+ GHOSTTY_SGR_UNDERLINE_SINGLE = 1,
+ GHOSTTY_SGR_UNDERLINE_DOUBLE = 2,
+ GHOSTTY_SGR_UNDERLINE_CURLY = 3,
+ GHOSTTY_SGR_UNDERLINE_DOTTED = 4,
+ GHOSTTY_SGR_UNDERLINE_DASHED = 5,
+} GhosttySgrUnderline;
+
+/**
+ * Unknown SGR attribute data.
+ *
+ * Contains the full parameter list and the partial list where parsing
+ * encountered an unknown or invalid sequence.
+ *
+ * @ingroup sgr
+ */
+typedef struct {
+ const uint16_t* full_ptr;
+ size_t full_len;
+ const uint16_t* partial_ptr;
+ size_t partial_len;
+} GhosttySgrUnknown;
+
+/**
+ * SGR attribute value union.
+ *
+ * This union contains all possible attribute values. Use the tag field
+ * to determine which union member is active. Attributes without associated
+ * data (like bold, italic) don't use the union value.
+ *
+ * @ingroup sgr
+ */
+typedef union {
+ GhosttySgrUnknown unknown;
+ GhosttySgrUnderline underline;
+ GhosttyColorRgb underline_color;
+ GhosttyColorPaletteIndex underline_color_256;
+ GhosttyColorRgb direct_color_fg;
+ GhosttyColorRgb direct_color_bg;
+ GhosttyColorPaletteIndex bg_8;
+ GhosttyColorPaletteIndex fg_8;
+ GhosttyColorPaletteIndex bright_bg_8;
+ GhosttyColorPaletteIndex bright_fg_8;
+ GhosttyColorPaletteIndex bg_256;
+ GhosttyColorPaletteIndex fg_256;
+ uint64_t _padding[8];
+} GhosttySgrAttributeValue;
+
+/**
+ * SGR attribute (tagged union).
+ *
+ * A complete SGR attribute with both its type tag and associated value.
+ * Always check the tag field to determine which value union member is valid.
+ *
+ * Attributes without associated data (e.g., GHOSTTY_SGR_ATTR_BOLD) can be
+ * identified by tag alone; the value union is not used for these and
+ * the memory in the value field is undefined.
+ *
+ * @ingroup sgr
+ */
+typedef struct {
+ GhosttySgrAttributeTag tag;
+ GhosttySgrAttributeValue value;
+} GhosttySgrAttribute;
+
+/**
+ * Create a new SGR parser instance.
+ *
+ * Creates a new SGR (Select Graphic Rendition) parser using the provided
+ * allocator. The parser must be freed using ghostty_sgr_free() when
+ * no longer needed.
+ *
+ * @param allocator Pointer to the allocator to use for memory management, or
+ * NULL to use the default allocator
+ * @param parser Pointer to store the created parser handle
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API GhosttyResult ghostty_sgr_new(const GhosttyAllocator* allocator,
+ GhosttySgrParser* parser);
+
+/**
+ * Free an SGR parser instance.
+ *
+ * Releases all resources associated with the SGR parser. After this call,
+ * the parser handle becomes invalid and must not be used. This includes
+ * any attributes previously returned by ghostty_sgr_next().
+ *
+ * @param parser The parser handle to free (may be NULL)
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API void ghostty_sgr_free(GhosttySgrParser parser);
+
+/**
+ * Reset an SGR parser instance to the beginning of the parameter list.
+ *
+ * Resets the parser's iteration state without clearing the parameters.
+ * After calling this, ghostty_sgr_next() will start from the beginning
+ * of the parameter list again.
+ *
+ * @param parser The parser handle to reset, must not be NULL
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API void ghostty_sgr_reset(GhosttySgrParser parser);
+
+/**
+ * Set SGR parameters for parsing.
+ *
+ * Sets the SGR parameter list to parse. Parameters are the numeric values
+ * from a CSI SGR sequence (e.g., for `ESC[1;31m`, params would be {1, 31}).
+ *
+ * The separators array optionally specifies the separator type for each
+ * parameter position. Each byte should be either ';' for semicolon or ':'
+ * for colon. This is needed for certain color formats that use colon
+ * separators (e.g., `ESC[4:3m` for curly underline). Any invalid separator
+ * values are treated as semicolons. The separators array must have the same
+ * length as the params array, if it is not NULL.
+ *
+ * If separators is NULL, all parameters are assumed to be semicolon-separated.
+ *
+ * This function makes an internal copy of the parameter and separator data,
+ * so the caller can safely free or modify the input arrays after this call.
+ *
+ * After calling this function, the parser is automatically reset and ready
+ * to iterate from the beginning.
+ *
+ * @param parser The parser handle, must not be NULL
+ * @param params Array of SGR parameter values
+ * @param separators Optional array of separator characters (';' or ':'), or
+ * NULL
+ * @param len Number of parameters (and separators if provided)
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API GhosttyResult ghostty_sgr_set_params(GhosttySgrParser parser,
+ const uint16_t* params,
+ const char* separators,
+ size_t len);
+
+/**
+ * Get the next SGR attribute.
+ *
+ * Parses and returns the next attribute from the parameter list.
+ * Call this function repeatedly until it returns false to process
+ * all attributes in the sequence.
+ *
+ * @param parser The parser handle, must not be NULL
+ * @param attr Pointer to store the next attribute
+ * @return true if an attribute was returned, false if no more attributes
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API bool ghostty_sgr_next(GhosttySgrParser parser, GhosttySgrAttribute* attr);
+
+/**
+ * Get the full parameter list from an unknown SGR attribute.
+ *
+ * This function retrieves the full parameter list that was provided to the
+ * parser when an unknown attribute was encountered. Primarily useful in
+ * WebAssembly environments where accessing struct fields directly is difficult.
+ *
+ * @param unknown The unknown attribute data
+ * @param ptr Pointer to store the pointer to the parameter array (may be NULL)
+ * @return The length of the full parameter array
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API size_t ghostty_sgr_unknown_full(GhosttySgrUnknown unknown,
+ const uint16_t** ptr);
+
+/**
+ * Get the partial parameter list from an unknown SGR attribute.
+ *
+ * This function retrieves the partial parameter list where parsing stopped
+ * when an unknown attribute was encountered. Primarily useful in WebAssembly
+ * environments where accessing struct fields directly is difficult.
+ *
+ * @param unknown The unknown attribute data
+ * @param ptr Pointer to store the pointer to the parameter array (may be NULL)
+ * @return The length of the partial parameter array
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API size_t ghostty_sgr_unknown_partial(GhosttySgrUnknown unknown,
+ const uint16_t** ptr);
+
+/**
+ * Get the tag from an SGR attribute.
+ *
+ * This function extracts the tag that identifies which type of attribute
+ * this is. Primarily useful in WebAssembly environments where accessing
+ * struct fields directly is difficult.
+ *
+ * @param attr The SGR attribute
+ * @return The attribute tag
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API GhosttySgrAttributeTag ghostty_sgr_attribute_tag(GhosttySgrAttribute attr);
+
+/**
+ * Get the value from an SGR attribute.
+ *
+ * This function returns a pointer to the value union from an SGR attribute. Use
+ * the tag to determine which field of the union is valid. Primarily useful in
+ * WebAssembly environments where accessing struct fields directly is difficult.
+ *
+ * @param attr Pointer to the SGR attribute
+ * @return Pointer to the attribute value union
+ *
+ * @ingroup sgr
+ */
+GHOSTTY_API GhosttySgrAttributeValue* ghostty_sgr_attribute_value(
+ GhosttySgrAttribute* attr);
+
+#ifdef __wasm__
+/**
+ * Allocate memory for an SGR attribute (WebAssembly only).
+ *
+ * This is a convenience function for WebAssembly environments to allocate
+ * memory for an SGR attribute structure that can be passed to ghostty_sgr_next.
+ *
+ * @return Pointer to the allocated attribute structure
+ *
+ * @ingroup wasm
+ */
+GHOSTTY_API GhosttySgrAttribute* ghostty_wasm_alloc_sgr_attribute(void);
+
+/**
+ * Free memory for an SGR attribute (WebAssembly only).
+ *
+ * Frees memory allocated by ghostty_wasm_alloc_sgr_attribute.
+ *
+ * @param attr Pointer to the attribute structure to free
+ *
+ * @ingroup wasm
+ */
+GHOSTTY_API void ghostty_wasm_free_sgr_attribute(GhosttySgrAttribute* attr);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
+
+#endif /* GHOSTTY_VT_SGR_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/size_report.h b/vendor/libghostty-vt/include/ghostty/vt/size_report.h
new file mode 100644
index 00000000..98c67c5e
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/size_report.h
@@ -0,0 +1,100 @@
+/**
+ * @file size_report.h
+ *
+ * Size report encoding - encode terminal size reports into escape sequences.
+ */
+
+#ifndef GHOSTTY_VT_SIZE_REPORT_H
+#define GHOSTTY_VT_SIZE_REPORT_H
+
+/** @defgroup size_report Size Report Encoding
+ *
+ * Utilities for encoding terminal size reports into escape sequences,
+ * supporting in-band size reports (mode 2048) and XTWINOPS responses
+ * (CSI 14 t, CSI 16 t, CSI 18 t).
+ *
+ * ## Basic Usage
+ *
+ * Use ghostty_size_report_encode() to encode a size report into a
+ * caller-provided buffer. If the buffer is too small, the function
+ * returns GHOSTTY_OUT_OF_SPACE and sets the required size in the
+ * output parameter.
+ *
+ * ## Example
+ *
+ * @snippet c-vt-size-report/src/main.c size-report-encode
+ *
+ * @{
+ */
+
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Size report style.
+ *
+ * Determines the output format for the terminal size report.
+ */
+typedef enum {
+ /** In-band size report (mode 2048): ESC [ 48 ; rows ; cols ; height ; width t */
+ GHOSTTY_SIZE_REPORT_MODE_2048 = 0,
+ /** XTWINOPS text area size in pixels: ESC [ 4 ; height ; width t */
+ GHOSTTY_SIZE_REPORT_CSI_14_T = 1,
+ /** XTWINOPS cell size in pixels: ESC [ 6 ; height ; width t */
+ GHOSTTY_SIZE_REPORT_CSI_16_T = 2,
+ /** XTWINOPS text area size in characters: ESC [ 8 ; rows ; cols t */
+ GHOSTTY_SIZE_REPORT_CSI_18_T = 3,
+} GhosttySizeReportStyle;
+
+/**
+ * Terminal size information for encoding size reports.
+ */
+typedef struct {
+ /** Terminal row count in cells. */
+ uint16_t rows;
+ /** Terminal column count in cells. */
+ uint16_t columns;
+ /** Width of a single terminal cell in pixels. */
+ uint32_t cell_width;
+ /** Height of a single terminal cell in pixels. */
+ uint32_t cell_height;
+} GhosttySizeReportSize;
+
+/**
+ * Encode a terminal size report into an escape sequence.
+ *
+ * Encodes a size report in the format specified by @p style into the
+ * provided buffer.
+ *
+ * If the buffer is too small, the function returns GHOSTTY_OUT_OF_SPACE
+ * and writes the required buffer size to @p out_written. The caller can
+ * then retry with a sufficiently sized buffer.
+ *
+ * @param style The size report format to encode
+ * @param size Terminal size information
+ * @param buf Output buffer to write the encoded sequence into (may be NULL)
+ * @param buf_len Size of the output buffer in bytes
+ * @param[out] out_written On success, the number of bytes written. On
+ * GHOSTTY_OUT_OF_SPACE, the required buffer size.
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_OUT_OF_SPACE if the buffer
+ * is too small
+ */
+GHOSTTY_API GhosttyResult ghostty_size_report_encode(
+ GhosttySizeReportStyle style,
+ GhosttySizeReportSize size,
+ char* buf,
+ size_t buf_len,
+ size_t* out_written);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
+
+#endif /* GHOSTTY_VT_SIZE_REPORT_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/style.h b/vendor/libghostty-vt/include/ghostty/vt/style.h
new file mode 100644
index 00000000..ac049560
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/style.h
@@ -0,0 +1,138 @@
+/**
+ * @file style.h
+ *
+ * Terminal cell style types.
+ */
+
+#ifndef GHOSTTY_VT_STYLE_H
+#define GHOSTTY_VT_STYLE_H
+
+#include
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup style Style
+ *
+ * Terminal cell style attributes.
+ *
+ * A style describes the visual attributes of a terminal cell, including
+ * foreground, background, and underline colors, as well as flags for
+ * bold, italic, underline, and other text decorations.
+ *
+ * @{
+ */
+
+/**
+ * Style identifier type.
+ *
+ * Used to look up the full style from a grid reference.
+ * Obtain this from a cell via GHOSTTY_CELL_DATA_STYLE_ID.
+ *
+ * @ingroup style
+ */
+typedef uint16_t GhosttyStyleId;
+
+/**
+ * Style color tags.
+ *
+ * These values identify the type of color in a style color.
+ * Use the tag to determine which field in the color value union to access.
+ *
+ * @ingroup style
+ */
+typedef enum {
+ GHOSTTY_STYLE_COLOR_NONE = 0,
+ GHOSTTY_STYLE_COLOR_PALETTE = 1,
+ GHOSTTY_STYLE_COLOR_RGB = 2,
+} GhosttyStyleColorTag;
+
+/**
+ * Style color value union.
+ *
+ * Use the tag to determine which field is active.
+ *
+ * @ingroup style
+ */
+typedef union {
+ GhosttyColorPaletteIndex palette;
+ GhosttyColorRgb rgb;
+ uint64_t _padding;
+} GhosttyStyleColorValue;
+
+/**
+ * Style color (tagged union).
+ *
+ * A color used in a style attribute. Can be unset (none), a palette
+ * index, or a direct RGB value.
+ *
+ * @ingroup style
+ */
+typedef struct {
+ GhosttyStyleColorTag tag;
+ GhosttyStyleColorValue value;
+} GhosttyStyleColor;
+
+/**
+ * Terminal cell style.
+ *
+ * Describes the complete visual style for a terminal cell, including
+ * foreground, background, and underline colors, as well as text
+ * decoration flags. The underline field uses the same values as
+ * GhosttySgrUnderline.
+ *
+ * This is a sized struct. Use GHOSTTY_INIT_SIZED() to initialize it.
+ *
+ * @ingroup style
+ */
+typedef struct {
+ size_t size;
+ GhosttyStyleColor fg_color;
+ GhosttyStyleColor bg_color;
+ GhosttyStyleColor underline_color;
+ bool bold;
+ bool italic;
+ bool faint;
+ bool blink;
+ bool inverse;
+ bool invisible;
+ bool strikethrough;
+ bool overline;
+ int underline; /**< One of GHOSTTY_SGR_UNDERLINE_* values */
+} GhosttyStyle;
+
+/**
+ * Get the default style.
+ *
+ * Initializes the style to the default values (no colors, no flags).
+ *
+ * @param style Pointer to the style to initialize
+ *
+ * @ingroup style
+ */
+GHOSTTY_API void ghostty_style_default(GhosttyStyle* style);
+
+/**
+ * Check if a style is the default style.
+ *
+ * Returns true if all colors are unset and all flags are off.
+ *
+ * @param style Pointer to the style to check
+ * @return true if the style is the default style
+ *
+ * @ingroup style
+ */
+GHOSTTY_API bool ghostty_style_is_default(const GhosttyStyle* style);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
+
+#endif /* GHOSTTY_VT_STYLE_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/terminal.h b/vendor/libghostty-vt/include/ghostty/vt/terminal.h
new file mode 100644
index 00000000..b43e37cf
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/terminal.h
@@ -0,0 +1,983 @@
+/**
+ * @file terminal.h
+ *
+ * Complete terminal emulator state and rendering.
+ */
+
+#ifndef GHOSTTY_VT_TERMINAL_H
+#define GHOSTTY_VT_TERMINAL_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup terminal Terminal
+ *
+ * Complete terminal emulator state and rendering.
+ *
+ * A terminal instance manages the full emulator state including the screen,
+ * scrollback, cursor, styles, modes, and VT stream processing.
+ *
+ * Once a terminal session is up and running, you can configure a key encoder
+ * to write keyboard input via ghostty_key_encoder_setopt_from_terminal().
+ *
+ * ### Example: VT stream processing
+ * @snippet c-vt-stream/src/main.c vt-stream-init
+ * @snippet c-vt-stream/src/main.c vt-stream-write
+ *
+ * ## Effects
+ *
+ * By default, the terminal sequence processing with ghostty_terminal_vt_write()
+ * only process sequences that directly affect terminal state and
+ * ignores sequences that have side effect behavior or require responses.
+ * These sequences include things like bell characters, title changes, device
+ * attributes queries, and more. To handle these sequences, the embedder
+ * must configure "effects."
+ *
+ * Effects are callbacks that the terminal invokes in response to VT
+ * sequences processed during ghostty_terminal_vt_write(). They let the
+ * embedding application react to terminal-initiated events such as bell
+ * characters, title changes, device status report responses, and more.
+ *
+ * Each effect is registered with ghostty_terminal_set() using the
+ * corresponding `GhosttyTerminalOption` identifier. A `NULL` value
+ * pointer clears the callback and disables the effect.
+ *
+ * A userdata pointer can be attached via `GHOSTTY_TERMINAL_OPT_USERDATA`
+ * and is passed to every callback, allowing callers to route events
+ * back to their own application state without global variables.
+ * You cannot specify different userdata for different callbacks.
+ *
+ * All callbacks are invoked synchronously during
+ * ghostty_terminal_vt_write(). Callbacks **must not** call
+ * ghostty_terminal_vt_write() on the same terminal (no reentrancy).
+ * And callbacks must be very careful to not block for too long or perform
+ * expensive operations, since they are blocking further IO processing.
+ *
+ * The available effects are:
+ *
+ * | Option | Callback Type | Trigger |
+ * |-----------------------------------------|-----------------------------------|-------------------------------------------|
+ * | `GHOSTTY_TERMINAL_OPT_WRITE_PTY` | `GhosttyTerminalWritePtyFn` | Query responses written back to the pty |
+ * | `GHOSTTY_TERMINAL_OPT_BELL` | `GhosttyTerminalBellFn` | BEL character (0x07) |
+ * | `GHOSTTY_TERMINAL_OPT_TITLE_CHANGED` | `GhosttyTerminalTitleChangedFn` | Title change via OSC 0 / OSC 2 |
+ * | `GHOSTTY_TERMINAL_OPT_ENQUIRY` | `GhosttyTerminalEnquiryFn` | ENQ character (0x05) |
+ * | `GHOSTTY_TERMINAL_OPT_XTVERSION` | `GhosttyTerminalXtversionFn` | XTVERSION query (CSI > q) |
+ * | `GHOSTTY_TERMINAL_OPT_SIZE` | `GhosttyTerminalSizeFn` | XTWINOPS size query (CSI 14/16/18 t) |
+ * | `GHOSTTY_TERMINAL_OPT_COLOR_SCHEME` | `GhosttyTerminalColorSchemeFn` | Color scheme query (CSI ? 996 n) |
+ * | `GHOSTTY_TERMINAL_OPT_DEVICE_ATTRIBUTES`| `GhosttyTerminalDeviceAttributesFn`| Device attributes query (CSI c / > c / = c)|
+ *
+ * ### Defining a write_pty callback
+ * @snippet c-vt-effects/src/main.c effects-write-pty
+ *
+ * ### Defining a bell callback
+ * @snippet c-vt-effects/src/main.c effects-bell
+ *
+ * ### Defining a title_changed callback
+ * @snippet c-vt-effects/src/main.c effects-title-changed
+ *
+ * ### Registering effects and processing VT data
+ * @snippet c-vt-effects/src/main.c effects-register
+ *
+ * ## Color Theme
+ *
+ * The terminal maintains a set of colors used for rendering: a foreground
+ * color, a background color, a cursor color, and a 256-color palette. Each
+ * of these has two layers: a **default** value set by the embedder, and an
+ * **override** value that programs running in the terminal can set via OSC
+ * escape sequences (e.g. OSC 10/11/12 for foreground/background/cursor,
+ * OSC 4 for individual palette entries).
+ *
+ * ### Default Colors
+ *
+ * Use ghostty_terminal_set() with the color options to configure the
+ * default colors. These represent the theme or configuration chosen by
+ * the embedder. Passing `NULL` clears the default, leaving the color
+ * unset.
+ *
+ * | Option | Input Type | Description |
+ * |-----------------------------------------|-------------------------|--------------------------------------|
+ * | `GHOSTTY_TERMINAL_OPT_COLOR_FOREGROUND` | `GhosttyColorRgb*` | Default foreground color |
+ * | `GHOSTTY_TERMINAL_OPT_COLOR_BACKGROUND` | `GhosttyColorRgb*` | Default background color |
+ * | `GHOSTTY_TERMINAL_OPT_COLOR_CURSOR` | `GhosttyColorRgb*` | Default cursor color |
+ * | `GHOSTTY_TERMINAL_OPT_COLOR_PALETTE` | `GhosttyColorRgb[256]*` | Default 256-color palette |
+ *
+ * For the palette, passing `NULL` resets to the built-in default palette.
+ * The palette set operation preserves any per-index OSC overrides that
+ * programs have applied; only unmodified indices are updated.
+ *
+ * ### Reading colors
+ *
+ * Use ghostty_terminal_get() to read colors. There are two variants for
+ * each color: the **effective** value (which returns the OSC override if
+ * one is active, otherwise the default) and the **default** value (which
+ * ignores any OSC overrides).
+ *
+ * | Data | Output Type | Description |
+ * |---------------------------------------------------|-------------------------|------------------------------------------------|
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND` | `GhosttyColorRgb*` | Effective foreground (override or default) |
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND` | `GhosttyColorRgb*` | Effective background (override or default) |
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_CURSOR` | `GhosttyColorRgb*` | Effective cursor (override or default) |
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_PALETTE` | `GhosttyColorRgb[256]*` | Current palette (with any OSC overrides) |
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND_DEFAULT` | `GhosttyColorRgb*` | Default foreground only (ignores OSC override) |
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND_DEFAULT` | `GhosttyColorRgb*` | Default background only (ignores OSC override) |
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_CURSOR_DEFAULT` | `GhosttyColorRgb*` | Default cursor only (ignores OSC override) |
+ * | `GHOSTTY_TERMINAL_DATA_COLOR_PALETTE_DEFAULT` | `GhosttyColorRgb[256]*` | Default palette only (ignores OSC overrides) |
+ *
+ * For foreground, background, and cursor colors, the getters return
+ * `GHOSTTY_NO_VALUE` if no color is configured (neither a default nor an
+ * OSC override). The palette getters always succeed since the palette
+ * always has a value (the built-in default if nothing else is set).
+ *
+ * ### Setting a color theme
+ * @snippet c-vt-colors/src/main.c colors-set-defaults
+ *
+ * ### Reading effective and default colors
+ * @snippet c-vt-colors/src/main.c colors-read
+ *
+ * ### Full example with OSC overrides
+ * @snippet c-vt-colors/src/main.c colors-main
+ *
+ * @{
+ */
+
+/**
+ * Opaque handle to a terminal instance.
+ *
+ * @ingroup terminal
+ */
+typedef struct GhosttyTerminalImpl* GhosttyTerminal;
+
+/**
+ * Terminal initialization options.
+ *
+ * @ingroup terminal
+ */
+typedef struct {
+ /** Terminal width in cells. Must be greater than zero. */
+ uint16_t cols;
+
+ /** Terminal height in cells. Must be greater than zero. */
+ uint16_t rows;
+
+ /** Maximum number of lines to keep in scrollback history. */
+ size_t max_scrollback;
+
+ // TODO: Consider ABI compatibility implications of this struct.
+ // We may want to artificially pad it significantly to support
+ // future options.
+} GhosttyTerminalOptions;
+
+/**
+ * Scroll viewport behavior tag.
+ *
+ * @ingroup terminal
+ */
+typedef enum {
+ /** Scroll to the top of the scrollback. */
+ GHOSTTY_SCROLL_VIEWPORT_TOP,
+
+ /** Scroll to the bottom (active area). */
+ GHOSTTY_SCROLL_VIEWPORT_BOTTOM,
+
+ /** Scroll by a delta amount (up is negative). */
+ GHOSTTY_SCROLL_VIEWPORT_DELTA,
+} GhosttyTerminalScrollViewportTag;
+
+/**
+ * Scroll viewport value.
+ *
+ * @ingroup terminal
+ */
+typedef union {
+ /** Scroll delta (only used with GHOSTTY_SCROLL_VIEWPORT_DELTA). Up is negative. */
+ intptr_t delta;
+
+ /** Padding for ABI compatibility. Do not use. */
+ uint64_t _padding[2];
+} GhosttyTerminalScrollViewportValue;
+
+/**
+ * Tagged union for scroll viewport behavior.
+ *
+ * @ingroup terminal
+ */
+typedef struct {
+ GhosttyTerminalScrollViewportTag tag;
+ GhosttyTerminalScrollViewportValue value;
+} GhosttyTerminalScrollViewport;
+
+/**
+ * Terminal screen identifier.
+ *
+ * Identifies which screen buffer is active in the terminal.
+ *
+ * @ingroup terminal
+ */
+typedef enum {
+ /** The primary (normal) screen. */
+ GHOSTTY_TERMINAL_SCREEN_PRIMARY = 0,
+
+ /** The alternate screen. */
+ GHOSTTY_TERMINAL_SCREEN_ALTERNATE = 1,
+} GhosttyTerminalScreen;
+
+/**
+ * Scrollbar state for the terminal viewport.
+ *
+ * Represents the scrollable area dimensions needed to render a scrollbar.
+ *
+ * @ingroup terminal
+ */
+typedef struct {
+ /** Total size of the scrollable area in rows. */
+ uint64_t total;
+
+ /** Offset into the total area that the viewport is at. */
+ uint64_t offset;
+
+ /** Length of the visible area in rows. */
+ uint64_t len;
+} GhosttyTerminalScrollbar;
+
+/**
+ * Callback function type for bell.
+ *
+ * Called when the terminal receives a BEL character (0x07).
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ *
+ * @ingroup terminal
+ */
+typedef void (*GhosttyTerminalBellFn)(GhosttyTerminal terminal,
+ void* userdata);
+
+/**
+ * Callback function type for color scheme queries (CSI ? 996 n).
+ *
+ * Called when the terminal receives a color scheme device status report
+ * query. Return true and fill *out_scheme with the current color scheme,
+ * or return false to silently ignore the query.
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ * @param[out] out_scheme Pointer to store the current color scheme
+ * @return true if the color scheme was filled, false to ignore the query
+ *
+ * @ingroup terminal
+ */
+typedef bool (*GhosttyTerminalColorSchemeFn)(GhosttyTerminal terminal,
+ void* userdata,
+ GhosttyColorScheme* out_scheme);
+
+/**
+ * Callback function type for device attributes queries (DA1/DA2/DA3).
+ *
+ * Called when the terminal receives a device attributes query (CSI c,
+ * CSI > c, or CSI = c). Return true and fill *out_attrs with the
+ * response data, or return false to silently ignore the query.
+ *
+ * The terminal uses whichever sub-struct (primary, secondary, tertiary)
+ * matches the request type, but all three should be filled for simplicity.
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ * @param[out] out_attrs Pointer to store the device attributes response
+ * @return true if attributes were filled, false to ignore the query
+ *
+ * @ingroup terminal
+ */
+typedef bool (*GhosttyTerminalDeviceAttributesFn)(GhosttyTerminal terminal,
+ void* userdata,
+ GhosttyDeviceAttributes* out_attrs);
+
+/**
+ * Callback function type for enquiry (ENQ, 0x05).
+ *
+ * Called when the terminal receives an ENQ character. Return the
+ * response bytes as a GhosttyString. The memory must remain valid
+ * until the callback returns. Return a zero-length string to send
+ * no response.
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ * @return The response bytes to write back to the pty
+ *
+ * @ingroup terminal
+ */
+typedef GhosttyString (*GhosttyTerminalEnquiryFn)(GhosttyTerminal terminal,
+ void* userdata);
+
+/**
+ * Callback function type for size queries (XTWINOPS).
+ *
+ * Called in response to XTWINOPS size queries (CSI 14/16/18 t).
+ * Return true and fill *out_size with the current terminal geometry,
+ * or return false to silently ignore the query.
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ * @param[out] out_size Pointer to store the terminal size information
+ * @return true if size was filled, false to ignore the query
+ *
+ * @ingroup terminal
+ */
+typedef bool (*GhosttyTerminalSizeFn)(GhosttyTerminal terminal,
+ void* userdata,
+ GhosttySizeReportSize* out_size);
+
+/**
+ * Callback function type for title_changed.
+ *
+ * Called when the terminal title changes via escape sequences
+ * (e.g. OSC 0 or OSC 2). The new title can be queried from the
+ * terminal after the callback returns.
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ *
+ * @ingroup terminal
+ */
+typedef void (*GhosttyTerminalTitleChangedFn)(GhosttyTerminal terminal,
+ void* userdata);
+
+/**
+ * Callback function type for write_pty.
+ *
+ * Called when the terminal needs to write data back to the pty, for
+ * example in response to a device status report or mode query. The
+ * data is only valid for the duration of the call; callers must copy
+ * it if it needs to persist.
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ * @param data Pointer to the response bytes
+ * @param len Length of the response in bytes
+ *
+ * @ingroup terminal
+ */
+typedef void (*GhosttyTerminalWritePtyFn)(GhosttyTerminal terminal,
+ void* userdata,
+ const uint8_t* data,
+ size_t len);
+
+/**
+ * Callback function type for XTVERSION.
+ *
+ * Called when the terminal receives an XTVERSION query (CSI > q).
+ * Return the version string (e.g. "myterm 1.0") as a GhosttyString.
+ * The memory must remain valid until the callback returns. Return a
+ * zero-length string to report the default "libghostty" version.
+ *
+ * @param terminal The terminal handle
+ * @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
+ * @return The version string to report
+ *
+ * @ingroup terminal
+ */
+typedef GhosttyString (*GhosttyTerminalXtversionFn)(GhosttyTerminal terminal,
+ void* userdata);
+
+/**
+ * Terminal option identifiers.
+ *
+ * These values are used with ghostty_terminal_set() to configure
+ * terminal callbacks and associated state.
+ *
+ * @ingroup terminal
+ */
+typedef enum {
+ /**
+ * Opaque userdata pointer passed to all callbacks.
+ *
+ * Input type: void*
+ */
+ GHOSTTY_TERMINAL_OPT_USERDATA = 0,
+
+ /**
+ * Callback invoked when the terminal needs to write data back
+ * to the pty (e.g. in response to a DECRQM query or device
+ * status report). Set to NULL to ignore such sequences.
+ *
+ * Input type: GhosttyTerminalWritePtyFn
+ */
+ GHOSTTY_TERMINAL_OPT_WRITE_PTY = 1,
+
+ /**
+ * Callback invoked when the terminal receives a BEL character
+ * (0x07). Set to NULL to ignore bell events.
+ *
+ * Input type: GhosttyTerminalBellFn
+ */
+ GHOSTTY_TERMINAL_OPT_BELL = 2,
+
+ /**
+ * Callback invoked when the terminal receives an ENQ character
+ * (0x05). Set to NULL to send no response.
+ *
+ * Input type: GhosttyTerminalEnquiryFn
+ */
+ GHOSTTY_TERMINAL_OPT_ENQUIRY = 3,
+
+ /**
+ * Callback invoked when the terminal receives an XTVERSION query
+ * (CSI > q). Set to NULL to report the default "libghostty" string.
+ *
+ * Input type: GhosttyTerminalXtversionFn
+ */
+ GHOSTTY_TERMINAL_OPT_XTVERSION = 4,
+
+ /**
+ * Callback invoked when the terminal title changes via escape
+ * sequences (e.g. OSC 0 or OSC 2). Set to NULL to ignore title
+ * change events.
+ *
+ * Input type: GhosttyTerminalTitleChangedFn
+ */
+ GHOSTTY_TERMINAL_OPT_TITLE_CHANGED = 5,
+
+ /**
+ * Callback invoked in response to XTWINOPS size queries
+ * (CSI 14/16/18 t). Set to NULL to silently ignore size queries.
+ *
+ * Input type: GhosttyTerminalSizeFn
+ */
+ GHOSTTY_TERMINAL_OPT_SIZE = 6,
+
+ /**
+ * Callback invoked in response to a color scheme device status
+ * report query (CSI ? 996 n). Return true and fill the out pointer
+ * to report the current scheme, or return false to silently ignore.
+ * Set to NULL to ignore color scheme queries.
+ *
+ * Input type: GhosttyTerminalColorSchemeFn
+ */
+ GHOSTTY_TERMINAL_OPT_COLOR_SCHEME = 7,
+
+ /**
+ * Callback invoked in response to a device attributes query
+ * (CSI c, CSI > c, or CSI = c). Return true and fill the out
+ * pointer with response data, or return false to silently ignore.
+ * Set to NULL to ignore device attributes queries.
+ *
+ * Input type: GhosttyTerminalDeviceAttributesFn
+ */
+ GHOSTTY_TERMINAL_OPT_DEVICE_ATTRIBUTES = 8,
+
+ /**
+ * Set the terminal title manually.
+ *
+ * The string data is copied into the terminal. A NULL value pointer
+ * clears the title (equivalent to setting an empty string).
+ *
+ * Input type: GhosttyString*
+ */
+ GHOSTTY_TERMINAL_OPT_TITLE = 9,
+
+ /**
+ * Set the terminal working directory manually.
+ *
+ * The string data is copied into the terminal. A NULL value pointer
+ * clears the pwd (equivalent to setting an empty string).
+ *
+ * Input type: GhosttyString*
+ */
+ GHOSTTY_TERMINAL_OPT_PWD = 10,
+
+ /**
+ * Set the default foreground color.
+ *
+ * A NULL value pointer clears the default (unset).
+ *
+ * Input type: GhosttyColorRgb*
+ */
+ GHOSTTY_TERMINAL_OPT_COLOR_FOREGROUND = 11,
+
+ /**
+ * Set the default background color.
+ *
+ * A NULL value pointer clears the default (unset).
+ *
+ * Input type: GhosttyColorRgb*
+ */
+ GHOSTTY_TERMINAL_OPT_COLOR_BACKGROUND = 12,
+
+ /**
+ * Set the default cursor color.
+ *
+ * A NULL value pointer clears the default (unset).
+ *
+ * Input type: GhosttyColorRgb*
+ */
+ GHOSTTY_TERMINAL_OPT_COLOR_CURSOR = 13,
+
+ /**
+ * Set the default 256-color palette.
+ *
+ * The value must point to an array of exactly 256 GhosttyColorRgb values.
+ * A NULL value pointer resets to the built-in default palette.
+ *
+ * Input type: GhosttyColorRgb[256]*
+ */
+ GHOSTTY_TERMINAL_OPT_COLOR_PALETTE = 14,
+} GhosttyTerminalOption;
+
+/**
+ * Terminal data types.
+ *
+ * These values specify what type of data to extract from a terminal
+ * using `ghostty_terminal_get`.
+ *
+ * @ingroup terminal
+ */
+typedef enum {
+ /** Invalid data type. Never results in any data extraction. */
+ GHOSTTY_TERMINAL_DATA_INVALID = 0,
+
+ /**
+ * Terminal width in cells.
+ *
+ * Output type: uint16_t *
+ */
+ GHOSTTY_TERMINAL_DATA_COLS = 1,
+
+ /**
+ * Terminal height in cells.
+ *
+ * Output type: uint16_t *
+ */
+ GHOSTTY_TERMINAL_DATA_ROWS = 2,
+
+ /**
+ * Cursor column position (0-indexed).
+ *
+ * Output type: uint16_t *
+ */
+ GHOSTTY_TERMINAL_DATA_CURSOR_X = 3,
+
+ /**
+ * Cursor row position within the active area (0-indexed).
+ *
+ * Output type: uint16_t *
+ */
+ GHOSTTY_TERMINAL_DATA_CURSOR_Y = 4,
+
+ /**
+ * Whether the cursor has a pending wrap (next print will soft-wrap).
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_TERMINAL_DATA_CURSOR_PENDING_WRAP = 5,
+
+ /**
+ * The currently active screen.
+ *
+ * Output type: GhosttyTerminalScreen *
+ */
+ GHOSTTY_TERMINAL_DATA_ACTIVE_SCREEN = 6,
+
+ /**
+ * Whether the cursor is visible (DEC mode 25).
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_TERMINAL_DATA_CURSOR_VISIBLE = 7,
+
+ /**
+ * Current Kitty keyboard protocol flags.
+ *
+ * Output type: GhosttyKittyKeyFlags * (uint8_t *)
+ */
+ GHOSTTY_TERMINAL_DATA_KITTY_KEYBOARD_FLAGS = 8,
+
+ /**
+ * Scrollbar state for the terminal viewport.
+ *
+ * This may be expensive to calculate depending on where the viewport
+ * is (arbitrary pins are expensive). The caller should take care to only
+ * call this as needed and not too frequently.
+ *
+ * Output type: GhosttyTerminalScrollbar *
+ */
+ GHOSTTY_TERMINAL_DATA_SCROLLBAR = 9,
+
+ /**
+ * The current SGR style of the cursor.
+ *
+ * This is the style that will be applied to newly printed characters.
+ *
+ * Output type: GhosttyStyle *
+ */
+ GHOSTTY_TERMINAL_DATA_CURSOR_STYLE = 10,
+
+ /**
+ * Whether any mouse tracking mode is active.
+ *
+ * Returns true if any of the mouse tracking modes (X10, normal, button,
+ * or any-event) are enabled.
+ *
+ * Output type: bool *
+ */
+ GHOSTTY_TERMINAL_DATA_MOUSE_TRACKING = 11,
+
+ /**
+ * The terminal title as set by escape sequences (e.g. OSC 0/2).
+ *
+ * Returns a borrowed string. The pointer is valid until the next call
+ * to ghostty_terminal_vt_write() or ghostty_terminal_reset(). An empty
+ * string (len=0) is returned when no title has been set.
+ *
+ * Output type: GhosttyString *
+ */
+ GHOSTTY_TERMINAL_DATA_TITLE = 12,
+
+ /**
+ * The terminal's current working directory as set by escape sequences
+ * (e.g. OSC 7).
+ *
+ * Returns a borrowed string. The pointer is valid until the next call
+ * to ghostty_terminal_vt_write() or ghostty_terminal_reset(). An empty
+ * string (len=0) is returned when no pwd has been set.
+ *
+ * Output type: GhosttyString *
+ */
+ GHOSTTY_TERMINAL_DATA_PWD = 13,
+
+ /**
+ * The total number of rows in the active screen including scrollback.
+ *
+ * Output type: size_t *
+ */
+ GHOSTTY_TERMINAL_DATA_TOTAL_ROWS = 14,
+
+ /**
+ * The number of scrollback rows (total rows minus viewport rows).
+ *
+ * Output type: size_t *
+ */
+ GHOSTTY_TERMINAL_DATA_SCROLLBACK_ROWS = 15,
+
+ /**
+ * The total width of the terminal in pixels.
+ *
+ * This is cols * cell_width_px as set by ghostty_terminal_resize().
+ *
+ * Output type: uint32_t *
+ */
+ GHOSTTY_TERMINAL_DATA_WIDTH_PX = 16,
+
+ /**
+ * The total height of the terminal in pixels.
+ *
+ * This is rows * cell_height_px as set by ghostty_terminal_resize().
+ *
+ * Output type: uint32_t *
+ */
+ GHOSTTY_TERMINAL_DATA_HEIGHT_PX = 17,
+
+ /**
+ * The effective foreground color (override or default).
+ *
+ * Returns GHOSTTY_NO_VALUE if no foreground color is set.
+ *
+ * Output type: GhosttyColorRgb *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND = 18,
+
+ /**
+ * The effective background color (override or default).
+ *
+ * Returns GHOSTTY_NO_VALUE if no background color is set.
+ *
+ * Output type: GhosttyColorRgb *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND = 19,
+
+ /**
+ * The effective cursor color (override or default).
+ *
+ * Returns GHOSTTY_NO_VALUE if no cursor color is set.
+ *
+ * Output type: GhosttyColorRgb *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_CURSOR = 20,
+
+ /**
+ * The current 256-color palette.
+ *
+ * Output type: GhosttyColorRgb[256] *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_PALETTE = 21,
+
+ /**
+ * The default foreground color (ignoring any OSC override).
+ *
+ * Returns GHOSTTY_NO_VALUE if no default foreground color is set.
+ *
+ * Output type: GhosttyColorRgb *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND_DEFAULT = 22,
+
+ /**
+ * The default background color (ignoring any OSC override).
+ *
+ * Returns GHOSTTY_NO_VALUE if no default background color is set.
+ *
+ * Output type: GhosttyColorRgb *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND_DEFAULT = 23,
+
+ /**
+ * The default cursor color (ignoring any OSC override).
+ *
+ * Returns GHOSTTY_NO_VALUE if no default cursor color is set.
+ *
+ * Output type: GhosttyColorRgb *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_CURSOR_DEFAULT = 24,
+
+ /**
+ * The default 256-color palette (ignoring any OSC overrides).
+ *
+ * Output type: GhosttyColorRgb[256] *
+ */
+ GHOSTTY_TERMINAL_DATA_COLOR_PALETTE_DEFAULT = 25,
+} GhosttyTerminalData;
+
+/**
+ * Create a new terminal instance.
+ *
+ * @param allocator Pointer to allocator, or NULL to use the default allocator
+ * @param terminal Pointer to store the created terminal handle
+ * @param options Terminal initialization options
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API GhosttyResult ghostty_terminal_new(const GhosttyAllocator* allocator,
+ GhosttyTerminal* terminal,
+ GhosttyTerminalOptions options);
+
+/**
+ * Free a terminal instance.
+ *
+ * Releases all resources associated with the terminal. After this call,
+ * the terminal handle becomes invalid and must not be used.
+ *
+ * @param terminal The terminal handle to free (may be NULL)
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API void ghostty_terminal_free(GhosttyTerminal terminal);
+
+/**
+ * Perform a full reset of the terminal (RIS).
+ *
+ * Resets all terminal state back to its initial configuration, including
+ * modes, scrollback, scrolling region, and screen contents. The terminal
+ * dimensions are preserved.
+ *
+ * @param terminal The terminal handle (may be NULL, in which case this is a no-op)
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API void ghostty_terminal_reset(GhosttyTerminal terminal);
+
+/**
+ * Resize the terminal to the given dimensions.
+ *
+ * Changes the number of columns and rows in the terminal. The primary
+ * screen will reflow content if wraparound mode is enabled; the alternate
+ * screen does not reflow. If the dimensions are unchanged, this is a no-op.
+ *
+ * This also updates the terminal's pixel dimensions (used for image
+ * protocols and size reports), disables synchronized output mode (allowed
+ * by the spec so that resize results are shown immediately), and sends an
+ * in-band size report if mode 2048 is enabled.
+ *
+ * @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param cols New width in cells (must be greater than zero)
+ * @param rows New height in cells (must be greater than zero)
+ * @param cell_width_px Width of a single cell in pixels
+ * @param cell_height_px Height of a single cell in pixels
+ * @return GHOSTTY_SUCCESS on success, or an error code on failure
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API GhosttyResult ghostty_terminal_resize(GhosttyTerminal terminal,
+ uint16_t cols,
+ uint16_t rows,
+ uint32_t cell_width_px,
+ uint32_t cell_height_px);
+
+/**
+ * Set an option on the terminal.
+ *
+ * Configures terminal callbacks and associated state such as the
+ * write_pty callback and userdata pointer. The value is passed
+ * directly for pointer types (callbacks, userdata) or as a pointer
+ * to the value for non-pointer types (e.g. GhosttyString*).
+ * NULL clears the option to its default.
+ *
+ * Callbacks are invoked synchronously during ghostty_terminal_vt_write().
+ * Callbacks must not call ghostty_terminal_vt_write() on the same
+ * terminal (no reentrancy).
+ *
+ * @param terminal The terminal handle (may be NULL, in which case this is a no-op)
+ * @param option The option to set
+ * @param value Pointer to the value to set (type depends on the option),
+ * or NULL to clear the option
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API GhosttyResult ghostty_terminal_set(GhosttyTerminal terminal,
+ GhosttyTerminalOption option,
+ const void* value);
+
+/**
+ * Write VT-encoded data to the terminal for processing.
+ *
+ * Feeds raw bytes through the terminal's VT stream parser, updating
+ * terminal state accordingly. By default, sequences that require output
+ * (queries, device status reports) are silently ignored. Use
+ * ghostty_terminal_set() with GHOSTTY_TERMINAL_OPT_WRITE_PTY to install
+ * a callback that receives response data.
+ *
+ * This never fails. Any erroneous input or errors in processing the
+ * input are logged internally but do not cause this function to fail
+ * because this input is assumed to be untrusted and from an external
+ * source; so the primary goal is to keep the terminal state consistent and
+ * not allow malformed input to corrupt or crash.
+ *
+ * @param terminal The terminal handle
+ * @param data Pointer to the data to write
+ * @param len Length of the data in bytes
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API void ghostty_terminal_vt_write(GhosttyTerminal terminal,
+ const uint8_t* data,
+ size_t len);
+
+/**
+ * Scroll the terminal viewport.
+ *
+ * Scrolls the terminal's viewport according to the given behavior.
+ * When using GHOSTTY_SCROLL_VIEWPORT_DELTA, set the delta field in
+ * the value union to specify the number of rows to scroll (negative
+ * for up, positive for down). For other behaviors, the value is ignored.
+ *
+ * @param terminal The terminal handle (may be NULL, in which case this is a no-op)
+ * @param behavior The scroll behavior as a tagged union
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API void ghostty_terminal_scroll_viewport(GhosttyTerminal terminal,
+ GhosttyTerminalScrollViewport behavior);
+
+/**
+ * Get the current value of a terminal mode.
+ *
+ * Returns the value of the mode identified by the given mode.
+ *
+ * @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param mode The mode identifying the mode to query
+ * @param[out] out_value On success, set to true if the mode is set, false
+ * if it is reset
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal
+ * is NULL or the mode does not correspond to a known mode
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API GhosttyResult ghostty_terminal_mode_get(GhosttyTerminal terminal,
+ GhosttyMode mode,
+ bool* out_value);
+
+/**
+ * Set the value of a terminal mode.
+ *
+ * Sets the mode identified by the given mode to the specified value.
+ *
+ * @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param mode The mode identifying the mode to set
+ * @param value true to set the mode, false to reset it
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal
+ * is NULL or the mode does not correspond to a known mode
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API GhosttyResult ghostty_terminal_mode_set(GhosttyTerminal terminal,
+ GhosttyMode mode,
+ bool value);
+
+/**
+ * Get data from a terminal instance.
+ *
+ * Extracts typed data from the given terminal based on the specified
+ * data type. The output pointer must be of the appropriate type for the
+ * requested data kind. Valid data types and output types are documented
+ * in the `GhosttyTerminalData` enum.
+ *
+ * @param terminal The terminal handle (may be NULL)
+ * @param data The type of data to extract
+ * @param out Pointer to store the extracted data (type depends on data parameter)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal
+ * is NULL or the data type is invalid
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API GhosttyResult ghostty_terminal_get(GhosttyTerminal terminal,
+ GhosttyTerminalData data,
+ void *out);
+
+/**
+ * Resolve a point in the terminal grid to a grid reference.
+ *
+ * Resolves the given point (which can be in active, viewport, screen,
+ * or history coordinates) to a grid reference for that location. Use
+ * ghostty_grid_ref_cell() and ghostty_grid_ref_row() to extract the cell
+ * and row.
+ *
+ * Lookups using the `active` and `viewport` tags are fast. The `screen`
+ * and `history` tags may require traversing the full scrollback page list
+ * to resolve the y coordinate, so they can be expensive for large
+ * scrollback buffers.
+ *
+ * This function isn't meant to be used as the core of render loop. It
+ * isn't built to sustain the framerates needed for rendering large screens.
+ * Use the render state API for that. This API is instead meant for less
+ * strictly performance-sensitive use cases.
+ *
+ * @param terminal The terminal handle (NULL returns GHOSTTY_INVALID_VALUE)
+ * @param point The point specifying which cell to look up
+ * @param[out] out_ref On success, set to the grid reference at the given point (may be NULL)
+ * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the terminal
+ * is NULL or the point is out of bounds
+ *
+ * @ingroup terminal
+ */
+GHOSTTY_API GhosttyResult ghostty_terminal_grid_ref(GhosttyTerminal terminal,
+ GhosttyPoint point,
+ GhosttyGridRef *out_ref);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GHOSTTY_VT_TERMINAL_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/types.h b/vendor/libghostty-vt/include/ghostty/vt/types.h
new file mode 100644
index 00000000..8f0be776
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/types.h
@@ -0,0 +1,121 @@
+/**
+ * @file types.h
+ *
+ * Common types, macros, and utilities for libghostty-vt.
+ */
+
+#ifndef GHOSTTY_VT_TYPES_H
+#define GHOSTTY_VT_TYPES_H
+
+#include
+#include
+
+// Symbol visibility for shared library builds. On Windows, functions
+// are exported from the DLL when building and imported when consuming.
+// On other platforms with GCC/Clang, functions are marked with default
+// visibility so they remain accessible when the library is built with
+// -fvisibility=hidden. For static library builds, define GHOSTTY_STATIC
+// before including this header to make this a no-op.
+#ifndef GHOSTTY_API
+#if defined(GHOSTTY_STATIC)
+ #define GHOSTTY_API
+#elif defined(_WIN32) || defined(_WIN64)
+ #ifdef GHOSTTY_BUILD_SHARED
+ #define GHOSTTY_API __declspec(dllexport)
+ #else
+ #define GHOSTTY_API __declspec(dllimport)
+ #endif
+#elif defined(__GNUC__) && __GNUC__ >= 4
+ #define GHOSTTY_API __attribute__((visibility("default")))
+#else
+ #define GHOSTTY_API
+#endif
+#endif
+
+/**
+ * Result codes for libghostty-vt operations.
+ */
+typedef enum {
+ /** Operation completed successfully */
+ GHOSTTY_SUCCESS = 0,
+ /** Operation failed due to failed allocation */
+ GHOSTTY_OUT_OF_MEMORY = -1,
+ /** Operation failed due to invalid value */
+ GHOSTTY_INVALID_VALUE = -2,
+ /** Operation failed because the provided buffer was too small */
+ GHOSTTY_OUT_OF_SPACE = -3,
+ /** The requested value has no value */
+ GHOSTTY_NO_VALUE = -4,
+} GhosttyResult;
+
+/**
+ * A borrowed byte string (pointer + length).
+ *
+ * The memory is not owned by this struct. The pointer is only valid
+ * for the lifetime documented by the API that produces or consumes it.
+ */
+typedef struct {
+ /** Pointer to the string bytes. */
+ const uint8_t* ptr;
+
+ /** Length of the string in bytes. */
+ size_t len;
+} GhosttyString;
+
+/**
+ * Initialize a sized struct to zero and set its size field.
+ *
+ * Sized structs use a `size` field as the first member for ABI
+ * compatibility. This macro zero-initializes the struct and sets the
+ * size field to `sizeof(type)`, which allows the library to detect
+ * which version of the struct the caller was compiled against.
+ *
+ * @param type The struct type to initialize
+ * @return A zero-initialized struct with the size field set
+ *
+ * Example:
+ * @code
+ * GhosttyFormatterTerminalOptions opts = GHOSTTY_INIT_SIZED(GhosttyFormatterTerminalOptions);
+ * opts.emit = GHOSTTY_FORMATTER_FORMAT_PLAIN;
+ * opts.trim = true;
+ * @endcode
+ */
+#define GHOSTTY_INIT_SIZED(type) \
+ ((type){ .size = sizeof(type) })
+
+/**
+ * Return a pointer to a null-terminated JSON string describing the
+ * layout of every C API struct for the current target.
+ *
+ * This is primarily useful for language bindings that can't easily
+ * set C struct fields and need to do so via byte offsets. For example,
+ * WebAssembly modules can't share struct definitions with the host.
+ *
+ * Example (abbreviated):
+ * @code{.json}
+ * {
+ * "GhosttyMouseEncoderSize": {
+ * "size": 40,
+ * "align": 8,
+ * "fields": {
+ * "size": { "offset": 0, "size": 8, "type": "u64" },
+ * "screen_width": { "offset": 8, "size": 4, "type": "u32" },
+ * "screen_height": { "offset": 12, "size": 4, "type": "u32" },
+ * "cell_width": { "offset": 16, "size": 4, "type": "u32" },
+ * "cell_height": { "offset": 20, "size": 4, "type": "u32" },
+ * "padding_top": { "offset": 24, "size": 4, "type": "u32" },
+ * "padding_bottom": { "offset": 28, "size": 4, "type": "u32" },
+ * "padding_right": { "offset": 32, "size": 4, "type": "u32" },
+ * "padding_left": { "offset": 36, "size": 4, "type": "u32" }
+ * }
+ * }
+ * }
+ * @endcode
+ *
+ * The returned pointer is valid for the lifetime of the process.
+ *
+ * @return Pointer to the null-terminated JSON string.
+ */
+GHOSTTY_API const char *ghostty_type_json(void);
+
+#endif /* GHOSTTY_VT_TYPES_H */
diff --git a/vendor/libghostty-vt/include/ghostty/vt/wasm.h b/vendor/libghostty-vt/include/ghostty/vt/wasm.h
new file mode 100644
index 00000000..e2b63e2c
--- /dev/null
+++ b/vendor/libghostty-vt/include/ghostty/vt/wasm.h
@@ -0,0 +1,160 @@
+/**
+ * @file wasm.h
+ *
+ * WebAssembly utility functions for libghostty-vt.
+ */
+
+#ifndef GHOSTTY_VT_WASM_H
+#define GHOSTTY_VT_WASM_H
+
+#ifdef __wasm__
+
+#include
+#include
+#include
+
+/** @defgroup wasm WebAssembly Utilities
+ *
+ * Convenience functions for allocating various types in WebAssembly builds.
+ * **These are only available the libghostty-vt wasm module.**
+ *
+ * Ghostty relies on pointers to various types for ABI compatibility, and
+ * creating those pointers in Wasm can be tedious. These functions provide
+ * a purely additive set of utilities that simplify memory management in
+ * Wasm environments without changing the core C library API.
+ *
+ * @note These functions always use the default allocator. If you need
+ * custom allocation strategies, you should allocate types manually using
+ * your custom allocator. This is a very rare use case in the WebAssembly
+ * world so these are optimized for simplicity.
+ *
+ * ## Example Usage
+ *
+ * Here's a simple example of using the Wasm utilities with the key encoder:
+ *
+ * @code
+ * const { exports } = wasmInstance;
+ * const view = new DataView(wasmMemory.buffer);
+ *
+ * // Create key encoder
+ * const encoderPtr = exports.ghostty_wasm_alloc_opaque();
+ * exports.ghostty_key_encoder_new(null, encoderPtr);
+ * const encoder = view.getUint32(encoder, true);
+ *
+ * // Configure encoder with Kitty protocol flags
+ * const flagsPtr = exports.ghostty_wasm_alloc_u8();
+ * view.setUint8(flagsPtr, 0x1F);
+ * exports.ghostty_key_encoder_setopt(encoder, 5, flagsPtr);
+ *
+ * // Allocate output buffer and size pointer
+ * const bufferSize = 32;
+ * const bufPtr = exports.ghostty_wasm_alloc_u8_array(bufferSize);
+ * const writtenPtr = exports.ghostty_wasm_alloc_usize();
+ *
+ * // Encode the key event
+ * exports.ghostty_key_encoder_encode(
+ * encoder, eventPtr, bufPtr, bufferSize, writtenPtr
+ * );
+ *
+ * // Read encoded output
+ * const bytesWritten = view.getUint32(writtenPtr, true);
+ * const encoded = new Uint8Array(wasmMemory.buffer, bufPtr, bytesWritten);
+ * @endcode
+ *
+ * @remark The code above is pretty ugly! This is the lowest level interface
+ * to the libghostty-vt Wasm module. In practice, this should be wrapped
+ * in a higher-level API that abstracts away all this.
+ *
+ * @{
+ */
+
+/**
+ * Allocate an opaque pointer. This can be used for any opaque pointer
+ * types such as GhosttyKeyEncoder, GhosttyKeyEvent, etc.
+ *
+ * @return Pointer to allocated opaque pointer, or NULL if allocation failed
+ * @ingroup wasm
+ */
+GHOSTTY_API void** ghostty_wasm_alloc_opaque(void);
+
+/**
+ * Free an opaque pointer allocated by ghostty_wasm_alloc_opaque().
+ *
+ * @param ptr Pointer to free, or NULL (NULL is safely ignored)
+ * @ingroup wasm
+ */
+GHOSTTY_API void ghostty_wasm_free_opaque(void **ptr);
+
+/**
+ * Allocate an array of uint8_t values.
+ *
+ * @param len Number of uint8_t elements to allocate
+ * @return Pointer to allocated array, or NULL if allocation failed
+ * @ingroup wasm
+ */
+GHOSTTY_API uint8_t* ghostty_wasm_alloc_u8_array(size_t len);
+
+/**
+ * Free an array allocated by ghostty_wasm_alloc_u8_array().
+ *
+ * @param ptr Pointer to the array to free, or NULL (NULL is safely ignored)
+ * @param len Length of the array (must match the length passed to alloc)
+ * @ingroup wasm
+ */
+GHOSTTY_API void ghostty_wasm_free_u8_array(uint8_t *ptr, size_t len);
+
+/**
+ * Allocate an array of uint16_t values.
+ *
+ * @param len Number of uint16_t elements to allocate
+ * @return Pointer to allocated array, or NULL if allocation failed
+ * @ingroup wasm
+ */
+GHOSTTY_API uint16_t* ghostty_wasm_alloc_u16_array(size_t len);
+
+/**
+ * Free an array allocated by ghostty_wasm_alloc_u16_array().
+ *
+ * @param ptr Pointer to the array to free, or NULL (NULL is safely ignored)
+ * @param len Length of the array (must match the length passed to alloc)
+ * @ingroup wasm
+ */
+GHOSTTY_API void ghostty_wasm_free_u16_array(uint16_t *ptr, size_t len);
+
+/**
+ * Allocate a single uint8_t value.
+ *
+ * @return Pointer to allocated uint8_t, or NULL if allocation failed
+ * @ingroup wasm
+ */
+GHOSTTY_API uint8_t* ghostty_wasm_alloc_u8(void);
+
+/**
+ * Free a uint8_t allocated by ghostty_wasm_alloc_u8().
+ *
+ * @param ptr Pointer to free, or NULL (NULL is safely ignored)
+ * @ingroup wasm
+ */
+GHOSTTY_API void ghostty_wasm_free_u8(uint8_t *ptr);
+
+/**
+ * Allocate a single size_t value.
+ *
+ * @return Pointer to allocated size_t, or NULL if allocation failed
+ * @ingroup wasm
+ */
+GHOSTTY_API size_t* ghostty_wasm_alloc_usize(void);
+
+/**
+ * Free a size_t allocated by ghostty_wasm_alloc_usize().
+ *
+ * @param ptr Pointer to free, or NULL (NULL is safely ignored)
+ * @ingroup wasm
+ */
+GHOSTTY_API void ghostty_wasm_free_usize(size_t *ptr);
+
+/** @} */
+
+#endif /* __wasm__ */
+
+#endif /* GHOSTTY_VT_WASM_H */
diff --git a/vendor/libghostty-vt/include/module.modulemap b/vendor/libghostty-vt/include/module.modulemap
new file mode 100644
index 00000000..8961f5c0
--- /dev/null
+++ b/vendor/libghostty-vt/include/module.modulemap
@@ -0,0 +1,7 @@
+// This makes Ghostty available to the XCode build for the macOS app.
+// We append "Kit" to it not to be cute, but because targets have to have
+// unique names and we use Ghostty for other things.
+module GhosttyKit {
+ umbrella header "ghostty.h"
+ export *
+}
diff --git a/vendor/libghostty-vt/nix/build-support/build-inputs.nix b/vendor/libghostty-vt/nix/build-support/build-inputs.nix
new file mode 100644
index 00000000..8f39968a
--- /dev/null
+++ b/vendor/libghostty-vt/nix/build-support/build-inputs.nix
@@ -0,0 +1,46 @@
+{
+ pkgs,
+ lib,
+ stdenv,
+ enableX11 ? true,
+ enableWayland ? true,
+}:
+[
+ pkgs.libGL
+]
+++ lib.optionals stdenv.hostPlatform.isLinux [
+ pkgs.bzip2
+ pkgs.expat
+ pkgs.fontconfig
+ pkgs.freetype
+ pkgs.harfbuzz
+ pkgs.libpng
+ pkgs.libxml2
+ pkgs.oniguruma
+ pkgs.simdutf
+ pkgs.zlib
+
+ pkgs.glslang
+ pkgs.spirv-cross
+
+ pkgs.libxkbcommon
+
+ pkgs.glib
+ pkgs.gobject-introspection
+ pkgs.gsettings-desktop-schemas
+ pkgs.gst_all_1.gst-plugins-base
+ pkgs.gst_all_1.gst-plugins-good
+ pkgs.gst_all_1.gstreamer
+ pkgs.gtk4
+ pkgs.libadwaita
+]
+++ lib.optionals (stdenv.hostPlatform.isLinux && enableX11) [
+ pkgs.libx11
+ pkgs.libxcursor
+ pkgs.libxi
+ pkgs.libxrandr
+]
+++ lib.optionals (stdenv.hostPlatform.isLinux && enableWayland) [
+ pkgs.gtk4-layer-shell
+ pkgs.wayland
+]
diff --git a/vendor/libghostty-vt/nix/build-support/check-blueprints.sh b/vendor/libghostty-vt/nix/build-support/check-blueprints.sh
new file mode 100755
index 00000000..8325981c
--- /dev/null
+++ b/vendor/libghostty-vt/nix/build-support/check-blueprints.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+set -o nounset -o pipefail -o errexit
+
+find src -name \*.blp -exec blueprint-compiler format {} \+
+find src -name \*.blp -exec blueprint-compiler compile --output=/dev/null {} \;
diff --git a/vendor/libghostty-vt/nix/build-support/check-zig-cache.sh b/vendor/libghostty-vt/nix/build-support/check-zig-cache.sh
new file mode 100755
index 00000000..9a392784
--- /dev/null
+++ b/vendor/libghostty-vt/nix/build-support/check-zig-cache.sh
@@ -0,0 +1,120 @@
+#!/usr/bin/env bash
+#
+# This script checks if the build.zig.zon.nix file is up-to-date.
+# If the `--update` flag is passed, it will update all necessary
+# files to be up to date.
+#
+# The files owned by this are:
+#
+# - build.zig.zon.nix
+# - build.zig.zon.txt
+# - build.zig.zon.json
+# - flatpak/zig-packages.json
+#
+# All of these are auto-generated and should not be edited manually.
+
+# Nothing in this script should fail.
+set -e
+
+WORK_DIR=$(mktemp -d)
+
+if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
+ echo "could not create temp dir"
+ exit 1
+fi
+
+function cleanup {
+ rm -rf "$WORK_DIR"
+}
+
+trap cleanup EXIT
+
+help() {
+ echo ""
+ echo "To fix, please (manually) re-run the script from the repository root,"
+ echo "commit, and submit a PR with the update:"
+ echo ""
+ echo " ./nix/build-support/check-zig-cache.sh --update"
+ echo " git add build.zig.zon.nix build.zig.zon.txt build.zig.zon.json flatpak/zig-packages.json"
+ echo " git commit -m \"nix: update build.zig.zon.nix build.zig.zon.txt build.zig.zon.json flatpak/zig-packages.json\""
+ echo ""
+}
+
+ROOT="$(realpath "$(dirname "$0")/../../")"
+BUILD_ZIG_ZON="$ROOT/build.zig.zon"
+BUILD_ZIG_ZON_NIX="$ROOT/build.zig.zon.nix"
+BUILD_ZIG_ZON_TXT="$ROOT/build.zig.zon.txt"
+BUILD_ZIG_ZON_JSON="$ROOT/build.zig.zon.json"
+ZIG_PACKAGES_JSON="$ROOT/flatpak/zig-packages.json"
+
+if [ -f "${BUILD_ZIG_ZON_NIX}" ]; then
+ OLD_HASH_NIX=$(sha512sum "${BUILD_ZIG_ZON_NIX}" | awk '{print $1}')
+elif [ "$1" != "--update" ]; then
+ echo -e "\nERROR: build.zig.zon.nix missing."
+ help
+ exit 1
+fi
+
+if [ -f "${BUILD_ZIG_ZON_TXT}" ]; then
+ OLD_HASH_TXT=$(sha512sum "${BUILD_ZIG_ZON_TXT}" | awk '{print $1}')
+elif [ "$1" != "--update" ]; then
+ echo -e "\nERROR: build.zig.zon.txt missing."
+ help
+ exit 1
+fi
+
+if [ -f "${BUILD_ZIG_ZON_JSON}" ]; then
+ OLD_HASH_JSON=$(sha512sum "${BUILD_ZIG_ZON_JSON}" | awk '{print $1}')
+elif [ "$1" != "--update" ]; then
+ echo -e "\nERROR: build.zig.zon.json missing."
+ help
+ exit 1
+fi
+
+if [ -f "${ZIG_PACKAGES_JSON}" ]; then
+ OLD_HASH_FLATPAK=$(sha512sum "${ZIG_PACKAGES_JSON}" | awk '{print $1}')
+elif [ "$1" != "--update" ]; then
+ echo -e "\nERROR: flatpak/zig-packages.json missing."
+ help
+ exit 1
+fi
+
+zon2nix "$BUILD_ZIG_ZON" --15 --nix "$WORK_DIR/build.zig.zon.nix" --txt "$WORK_DIR/build.zig.zon.txt" --json "$WORK_DIR/build.zig.zon.json" --flatpak "$WORK_DIR/zig-packages.json"
+alejandra --quiet "$WORK_DIR/build.zig.zon.nix"
+prettier --log-level warn --write "$WORK_DIR/build.zig.zon.json"
+prettier --log-level warn --write "$WORK_DIR/zig-packages.json"
+
+NEW_HASH_NIX=$(sha512sum "$WORK_DIR/build.zig.zon.nix" | awk '{print $1}')
+NEW_HASH_TXT=$(sha512sum "$WORK_DIR/build.zig.zon.txt" | awk '{print $1}')
+NEW_HASH_JSON=$(sha512sum "$WORK_DIR/build.zig.zon.json" | awk '{print $1}')
+NEW_HASH_FLATPAK=$(sha512sum "$WORK_DIR/zig-packages.json" | awk '{print $1}')
+
+if [ "${OLD_HASH_NIX}" == "${NEW_HASH_NIX}" ] && [ "${OLD_HASH_TXT}" == "${NEW_HASH_TXT}" ] && [ "${OLD_HASH_JSON}" == "${NEW_HASH_JSON}" ] && [ "${OLD_HASH_FLATPAK}" == "${NEW_HASH_FLATPAK}" ]; then
+ echo -e "\nOK: build.zig.zon.nix unchanged."
+ echo -e "OK: build.zig.zon.txt unchanged."
+ echo -e "OK: build.zig.zon.json unchanged."
+ echo -e "OK: flatpak/zig-packages.json unchanged."
+ exit 0
+elif [ "$1" != "--update" ]; then
+ echo -e "\nERROR: build.zig.zon.nix, build.zig.zon.txt, or build.zig.zon.json needs to be updated.\n"
+ echo " * Old build.zig.zon.nix hash: ${OLD_HASH_NIX}"
+ echo " * New build.zig.zon.nix hash: ${NEW_HASH_NIX}"
+ echo " * Old build.zig.zon.txt hash: ${OLD_HASH_TXT}"
+ echo " * New build.zig.zon.txt hash: ${NEW_HASH_TXT}"
+ echo " * Old build.zig.zon.json hash: ${OLD_HASH_JSON}"
+ echo " * New build.zig.zon.json hash: ${NEW_HASH_JSON}"
+ echo " * Old flatpak/zig-packages.json hash: ${OLD_HASH_FLATPAK}"
+ echo " * New flatpak/zig-packages.json hash: ${NEW_HASH_FLATPAK}"
+ help
+ exit 1
+else
+ mv "$WORK_DIR/build.zig.zon.nix" "$BUILD_ZIG_ZON_NIX"
+ echo -e "\nOK: build.zig.zon.nix updated."
+ mv "$WORK_DIR/build.zig.zon.txt" "$BUILD_ZIG_ZON_TXT"
+ echo -e "OK: build.zig.zon.txt updated."
+ mv "$WORK_DIR/build.zig.zon.json" "$BUILD_ZIG_ZON_JSON"
+ echo -e "OK: build.zig.zon.json updated."
+ mv "$WORK_DIR/zig-packages.json" "$ZIG_PACKAGES_JSON"
+ echo -e "OK: flatpak/zig-packages.json updated."
+ exit 0
+fi
diff --git a/vendor/libghostty-vt/nix/build-support/fetch-zig-cache.sh b/vendor/libghostty-vt/nix/build-support/fetch-zig-cache.sh
new file mode 100755
index 00000000..9cc3dce2
--- /dev/null
+++ b/vendor/libghostty-vt/nix/build-support/fetch-zig-cache.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# NOTE THIS IS A TEMPORARY SCRIPT TO SUPPORT PACKAGE MAINTAINERS.
+#
+# A future Zig version will hopefully fix the issue where
+# `zig build --fetch` doesn't fetch transitive dependencies[1]. When that
+# is resolved, we won't need any special machinery for the general use case
+# at all and packagers can just use `zig build --fetch`.
+#
+# [1]: https://github.com/ziglang/zig/issues/20976
+
+if [ -z ${ZIG_GLOBAL_CACHE_DIR+x} ]
+then
+ echo "must set ZIG_GLOBAL_CACHE_DIR!"
+ exit 1
+fi
+
+# Go through each line of our build.zig.zon.txt and fetch it.
+SCRIPT_PATH="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
+ZON_TXT_FILE="$SCRIPT_PATH/../../build.zig.zon.txt"
+while IFS= read -r url; do
+ echo "Fetching: $url"
+ zig fetch "$url" >/dev/null 2>&1 || {
+ echo "Failed to fetch: $url" >&2
+ exit 1
+ }
+done < "$ZON_TXT_FILE"
diff --git a/vendor/libghostty-vt/nix/build-support/gi-typelib-path.nix b/vendor/libghostty-vt/nix/build-support/gi-typelib-path.nix
new file mode 100644
index 00000000..2e9533cb
--- /dev/null
+++ b/vendor/libghostty-vt/nix/build-support/gi-typelib-path.nix
@@ -0,0 +1,17 @@
+{
+ pkgs,
+ lib,
+ stdenv,
+}:
+lib.makeSearchPath "lib/girepository-1.0" (map (lib.getOutput "lib") (lib.optionals stdenv.hostPlatform.isLinux [
+ pkgs.cairo
+ pkgs.gdk-pixbuf
+ pkgs.glib
+ pkgs.gobject-introspection
+ pkgs.graphene
+ pkgs.gtk4
+ pkgs.gtk4-layer-shell
+ pkgs.harfbuzz
+ pkgs.libadwaita
+ pkgs.pango
+]))
diff --git a/vendor/libghostty-vt/nix/build-support/ld-library-path.nix b/vendor/libghostty-vt/nix/build-support/ld-library-path.nix
new file mode 100644
index 00000000..b90a56d9
--- /dev/null
+++ b/vendor/libghostty-vt/nix/build-support/ld-library-path.nix
@@ -0,0 +1,10 @@
+{
+ pkgs,
+ lib,
+ stdenv,
+ enableX11 ? true,
+ enableWayland ? true,
+}:
+lib.makeLibraryPath (import ./build-inputs.nix {
+ inherit pkgs lib stdenv enableX11 enableWayland;
+})
diff --git a/vendor/libghostty-vt/nix/build-support/update-mirror.nu b/vendor/libghostty-vt/nix/build-support/update-mirror.nu
new file mode 100755
index 00000000..8571ddea
--- /dev/null
+++ b/vendor/libghostty-vt/nix/build-support/update-mirror.nu
@@ -0,0 +1,96 @@
+#!/usr/bin/env nu
+
+# This script downloads external dependencies from build.zig.zon.json that
+# are not already mirrored at deps.files.ghostty.org, saves them to a local
+# directory, and updates build.zig.zon to point to the new mirror URLs.
+#
+# The downloaded files are unmodified so their checksums and content hashes
+# will match the originals.
+#
+# After running this script, the files in the output directory can be uploaded
+# to blob storage, and build.zig.zon will already be updated with the new URLs.
+def main [
+ --output: string = "tmp-mirror", # Output directory for the mirrored files
+ --prefix: string = "https://deps.files.ghostty.org/", # Final URL prefix to ignore
+ --dry-run, # Print what would be downloaded without downloading
+] {
+ let script_dir = ($env.CURRENT_FILE | path dirname)
+ let input_file = ($script_dir | path join ".." ".." "build.zig.zon.json")
+ let zon_file = ($script_dir | path join ".." ".." "build.zig.zon")
+ let output_dir = $output
+
+ # Ensure the output directory exists
+ mkdir $output_dir
+
+ # Read and parse the JSON file
+ let deps = open $input_file
+
+ # Track URL replacements for build.zig.zon
+ mut url_replacements = []
+
+ # Process each dependency
+ for entry in ($deps | transpose key value) {
+ let key = $entry.key
+ let name = $entry.value.name
+ let url = $entry.value.url
+
+ # Skip URLs that don't start with http(s)
+ if not ($url | str starts-with "http") {
+ continue
+ }
+
+ # Skip URLs already hosted at the prefix
+ if ($url | str starts-with $prefix) {
+ continue
+ }
+
+ # Extract the file extension from the URL
+ let extension = ($url | parse -r '(\.[a-z0-9]+(?:\.[a-z0-9]+)?)$' | get -o capture0.0 | default "")
+
+ # Try to extract commit hash (40 hex chars) from URL
+ let commit_hash = ($url | parse -r '([a-f0-9]{40})' | get -o capture0.0 | default "")
+
+ # Try to extract date pattern (YYYY-MM-DD or YYYYMMDD with optional suffixes)
+ let date_pattern = ($url | parse -r '((?:release-)?20\d{2}(?:-?\d{2}){2}(?:[-]\d+)*(?:[-][a-z0-9]+)?)' | get -o capture0.0 | default "")
+
+ # Build filename based on what we found
+ let filename = if (not ($commit_hash | is-empty)) {
+ $"($name)-($commit_hash)($extension)"
+ } else if (not ($date_pattern | is-empty)) {
+ $"($name)-($date_pattern)($extension)"
+ } else {
+ $"($key)($extension)"
+ }
+ let new_url = $"($prefix)($filename)"
+ print $"($url) -> ($filename)"
+
+ # Track the replacement
+ $url_replacements = ($url_replacements | append {old: $url, new: $new_url})
+
+ # Download the file
+ if not $dry_run {
+ http get $url | save -f ($output_dir | path join $filename)
+ }
+ }
+
+ if $dry_run {
+ print "Dry run complete - no files were downloaded\n"
+ print $"Would update ($url_replacements | length) URLs in build.zig.zon"
+ } else {
+ print "All dependencies downloaded successfully\n"
+ print $"Updating ($zon_file)..."
+
+ # Backup the old file
+ let backup_file = $"($zon_file).bak"
+ cp $zon_file $backup_file
+ print $"Backed up to ($backup_file)"
+
+ mut zon_content = (open $zon_file)
+ for replacement in $url_replacements {
+ $zon_content = ($zon_content | str replace $replacement.old $replacement.new)
+ }
+ $zon_content | save -f $zon_file
+
+ print $"Updated ($url_replacements | length) URLs in build.zig.zon"
+ }
+}
diff --git a/vendor/libghostty-vt/nix/devShell.nix b/vendor/libghostty-vt/nix/devShell.nix
new file mode 100644
index 00000000..df08fc20
--- /dev/null
+++ b/vendor/libghostty-vt/nix/devShell.nix
@@ -0,0 +1,234 @@
+{
+ mkShell,
+ lib,
+ stdenv,
+ bashInteractive,
+ doxygen,
+ nushell,
+ appstream,
+ flatpak-builder,
+ gdb,
+ cmake,
+ #, glxinfo # unused
+ ncurses,
+ nodejs,
+ nodePackages,
+ oniguruma,
+ parallel,
+ pkg-config,
+ python3,
+ qemu,
+ scdoc,
+ # snapcraft,
+ valgrind,
+ #, vulkan-loader # unused
+ vttest,
+ wabt,
+ wasmtime,
+ wraptest,
+ zig,
+ zig_0_15,
+ zip,
+ llvmPackages_latest,
+ bzip2,
+ expat,
+ fontconfig,
+ freetype,
+ glib,
+ glslang,
+ gtk4,
+ gtk4-layer-shell,
+ gobject-introspection,
+ gst_all_1,
+ libadwaita,
+ blueprint-compiler,
+ gettext,
+ adwaita-icon-theme,
+ hicolor-icon-theme,
+ harfbuzz,
+ libpng,
+ libxkbcommon,
+ libX11,
+ libXcursor,
+ libXext,
+ libXi,
+ libXinerama,
+ libXrandr,
+ libxml2,
+ spirv-cross,
+ simdutf,
+ zlib,
+ alejandra,
+ jq,
+ minisign,
+ pandoc,
+ pinact,
+ hyperfine,
+ poop,
+ typos,
+ shellcheck,
+ swiftlint,
+ uv,
+ wayland,
+ wayland-scanner,
+ wayland-protocols,
+ zon2nix,
+ pkgs,
+ # needed by GTK for loading SVG icons while running from within the
+ # developer shell
+ glycin-loaders,
+ librsvg,
+}: let
+ # See package.nix. Keep in sync.
+ ld_library_path = import ./build-support/ld-library-path.nix {
+ inherit pkgs lib stdenv;
+ };
+ gi_typelib_path = import ./build-support/gi-typelib-path.nix {
+ inherit pkgs lib stdenv;
+ };
+in
+ mkShell {
+ name = "ghostty";
+ packages =
+ [
+ # For builds
+ cmake
+ doxygen
+ jq
+ llvmPackages_latest.llvm
+ minisign
+ ncurses
+ pandoc
+ pkg-config
+ scdoc
+ zig
+ zip
+ zon2nix.packages.${stdenv.hostPlatform.system}.zon2nix
+
+ # For web and wasm stuff
+ nodejs
+
+ # Linting
+ nodePackages.prettier
+ alejandra
+ pinact
+ typos
+ shellcheck
+
+ # Testing
+ parallel
+ python3
+ vttest
+ hyperfine
+
+ # wasm
+ wabt
+ wasmtime
+
+ # Localization
+ gettext
+
+ # CI
+ uv
+
+ # Scripting
+ nushell
+
+ # We need these GTK-related deps on all platform so we can build
+ # dist tarballs.
+ blueprint-compiler
+ libadwaita
+ gtk4
+
+ # Python packages
+ (python3.withPackages (python-pkgs: [
+ python-pkgs.ucs-detect
+ ]))
+ ]
+ ++ lib.optionals stdenv.hostPlatform.isLinux [
+ # My nix shell environment installs the non-interactive version
+ # by default so we have to include this.
+ bashInteractive
+
+ # Used for testing SIMD codegen. This is Linux only because the macOS
+ # build only has the qemu-system files.
+ qemu
+
+ appstream
+ flatpak-builder
+ gdb
+ # snapcraft
+ valgrind
+ wraptest
+
+ bzip2
+ expat
+ fontconfig
+ freetype
+ harfbuzz
+ libpng
+ libxml2
+ oniguruma
+ simdutf
+ zlib
+
+ glslang
+ spirv-cross
+
+ libxkbcommon
+ libX11
+ libXcursor
+ libXext
+ libXi
+ libXinerama
+ libXrandr
+
+ # Only needed for GTK builds
+ gtk4-layer-shell
+ glib
+ gobject-introspection
+ wayland
+ wayland-scanner
+ wayland-protocols
+ gst_all_1.gstreamer
+ gst_all_1.gst-plugins-base
+ gst_all_1.gst-plugins-good
+
+ # needed by GTK for loading SVG icons while running from within the
+ # developer shell
+ glycin-loaders
+ librsvg
+
+ # for benchmarking
+ poop
+ ]
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
+ swiftlint
+ ];
+
+ # This should be set onto the rpath of the ghostty binary if you want
+ # it to be "portable" across the system.
+ LD_LIBRARY_PATH = ld_library_path;
+ GI_TYPELIB_PATH = gi_typelib_path;
+
+ shellHook =
+ (lib.optionalString stdenv.hostPlatform.isLinux ''
+ # On Linux we need to setup the environment so that all GTK data
+ # is available (namely icons).
+
+ # Minimal subset of env set by wrapGAppsHook4 for icons and global settings
+ export XDG_DATA_DIRS=$XDG_DATA_DIRS:${hicolor-icon-theme}/share:${adwaita-icon-theme}/share
+ export XDG_DATA_DIRS=$XDG_DATA_DIRS:$GSETTINGS_SCHEMAS_PATH # from glib setup hook
+ '')
+ + (lib.optionalString stdenv.hostPlatform.isDarwin ''
+ # On macOS, we unset the macOS SDK env vars that Nix sets up because
+ # we rely on a system installation. Nix only provides a macOS SDK
+ # and we need iOS too.
+ unset SDKROOT
+ unset DEVELOPER_DIR
+
+ # We need to remove "xcrun" from the PATH. It is injected by
+ # some dependency but we need to rely on system Xcode tools
+ export PATH=$(echo "$PATH" | awk -v RS=: -v ORS=: '$0 !~ /xcrun/ || $0 == "/usr/bin" {print}' | sed 's/:$//')
+ '');
+ }
diff --git a/vendor/libghostty-vt/nix/libghostty-vt.nix b/vendor/libghostty-vt/nix/libghostty-vt.nix
new file mode 100644
index 00000000..fbe87ef0
--- /dev/null
+++ b/vendor/libghostty-vt/nix/libghostty-vt.nix
@@ -0,0 +1,85 @@
+{
+ lib,
+ stdenv,
+ callPackage,
+ git,
+ pkg-config,
+ zig_0_15,
+ revision ? "dirty",
+ optimize ? "Debug",
+}:
+stdenv.mkDerivation (finalAttrs: {
+ pname = "ghostty";
+ version = "0.1.0-dev";
+
+ # We limit source like this to try and reduce the amount of rebuilds as possible
+ # thus we only provide the source that is needed for the build
+ #
+ # NOTE: as of the current moment only linux files are provided,
+ # since darwin support is not finished
+ src = lib.fileset.toSource {
+ root = ../.;
+ fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ../.)) (
+ lib.fileset.unions [
+ ../dist/linux
+ ../images
+ ../include
+ ../po
+ ../pkg
+ ../src
+ ../vendor
+ ../build.zig
+ ../build.zig.zon
+ ../build.zig.zon.nix
+ ]
+ );
+ };
+
+ deps = callPackage ../build.zig.zon.nix {name = "ghostty-cache-${finalAttrs.version}";};
+
+ nativeBuildInputs = [
+ git
+ pkg-config
+ zig_0_15
+ ];
+
+ buildInputs = [];
+
+ dontSetZigDefaultFlags = true;
+
+ zigBuildFlags = [
+ "--system"
+ "${finalAttrs.deps}"
+ "-Dversion-string=${finalAttrs.version}-${revision}-nix"
+ "-Dcpu=baseline"
+ "-Doptimize=${optimize}"
+ "-Dapp-runtime=none"
+ "-Demit-lib-vt=true"
+ ];
+
+ outputs = [
+ "out"
+ "dev"
+ ];
+
+ postInstall = ''
+ mkdir -p "$dev/lib"
+ mv "$out/lib/libghostty-vt.a" "$dev/lib"
+ rm "$out/lib/libghostty-vt.so"
+ mv "$out/include" "$dev"
+ mv "$out/share" "$dev"
+
+ ln -sf "$out/lib/libghostty-vt.so.0" "$dev/lib/libghostty-vt.so"
+ '';
+
+ postFixup = ''
+ substituteInPlace "$dev/share/pkgconfig/libghostty-vt.pc" \
+ --replace "$out" "$dev"
+ '';
+
+ meta = {
+ homepage = "https://ghostty.org";
+ license = lib.licenses.mit;
+ platforms = zig_0_15.meta.platforms;
+ };
+})
diff --git a/vendor/libghostty-vt/nix/package.nix b/vendor/libghostty-vt/nix/package.nix
new file mode 100644
index 00000000..8287b088
--- /dev/null
+++ b/vendor/libghostty-vt/nix/package.nix
@@ -0,0 +1,141 @@
+{
+ lib,
+ stdenv,
+ callPackage,
+ gobject-introspection,
+ blueprint-compiler,
+ libxml2,
+ gettext,
+ wrapGAppsHook4,
+ git,
+ ncurses,
+ pkg-config,
+ zig_0_15,
+ pandoc,
+ revision ? "dirty",
+ optimize ? "Debug",
+ enableX11 ? true,
+ enableWayland ? true,
+ wayland-protocols,
+ wayland-scanner,
+ pkgs,
+}: let
+ gi_typelib_path = import ./build-support/gi-typelib-path.nix {
+ inherit pkgs lib stdenv;
+ };
+ buildInputs = import ./build-support/build-inputs.nix {
+ inherit pkgs lib stdenv enableX11 enableWayland;
+ };
+ strip = optimize != "Debug" && optimize != "ReleaseSafe";
+in
+ stdenv.mkDerivation (finalAttrs: {
+ pname = "ghostty";
+ version = "1.3.2-dev";
+
+ # We limit source like this to try and reduce the amount of rebuilds as possible
+ # thus we only provide the source that is needed for the build
+ #
+ # NOTE: as of the current moment only linux files are provided,
+ # since darwin support is not finished
+ src = lib.fileset.toSource {
+ root = ../.;
+ fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ../.)) (
+ lib.fileset.unions [
+ ../dist/linux
+ ../images
+ ../include
+ ../po
+ ../pkg
+ ../src
+ ../vendor
+ ../build.zig
+ ../build.zig.zon
+ ../build.zig.zon.nix
+ ]
+ );
+ };
+
+ deps = callPackage ../build.zig.zon.nix {name = "ghostty-cache-${finalAttrs.version}";};
+
+ nativeBuildInputs =
+ [
+ git
+ ncurses
+ pandoc
+ pkg-config
+ zig_0_15
+ gobject-introspection
+ wrapGAppsHook4
+ blueprint-compiler
+ libxml2 # for xmllint
+ gettext
+ ]
+ ++ lib.optionals enableWayland [
+ wayland-scanner
+ wayland-protocols
+ ];
+
+ buildInputs = buildInputs;
+
+ dontStrip = !strip;
+
+ GI_TYPELIB_PATH = gi_typelib_path;
+
+ dontSetZigDefaultFlags = true;
+
+ zigBuildFlags = [
+ "--system"
+ "${finalAttrs.deps}"
+ "-Dversion-string=${finalAttrs.version}-${revision}-nix"
+ "-Dgtk-x11=${lib.boolToString enableX11}"
+ "-Dgtk-wayland=${lib.boolToString enableWayland}"
+ "-Dcpu=baseline"
+ "-Doptimize=${optimize}"
+ "-Dstrip=${lib.boolToString strip}"
+ ];
+
+ outputs = [
+ "out"
+ "terminfo"
+ "shell_integration"
+ "vim"
+ ];
+
+ postInstall = ''
+ terminfo_src=${
+ if stdenv.hostPlatform.isDarwin
+ then ''"$out/Applications/Ghostty.app/Contents/Resources/terminfo"''
+ else "$out/share/terminfo"
+ }
+
+ mkdir -p "$out/nix-support"
+
+ mkdir -p "$terminfo/share"
+ mv "$terminfo_src" "$terminfo/share/terminfo"
+ ln -sf "$terminfo/share/terminfo" "$terminfo_src"
+ echo "$terminfo" >> "$out/nix-support/propagated-user-env-packages"
+
+ mkdir -p "$shell_integration"
+ mv "$out/share/ghostty/shell-integration" "$shell_integration/shell-integration"
+ ln -sf "$shell_integration/shell-integration" "$out/share/ghostty/shell-integration"
+ echo "$shell_integration" >> "$out/nix-support/propagated-user-env-packages"
+
+ mv $out/share/vim/vimfiles "$vim"
+ ln -sf "$vim" "$out/share/vim/vimfiles"
+ echo "$vim" >> "$out/nix-support/propagated-user-env-packages"
+
+ echo "gst_all_1.gstreamer" >> "$out/nix-support/propagated-user-env-packages"
+ echo "gst_all_1.gst-plugins-base" >> "$out/nix-support/propagated-user-env-packages"
+ echo "gst_all_1.gst-plugins-good" >> "$out/nix-support/propagated-user-env-packages"
+ '';
+
+ meta = {
+ homepage = "https://ghostty.org";
+ license = lib.licenses.mit;
+ platforms = [
+ "x86_64-linux"
+ "aarch64-linux"
+ ];
+ mainProgram = "ghostty";
+ };
+ })
diff --git a/vendor/libghostty-vt/nix/pkgs/blessed.nix b/vendor/libghostty-vt/nix/pkgs/blessed.nix
new file mode 100644
index 00000000..da5d6958
--- /dev/null
+++ b/vendor/libghostty-vt/nix/pkgs/blessed.nix
@@ -0,0 +1,40 @@
+{
+ lib,
+ buildPythonPackage,
+ fetchFromGitHub,
+ pythonOlder,
+ flit-core,
+ six,
+ wcwidth,
+}:
+buildPythonPackage (finalAttrs: {
+ pname = "blessed";
+ version = "1.31";
+ pyproject = true;
+
+ disabled = pythonOlder "3.8";
+
+ src = fetchFromGitHub {
+ owner = "jquast";
+ repo = "blessed";
+ tag = finalAttrs.version;
+ hash = "sha256-Nn+aiDk0Qwk9xAvAqtzds/WlrLAozjPL1eSVNU75tJA=";
+ };
+
+ build-system = [flit-core];
+
+ propagatedBuildInputs = [
+ wcwidth
+ six
+ ];
+
+ doCheck = false;
+ dontCheckRuntimeDeps = true;
+
+ meta = with lib; {
+ homepage = "https://github.com/jquast/blessed";
+ description = "Thin, practical wrapper around terminal capabilities in Python";
+ maintainers = [];
+ license = licenses.mit;
+ };
+})
diff --git a/vendor/libghostty-vt/nix/pkgs/ucs-detect.nix b/vendor/libghostty-vt/nix/pkgs/ucs-detect.nix
new file mode 100644
index 00000000..5bbcdd07
--- /dev/null
+++ b/vendor/libghostty-vt/nix/pkgs/ucs-detect.nix
@@ -0,0 +1,47 @@
+{
+ lib,
+ buildPythonPackage,
+ fetchFromGitHub,
+ pythonOlder,
+ hatchling,
+ # Dependencies
+ blessed,
+ wcwidth,
+ pyyaml,
+ prettytable,
+ requests,
+}:
+buildPythonPackage (finalAttrs: {
+ pname = "ucs-detect";
+ version = "2.0.2";
+ pyproject = true;
+
+ disabled = pythonOlder "3.8";
+
+ src = fetchFromGitHub {
+ owner = "jquast";
+ repo = "ucs-detect";
+ tag = finalAttrs.version;
+ hash = "sha256-pCJNrJN+SO0pGveNJuISJbzOJYyxP9Tbljp8PwqbgYU=";
+ };
+
+ dependencies = [
+ blessed
+ wcwidth
+ pyyaml
+ prettytable
+ requests
+ ];
+
+ nativeBuildInputs = [hatchling];
+
+ doCheck = false;
+ dontCheckRuntimeDeps = true;
+
+ meta = with lib; {
+ description = "Measures number of Terminal column cells of wide-character codes";
+ homepage = "https://github.com/jquast/ucs-detect";
+ license = licenses.mit;
+ maintainers = [];
+ };
+})
diff --git a/vendor/libghostty-vt/nix/pkgs/wcwidth.nix b/vendor/libghostty-vt/nix/pkgs/wcwidth.nix
new file mode 100644
index 00000000..4bbd1373
--- /dev/null
+++ b/vendor/libghostty-vt/nix/pkgs/wcwidth.nix
@@ -0,0 +1,27 @@
+{
+ lib,
+ buildPythonPackage,
+ fetchPypi,
+ hatchling,
+}:
+buildPythonPackage rec {
+ pname = "wcwidth";
+ version = "0.6.0";
+ pyproject = true;
+
+ src = fetchPypi {
+ inherit pname version;
+ hash = "sha256-zcTkJi1u+aGlfgGDhMvrEgjYq7xkF2An4sJFXIExMVk=";
+ };
+
+ build-system = [hatchling];
+
+ doCheck = false;
+
+ meta = with lib; {
+ description = "Measures the displayed width of unicode strings in a terminal";
+ homepage = "https://github.com/jquast/wcwidth";
+ license = licenses.mit;
+ maintainers = [];
+ };
+}
diff --git a/vendor/libghostty-vt/nix/pkgs/wraptest.nix b/vendor/libghostty-vt/nix/pkgs/wraptest.nix
new file mode 100644
index 00000000..a5cd89b7
--- /dev/null
+++ b/vendor/libghostty-vt/nix/pkgs/wraptest.nix
@@ -0,0 +1,43 @@
+{
+ stdenv,
+ fetchFromGitHub,
+ autoPatchelfHook,
+}:
+stdenv.mkDerivation rec {
+ version = "0.1.0-e7a96089";
+ pname = "wraptest";
+
+ src = fetchFromGitHub {
+ owner = "mattiase";
+ repo = pname;
+ rev = "e7a960892873035d2ef56b9770c32b43635821fb";
+ sha256 = "sha256-+v6xpPCmvKfsDkPmBSv6+6yAg2Kzame5Zwx2WKjQreI=";
+ };
+
+ nativeBuildInputs = [
+ autoPatchelfHook
+ ];
+
+ buildPhase = ''
+ runHook preBuild
+
+ cc -O3 -o wraptest wraptest.c
+
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+
+ mkdir -p $out/bin
+ cp wraptest $out/bin/
+
+ runHook postInstall
+ '';
+
+ meta = {
+ description = "Test of DEC VT terminal line-wrapping semantics";
+ homepage = "https://github.com/mattiase/wraptest";
+ platforms = ["aarch64-linux" "i686-linux" "x86_64-linux"];
+ };
+}
diff --git a/vendor/libghostty-vt/nix/tests.nix b/vendor/libghostty-vt/nix/tests.nix
new file mode 100644
index 00000000..28fefbf2
--- /dev/null
+++ b/vendor/libghostty-vt/nix/tests.nix
@@ -0,0 +1,284 @@
+{
+ self,
+ system,
+ nixpkgs,
+ home-manager,
+ ...
+}: let
+ nixos-version = nixpkgs.lib.trivial.release;
+
+ pkgs = import nixpkgs {
+ inherit system;
+ overlays = [
+ self.overlays.debug
+ ];
+ };
+
+ pink_value = "#FF0087";
+
+ color_test = ''
+ import tempfile
+ import subprocess
+
+ def check_for_pink(final=False) -> bool:
+ with tempfile.NamedTemporaryFile() as tmpin:
+ machine.send_monitor_command("screendump {}".format(tmpin.name))
+
+ cmd = 'convert {} -define histogram:unique-colors=true -format "%c" histogram:info:'.format(
+ tmpin.name
+ )
+ ret = subprocess.run(cmd, shell=True, capture_output=True)
+ if ret.returncode != 0:
+ raise Exception(
+ "image analysis failed with exit code {}".format(ret.returncode)
+ )
+
+ text = ret.stdout.decode("utf-8")
+ return "${pink_value}" in text
+ '';
+
+ mkNodeGnome = {
+ config,
+ pkgs,
+ settings,
+ sshPort ? null,
+ ...
+ }: {
+ imports = [
+ ./vm/wayland-gnome.nix
+ settings
+ ];
+
+ virtualisation = {
+ forwardPorts = pkgs.lib.optionals (sshPort != null) [
+ {
+ from = "host";
+ host.port = sshPort;
+ guest.port = 22;
+ }
+ ];
+
+ vmVariant = {
+ virtualisation.host.pkgs = pkgs;
+ };
+ };
+
+ services.openssh = {
+ enable = true;
+ settings = {
+ PermitRootLogin = "yes";
+ PermitEmptyPasswords = "yes";
+ };
+ };
+
+ security.pam.services.sshd.allowNullPassword = true;
+
+ users.groups.ghostty = {
+ gid = 1000;
+ };
+
+ users.users.ghostty = {
+ uid = 1000;
+ };
+
+ home-manager = {
+ users = {
+ ghostty = {
+ home = {
+ username = config.users.users.ghostty.name;
+ homeDirectory = config.users.users.ghostty.home;
+ stateVersion = nixos-version;
+ };
+ programs.ssh = {
+ enable = true;
+ enableDefaultConfig = false;
+ extraOptionOverrides = {
+ StrictHostKeyChecking = "accept-new";
+ UserKnownHostsFile = "/dev/null";
+ };
+ };
+ };
+ };
+ };
+
+ system.stateVersion = nixos-version;
+ };
+
+ mkTestGnome = {
+ name,
+ settings,
+ testScript,
+ ocr ? false,
+ }:
+ pkgs.testers.runNixOSTest {
+ name = name;
+
+ enableOCR = ocr;
+
+ extraBaseModules = {
+ imports = [
+ home-manager.nixosModules.home-manager
+ ];
+ };
+
+ nodes = {
+ machine = {
+ config,
+ pkgs,
+ ...
+ }:
+ mkNodeGnome {
+ inherit config pkgs settings;
+ sshPort = 2222;
+ };
+ };
+
+ testScript = testScript;
+ };
+in {
+ basic-version-check = pkgs.testers.runNixOSTest {
+ name = "basic-version-check";
+ nodes = {
+ machine = {pkgs, ...}: {
+ users.groups.ghostty = {};
+ users.users.ghostty = {
+ isNormalUser = true;
+ group = "ghostty";
+ extraGroups = ["wheel"];
+ hashedPassword = "";
+ packages = [
+ pkgs.ghostty
+ ];
+ };
+ };
+ };
+ testScript = {...}: ''
+ machine.succeed("su - ghostty -c 'ghostty +version'")
+ '';
+ };
+
+ basic-window-check-gnome = mkTestGnome {
+ name = "basic-window-check-gnome";
+ settings = {
+ home-manager.users.ghostty = {
+ xdg.configFile = {
+ "ghostty/config".text = ''
+ background = ${pink_value}
+ '';
+ };
+ };
+ };
+ ocr = true;
+ testScript = {nodes, ...}: let
+ user = nodes.machine.users.users.ghostty;
+ bus_path = "/run/user/${toString user.uid}/bus";
+ bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=${bus_path}";
+ gdbus = "${bus} gdbus";
+ ghostty = "${bus} ghostty";
+ su = command: "su - ${user.name} -c '${command}'";
+ gseval = "call --session -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval";
+ wm_class = su "${gdbus} ${gseval} global.display.focus_window.wm_class";
+ in ''
+ ${color_test}
+
+ with subtest("wait for x"):
+ start_all()
+ machine.wait_for_x()
+
+ machine.wait_for_file("${bus_path}")
+
+ with subtest("Ensuring no pink is present without the terminal."):
+ assert (
+ check_for_pink() == False
+ ), "Pink was present on the screen before we even launched a terminal!"
+
+ machine.systemctl("enable app-com.mitchellh.ghostty-debug.service", user="${user.name}")
+ machine.succeed("${su "${ghostty} +new-window"}")
+ machine.wait_until_succeeds("${wm_class} | grep -q 'com.mitchellh.ghostty-debug'")
+
+ machine.sleep(2)
+
+ with subtest("Have the terminal display a color."):
+ assert(
+ check_for_pink() == True
+ ), "Pink was not found on the screen!"
+
+ machine.systemctl("stop app-com.mitchellh.ghostty-debug.service", user="${user.name}")
+ '';
+ };
+
+ ssh-integration-test = pkgs.testers.runNixOSTest {
+ name = "ssh-integration-test";
+ extraBaseModules = {
+ imports = [
+ home-manager.nixosModules.home-manager
+ ];
+ };
+ nodes = {
+ server = {...}: {
+ users.groups.ghostty = {};
+ users.users.ghostty = {
+ isNormalUser = true;
+ group = "ghostty";
+ extraGroups = ["wheel"];
+ hashedPassword = "";
+ packages = [];
+ };
+ services.openssh = {
+ enable = true;
+ settings = {
+ PermitRootLogin = "yes";
+ PermitEmptyPasswords = "yes";
+ };
+ };
+ security.pam.services.sshd.allowNullPassword = true;
+ };
+ client = {
+ config,
+ pkgs,
+ ...
+ }:
+ mkNodeGnome {
+ inherit config pkgs;
+ settings = {
+ home-manager.users.ghostty = {
+ xdg.configFile = {
+ "ghostty/config".text = let
+ in ''
+ shell-integration-features = ssh-terminfo
+ '';
+ };
+ };
+ };
+ sshPort = 2222;
+ };
+ };
+ testScript = {nodes, ...}: let
+ user = nodes.client.users.users.ghostty;
+ bus_path = "/run/user/${toString user.uid}/bus";
+ bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=${bus_path}";
+ gdbus = "${bus} gdbus";
+ ghostty = "${bus} ghostty";
+ su = command: "su - ${user.name} -c '${command}'";
+ gseval = "call --session -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval";
+ wm_class = su "${gdbus} ${gseval} global.display.focus_window.wm_class";
+ in ''
+ with subtest("Start server and wait for ssh to be ready."):
+ server.start()
+ server.wait_for_open_port(22)
+
+ with subtest("Start client and wait for ghostty window."):
+ client.start()
+ client.wait_for_x()
+ client.wait_for_file("${bus_path}")
+ client.systemctl("enable app-com.mitchellh.ghostty-debug.service", user="${user.name}")
+ client.succeed("${su "${ghostty} +new-window"}")
+ client.wait_until_succeeds("${wm_class} | grep -q 'com.mitchellh.ghostty-debug'")
+
+ with subtest("SSH from client to server and verify that the Ghostty terminfo is copied."):
+ client.sleep(2)
+ client.send_chars("ssh ghostty@server\n")
+ server.wait_for_file("${user.home}/.terminfo/x/xterm-ghostty", timeout=30)
+ '';
+ };
+}
diff --git a/vendor/libghostty-vt/nix/vm/common-cinnamon.nix b/vendor/libghostty-vt/nix/vm/common-cinnamon.nix
new file mode 100644
index 00000000..dabe5e70
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/common-cinnamon.nix
@@ -0,0 +1,18 @@
+{...}: {
+ imports = [
+ ./common.nix
+ ];
+
+ services.xserver = {
+ displayManager = {
+ lightdm = {
+ enable = true;
+ };
+ };
+ desktopManager = {
+ cinnamon = {
+ enable = true;
+ };
+ };
+ };
+}
diff --git a/vendor/libghostty-vt/nix/vm/common-gnome.nix b/vendor/libghostty-vt/nix/vm/common-gnome.nix
new file mode 100644
index 00000000..d8d48407
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/common-gnome.nix
@@ -0,0 +1,149 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: {
+ imports = [
+ ./common.nix
+ ];
+
+ services = {
+ displayManager = {
+ gdm = {
+ enable = true;
+ autoSuspend = false;
+ };
+ };
+ desktopManager = {
+ gnome = {
+ enable = true;
+ };
+ };
+ };
+
+ systemd.user.services = {
+ "org.gnome.Shell@wayland" = {
+ serviceConfig = {
+ ExecStart = [
+ # Clear the list before overriding it.
+ ""
+ # Eval API is now internal so Shell needs to run in unsafe mode.
+ "${pkgs.gnome-shell}/bin/gnome-shell --unsafe-mode"
+ ];
+ };
+ };
+ };
+
+ environment.systemPackages = [
+ pkgs.gnomeExtensions.no-overview
+ ];
+
+ environment.gnome.excludePackages = with pkgs; [
+ atomix
+ baobab
+ cheese
+ epiphany
+ evince
+ file-roller
+ geary
+ gnome-backgrounds
+ gnome-calculator
+ gnome-calendar
+ gnome-clocks
+ gnome-connections
+ gnome-contacts
+ gnome-disk-utility
+ gnome-extension-manager
+ gnome-logs
+ gnome-maps
+ gnome-music
+ gnome-photos
+ gnome-software
+ gnome-system-monitor
+ gnome-text-editor
+ gnome-themes-extra
+ gnome-tour
+ gnome-user-docs
+ gnome-weather
+ hitori
+ iagno
+ loupe
+ nautilus
+ orca
+ seahorse
+ simple-scan
+ snapshot
+ sushi
+ tali
+ totem
+ yelp
+ ];
+
+ programs.dconf = {
+ enable = true;
+ profiles.user.databases = [
+ {
+ settings = with lib.gvariant; {
+ "org/gnome/desktop/background" = {
+ picture-uri = "file://${pkgs.ghostty}/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png";
+ picture-uri-dark = "file://${pkgs.ghostty}/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png";
+ picture-options = "centered";
+ primary-color = "#000000000000";
+ secondary-color = "#000000000000";
+ };
+ "org/gnome/desktop/interface" = {
+ color-scheme = "prefer-dark";
+ };
+ "org/gnome/desktop/notifications" = {
+ show-in-lock-screen = false;
+ };
+ "org/gnome/desktop/screensaver" = {
+ lock-enabled = false;
+ picture-uri = "file://${pkgs.ghostty}/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png";
+ picture-options = "centered";
+ primary-color = "#000000000000";
+ secondary-color = "#000000000000";
+ };
+ "org/gnome/desktop/session" = {
+ idle-delay = mkUint32 0;
+ };
+ "org/gnome/shell" = {
+ disable-user-extensions = false;
+ enabled-extensions = builtins.map (x: x.extensionUuid) (
+ lib.filter (p: p ? extensionUuid) config.environment.systemPackages
+ );
+ };
+ };
+ }
+ ];
+ };
+
+ programs.geary.enable = false;
+
+ services.gnome = {
+ gnome-browser-connector.enable = false;
+ gnome-initial-setup.enable = false;
+ gnome-online-accounts.enable = false;
+ gnome-remote-desktop.enable = false;
+ rygel.enable = false;
+ };
+
+ system.activationScripts = {
+ face = {
+ text = ''
+ mkdir -p /var/lib/AccountsService/{icons,users}
+
+ cp ${pkgs.ghostty}/share/icons/hicolor/1024x1024/apps/com.mitchellh.ghostty.png /var/lib/AccountsService/icons/ghostty
+
+ echo -e "[User]\nIcon=/var/lib/AccountsService/icons/ghostty\n" > /var/lib/AccountsService/users/ghostty
+
+ chown root:root /var/lib/AccountsService/users/ghostty
+ chmod 0600 /var/lib/AccountsService/users/ghostty
+
+ chown root:root /var/lib/AccountsService/icons/ghostty
+ chmod 0444 /var/lib/AccountsService/icons/ghostty
+ '';
+ };
+ };
+}
diff --git a/vendor/libghostty-vt/nix/vm/common-plasma6.nix b/vendor/libghostty-vt/nix/vm/common-plasma6.nix
new file mode 100644
index 00000000..e5c9bd4d
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/common-plasma6.nix
@@ -0,0 +1,21 @@
+{...}: {
+ imports = [
+ ./common.nix
+ ];
+
+ services = {
+ displayManager = {
+ sddm = {
+ enable = true;
+ wayland = {
+ enable = true;
+ };
+ };
+ };
+ desktopManager = {
+ plasma6 = {
+ enable = true;
+ };
+ };
+ };
+}
diff --git a/vendor/libghostty-vt/nix/vm/common-xfce.nix b/vendor/libghostty-vt/nix/vm/common-xfce.nix
new file mode 100644
index 00000000..12a20d8d
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/common-xfce.nix
@@ -0,0 +1,18 @@
+{...}: {
+ imports = [
+ ./common.nix
+ ];
+
+ services.xserver = {
+ displayManager = {
+ lightdm = {
+ enable = true;
+ };
+ };
+ desktopManager = {
+ xfce = {
+ enable = true;
+ };
+ };
+ };
+}
diff --git a/vendor/libghostty-vt/nix/vm/common.nix b/vendor/libghostty-vt/nix/vm/common.nix
new file mode 100644
index 00000000..b2fec28e
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/common.nix
@@ -0,0 +1,75 @@
+{pkgs, ...}: {
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ documentation.nixos.enable = false;
+
+ virtualisation.vmVariant = {
+ virtualisation.memorySize = 2048;
+ };
+
+ nix = {
+ settings = {
+ trusted-users = [
+ "root"
+ "ghostty"
+ ];
+ };
+ extraOptions = ''
+ experimental-features = nix-command flakes
+ '';
+ };
+
+ users.mutableUsers = false;
+
+ users.groups.ghostty = {};
+
+ users.users.ghostty = {
+ isNormalUser = true;
+ description = "Ghostty";
+ group = "ghostty";
+ extraGroups = ["wheel"];
+ hashedPassword = "";
+ };
+
+ environment.systemPackages = [
+ pkgs.kitty
+ pkgs.fish
+ pkgs.ghostty
+ pkgs.helix
+ pkgs.neovim
+ pkgs.xterm
+ pkgs.zsh
+ ];
+
+ security.polkit = {
+ enable = true;
+ };
+
+ services.dbus = {
+ enable = true;
+ };
+
+ services.displayManager = {
+ autoLogin = {
+ enable = true;
+ user = "ghostty";
+ };
+ };
+
+ services.libinput = {
+ enable = true;
+ };
+
+ services.qemuGuest = {
+ enable = true;
+ };
+
+ services.spice-vdagentd = {
+ enable = true;
+ };
+
+ services.xserver = {
+ enable = true;
+ };
+}
diff --git a/vendor/libghostty-vt/nix/vm/create-cinnamon.nix b/vendor/libghostty-vt/nix/vm/create-cinnamon.nix
new file mode 100644
index 00000000..a9d9e44d
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/create-cinnamon.nix
@@ -0,0 +1,12 @@
+{
+ system,
+ nixpkgs,
+ overlay,
+ module,
+ uid ? 1000,
+ gid ? 1000,
+}:
+import ./create.nix {
+ inherit system nixpkgs overlay module uid gid;
+ common = ./common-cinnamon.nix;
+}
diff --git a/vendor/libghostty-vt/nix/vm/create-gnome.nix b/vendor/libghostty-vt/nix/vm/create-gnome.nix
new file mode 100644
index 00000000..bcd31f2b
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/create-gnome.nix
@@ -0,0 +1,12 @@
+{
+ system,
+ nixpkgs,
+ overlay,
+ module,
+ uid ? 1000,
+ gid ? 1000,
+}:
+import ./create.nix {
+ inherit system nixpkgs overlay module uid gid;
+ common = ./common-gnome.nix;
+}
diff --git a/vendor/libghostty-vt/nix/vm/create-plasma6.nix b/vendor/libghostty-vt/nix/vm/create-plasma6.nix
new file mode 100644
index 00000000..ede5371f
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/create-plasma6.nix
@@ -0,0 +1,12 @@
+{
+ system,
+ nixpkgs,
+ overlay,
+ module,
+ uid ? 1000,
+ gid ? 1000,
+}:
+import ./create.nix {
+ inherit system nixpkgs overlay module uid gid;
+ common = ./common-plasma6.nix;
+}
diff --git a/vendor/libghostty-vt/nix/vm/create-xfce.nix b/vendor/libghostty-vt/nix/vm/create-xfce.nix
new file mode 100644
index 00000000..d1789472
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/create-xfce.nix
@@ -0,0 +1,12 @@
+{
+ system,
+ nixpkgs,
+ overlay,
+ module,
+ uid ? 1000,
+ gid ? 1000,
+}:
+import ./create.nix {
+ inherit system nixpkgs overlay module uid gid;
+ common = ./common-xfce.nix;
+}
diff --git a/vendor/libghostty-vt/nix/vm/create.nix b/vendor/libghostty-vt/nix/vm/create.nix
new file mode 100644
index 00000000..f8fe8500
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/create.nix
@@ -0,0 +1,42 @@
+{
+ system,
+ nixpkgs,
+ overlay,
+ module,
+ common ? ./common.nix,
+ uid ? 1000,
+ gid ? 1000,
+}: let
+ pkgs = import nixpkgs {
+ inherit system;
+ overlays = [
+ overlay
+ ];
+ };
+in
+ nixpkgs.lib.nixosSystem {
+ system = builtins.replaceStrings ["darwin"] ["linux"] system;
+ modules = [
+ {
+ virtualisation.vmVariant = {
+ virtualisation.host.pkgs = pkgs;
+ };
+
+ nixpkgs.overlays = [
+ overlay
+ ];
+
+ users.groups.ghostty = {
+ gid = gid;
+ };
+
+ users.users.ghostty = {
+ uid = uid;
+ };
+
+ system.stateVersion = nixpkgs.lib.trivial.release;
+ }
+ common
+ module
+ ];
+ }
diff --git a/vendor/libghostty-vt/nix/vm/wayland-cinnamon.nix b/vendor/libghostty-vt/nix/vm/wayland-cinnamon.nix
new file mode 100644
index 00000000..531c882b
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/wayland-cinnamon.nix
@@ -0,0 +1,7 @@
+{...}: {
+ imports = [
+ ./common-cinnamon.nix
+ ];
+
+ services.displayManager.defaultSession = "cinnamon-wayland";
+}
diff --git a/vendor/libghostty-vt/nix/vm/wayland-gnome.nix b/vendor/libghostty-vt/nix/vm/wayland-gnome.nix
new file mode 100644
index 00000000..eb277d5d
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/wayland-gnome.nix
@@ -0,0 +1,9 @@
+{...}: {
+ imports = [
+ ./common-gnome.nix
+ ];
+
+ services.displayManager = {
+ defaultSession = "gnome";
+ };
+}
diff --git a/vendor/libghostty-vt/nix/vm/wayland-plasma6.nix b/vendor/libghostty-vt/nix/vm/wayland-plasma6.nix
new file mode 100644
index 00000000..6e5a253b
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/wayland-plasma6.nix
@@ -0,0 +1,6 @@
+{...}: {
+ imports = [
+ ./common-plasma6.nix
+ ];
+ services.displayManager.defaultSession = "plasma";
+}
diff --git a/vendor/libghostty-vt/nix/vm/x11-cinnamon.nix b/vendor/libghostty-vt/nix/vm/x11-cinnamon.nix
new file mode 100644
index 00000000..636f235a
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/x11-cinnamon.nix
@@ -0,0 +1,7 @@
+{...}: {
+ imports = [
+ ./common-cinnamon.nix
+ ];
+
+ services.displayManager.defaultSession = "cinnamon";
+}
diff --git a/vendor/libghostty-vt/nix/vm/x11-plasma6.nix b/vendor/libghostty-vt/nix/vm/x11-plasma6.nix
new file mode 100644
index 00000000..7818a80c
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/x11-plasma6.nix
@@ -0,0 +1,6 @@
+{...}: {
+ imports = [
+ ./common-plasma6.nix
+ ];
+ services.displayManager.defaultSession = "plasmax11";
+}
diff --git a/vendor/libghostty-vt/nix/vm/x11-xfce.nix b/vendor/libghostty-vt/nix/vm/x11-xfce.nix
new file mode 100644
index 00000000..71eb87f2
--- /dev/null
+++ b/vendor/libghostty-vt/nix/vm/x11-xfce.nix
@@ -0,0 +1,7 @@
+{...}: {
+ imports = [
+ ./common-xfce.nix
+ ];
+
+ services.displayManager.defaultSession = "xfce";
+}
diff --git a/vendor/libghostty-vt/nix/zigCacheHash.nix b/vendor/libghostty-vt/nix/zigCacheHash.nix
new file mode 100644
index 00000000..12f855e5
--- /dev/null
+++ b/vendor/libghostty-vt/nix/zigCacheHash.nix
@@ -0,0 +1,3 @@
+# This file is auto-generated! check build-support/check-zig-cache-hash.sh for
+# more details.
+"sha256-S8kS+gO17dl9LJGKL1+kgDUre+vPTmdTvXzgc585Fl8="
diff --git a/vendor/libghostty-vt/pkg/README.md b/vendor/libghostty-vt/pkg/README.md
new file mode 100644
index 00000000..fddc4b3d
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/README.md
@@ -0,0 +1,33 @@
+# Packages
+
+This folder contains packages written for and used by Ghostty that could
+potentially be useful for other projects. These are in-tree with Ghostty
+because I don't want to maintain them as separate projects (i.e. get
+dedicated issues, PRs, etc.). If you want to use them, you can copy and
+paste them into your project.
+
+## License
+
+**This license only applies to the contents of the `pkg` folder within
+the Ghostty project. This license does not apply to the rest of the
+Ghostty project.**
+
+Copyright © 2024 Mitchell Hashimoto, Ghostty contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the “Software”), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/libghostty-vt/pkg/afl++/LICENSE b/vendor/libghostty-vt/pkg/afl++/LICENSE
new file mode 100644
index 00000000..5f5fc85e
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/afl++/LICENSE
@@ -0,0 +1,23 @@
+Based on zig-afl-kit: https://github.com/kristoff-it/zig-afl-kit
+
+MIT License
+
+Copyright (c) 2024 Loris Cro
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/libghostty-vt/pkg/afl++/afl.c b/vendor/libghostty-vt/pkg/afl++/afl.c
new file mode 100644
index 00000000..61eb12c4
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/afl++/afl.c
@@ -0,0 +1,141 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+// AFL++ fuzzer harness for Zig fuzz targets.
+//
+// This file is the C "glue" that connects AFL++'s runtime to Zig-defined
+// fuzz test functions. We can't use AFL++'s compiler wrappers (afl-clang,
+// afl-gcc) because the code under test is compiled with Zig, so we manually
+// expand the AFL macros (__AFL_INIT, __AFL_LOOP, __AFL_FUZZ_INIT, etc.) and
+// wire up the sanitizer coverage symbols ourselves.
+
+// To ensure checks are not optimized out it is recommended to disable
+// code optimization for the fuzzer harness main()
+#pragma clang optimize off
+#pragma GCC optimize("O0")
+
+// Zig-exported entry points. zig_fuzz_init() performs one-time setup and
+// zig_fuzz_test() runs one fuzz iteration on the given input buffer.
+// The Zig object should export these.
+void zig_fuzz_init();
+void zig_fuzz_test(unsigned char*, size_t);
+
+// Linker-provided symbols marking the boundaries of the __sancov_guards
+// section. These must be declared extern so the linker provides the actual
+// section boundaries from the instrumented code, rather than creating new
+// variables that shadow them. On macOS (Mach-O), the linker uses a different
+// naming convention for section boundaries than Linux (ELF), so we use asm
+// labels to reference them.
+#ifdef __APPLE__
+extern uint32_t __start___sancov_guards __asm(
+ "section$start$__DATA$__sancov_guards");
+extern uint32_t __stop___sancov_guards __asm(
+ "section$end$__DATA$__sancov_guards");
+#else
+extern uint32_t __start___sancov_guards;
+extern uint32_t __stop___sancov_guards;
+#endif
+
+// Provided by afl-compiler-rt; initializes the guard array used by
+// SanitizerCoverage's trace-pc-guard instrumentation mode.
+void __sanitizer_cov_trace_pc_guard_init(uint32_t*, uint32_t*);
+
+// Stubs for sanitizer coverage callbacks that the Zig-compiled code references
+// but AFL's runtime (afl-compiler-rt) does not provide. Without these, linking
+// would fail with undefined symbol errors.
+__attribute__((visibility("default"))) __attribute__((
+ tls_model("initial-exec"))) _Thread_local uintptr_t __sancov_lowest_stack;
+void __sanitizer_cov_trace_pc_indir() {}
+void __sanitizer_cov_8bit_counters_init() {}
+void __sanitizer_cov_pcs_init() {}
+
+// Manual expansion of __AFL_FUZZ_INIT().
+//
+// Enables shared-memory fuzzing: AFL++ writes test cases directly into
+// shared memory (__afl_fuzz_ptr) instead of passing them via stdin, which
+// is much faster. When not running under AFL++ (e.g. standalone execution),
+// __afl_fuzz_ptr will be NULL and we fall back to reading from stdin into
+// __afl_fuzz_alt (a 1 MB static buffer).
+int __afl_sharedmem_fuzzing = 1;
+extern __attribute__((visibility("default"))) unsigned int* __afl_fuzz_len;
+extern __attribute__((visibility("default"))) unsigned char* __afl_fuzz_ptr;
+unsigned char __afl_fuzz_alt[1048576];
+unsigned char* __afl_fuzz_alt_ptr = __afl_fuzz_alt;
+
+int main(int argc, char** argv) {
+ // Tell AFL's coverage runtime about our guard section so it can track
+ // which edges in the instrumented Zig code have been hit.
+ __sanitizer_cov_trace_pc_guard_init(&__start___sancov_guards,
+ &__stop___sancov_guards);
+
+ // Manual expansion of __AFL_INIT() — deferred fork server mode.
+ //
+ // The magic string "##SIG_AFL_DEFER_FORKSRV##" is embedded in the binary
+ // so AFL++'s tooling can detect that this harness uses deferred fork
+ // server initialization. The `volatile` + `used` attributes prevent the
+ // compiler/linker from stripping it. We then call __afl_manual_init() to
+ // start the fork server at this point (after our setup) rather than at
+ // the very beginning of main().
+ static volatile const char* _A __attribute__((used, unused));
+ _A = (const char*)"##SIG_AFL_DEFER_FORKSRV##";
+#ifdef __APPLE__
+ __attribute__((visibility("default"))) void _I(void) __asm__(
+ "___afl_manual_init");
+#else
+ __attribute__((visibility("default"))) void _I(void) __asm__(
+ "__afl_manual_init");
+#endif
+ _I();
+
+ zig_fuzz_init();
+
+ // Manual expansion of __AFL_FUZZ_TESTCASE_BUF.
+ // Use shared memory buffer if available, otherwise fall back to the
+ // static buffer (for standalone/non-AFL execution).
+ unsigned char* buf = __afl_fuzz_ptr ? __afl_fuzz_ptr : __afl_fuzz_alt_ptr;
+
+ // Manual expansion of __AFL_LOOP(UINT_MAX) — persistent mode loop.
+ //
+ // Persistent mode keeps the process alive across many test cases instead
+ // of fork()'ing for each one, dramatically improving throughput. The magic
+ // string "##SIG_AFL_PERSISTENT##" signals to AFL++ that this binary
+ // supports persistent mode. __afl_persistent_loop() returns non-zero
+ // while there are more inputs to process.
+ //
+ // When connected to AFL++, we loop UINT_MAX times (essentially forever,
+ // AFL will restart us periodically). When running standalone, we loop
+ // once so the harness can be used for manual testing/reproduction.
+ while (({
+ static volatile const char* _B __attribute__((used, unused));
+ _B = (const char*)"##SIG_AFL_PERSISTENT##";
+ extern __attribute__((visibility("default"))) int __afl_connected;
+#ifdef __APPLE__
+ __attribute__((visibility("default"))) int _L(unsigned int) __asm__(
+ "___afl_persistent_loop");
+#else
+ __attribute__((visibility("default"))) int _L(unsigned int) __asm__(
+ "__afl_persistent_loop");
+#endif
+ _L(__afl_connected ? UINT_MAX : 1);
+ })) {
+ // Manual expansion of __AFL_FUZZ_TESTCASE_LEN.
+ // In shared-memory mode, the length is provided directly by AFL++.
+ // In standalone mode, we read from stdin into the fallback buffer.
+ int len =
+ __afl_fuzz_ptr ? *__afl_fuzz_len
+ : (*__afl_fuzz_len = read(0, __afl_fuzz_alt_ptr, 1048576)) == 0xffffffff
+ ? 0
+ : *__afl_fuzz_len;
+
+ if (len >= 0) {
+ zig_fuzz_test(buf, len);
+ }
+ }
+
+ return 0;
+}
diff --git a/vendor/libghostty-vt/pkg/afl++/build.zig b/vendor/libghostty-vt/pkg/afl++/build.zig
new file mode 100644
index 00000000..9de3ad01
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/afl++/build.zig
@@ -0,0 +1,59 @@
+const std = @import("std");
+
+/// Creates a build step that produces an AFL++-instrumented fuzzing
+/// executable.
+///
+/// Returns a `LazyPath` to the resulting fuzzing executable.
+pub fn addInstrumentedExe(
+ b: *std.Build,
+ obj: *std.Build.Step.Compile,
+) std.Build.LazyPath {
+ // Force the build system to produce the binary artifact even though we
+ // only consume the LLVM bitcode below. Without this, the dependency
+ // tracking doesn't wire up correctly.
+ _ = obj.getEmittedBin();
+
+ const pkg = b.dependencyFromBuildZig(
+ @This(),
+ .{},
+ );
+
+ const afl_cc = b.addSystemCommand(&.{
+ b.findProgram(&.{"afl-cc"}, &.{}) catch
+ @panic("Could not find 'afl-cc', which is required to build"),
+ "-O3",
+ });
+ afl_cc.addArg("-o");
+ const fuzz_exe = afl_cc.addOutputFileArg(obj.name);
+ afl_cc.addFileArg(pkg.path("afl.c"));
+ afl_cc.addFileArg(obj.getEmittedLlvmBc());
+ return fuzz_exe;
+}
+
+/// Creates a run step that invokes `afl-fuzz` with the given instrumented
+/// executable, input corpus directory, and output directory.
+///
+/// Returns the `Run` step so callers can wire it into a build step.
+pub fn addFuzzerRun(
+ b: *std.Build,
+ exe: std.Build.LazyPath,
+ corpus_dir: std.Build.LazyPath,
+ output_dir: std.Build.LazyPath,
+) *std.Build.Step.Run {
+ const run = b.addSystemCommand(&.{
+ b.findProgram(&.{"afl-fuzz"}, &.{}) catch
+ @panic("Could not find 'afl-fuzz', which is required to run"),
+ "-i",
+ });
+ run.addDirectoryArg(corpus_dir);
+ run.addArgs(&.{"-o"});
+ run.addDirectoryArg(output_dir);
+ run.addArgs(&.{"--"});
+ run.addFileArg(exe);
+ return run;
+}
+
+// Required so `zig build` works although it does nothing.
+pub fn build(b: *std.Build) !void {
+ _ = b;
+}
diff --git a/vendor/libghostty-vt/pkg/afl++/build.zig.zon b/vendor/libghostty-vt/pkg/afl++/build.zig.zon
new file mode 100644
index 00000000..1fd3d5a4
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/afl++/build.zig.zon
@@ -0,0 +1,11 @@
+.{
+ .name = .afl_plus_plus,
+ .fingerprint = 0x465bc4bebb188f16,
+ .version = "0.1.0",
+ .dependencies = .{},
+ .paths = .{
+ "build.zig",
+ "build.zig.zon",
+ "afl.c",
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/android-ndk/build.zig b/vendor/libghostty-vt/pkg/android-ndk/build.zig
new file mode 100644
index 00000000..5b005665
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/android-ndk/build.zig
@@ -0,0 +1,207 @@
+const std = @import("std");
+const builtin = @import("builtin");
+
+pub fn build(_: *std.Build) !void {}
+
+// Configure the step to point to the Android NDK for libc and include
+// paths. This requires the Android NDK installed in the system and
+// setting the appropriate environment variables or installing the NDK
+// in the default location.
+//
+// The environment variables can be set as follows:
+// - `ANDROID_NDK_HOME`: Directly points to the NDK path, including the version.
+// - `ANDROID_HOME` or `ANDROID_SDK_ROOT`: Points to the Android SDK path;
+// latest available NDK will be automatically selected.
+//
+// NB: This is a workaround until zig natively supports bionic
+// cross-compilation (ziglang/zig#23906).
+pub fn addPaths(b: *std.Build, step: *std.Build.Step.Compile) !void {
+ const Cache = struct {
+ const Key = struct {
+ arch: std.Target.Cpu.Arch,
+ abi: std.Target.Abi,
+ api_level: u32,
+ };
+
+ var map: std.AutoHashMapUnmanaged(Key, ?struct {
+ libc: std.Build.LazyPath,
+ cpp_include: std.Build.LazyPath,
+ lib: std.Build.LazyPath,
+ }) = .empty;
+ };
+
+ const target = step.rootModuleTarget();
+ const gop = try Cache.map.getOrPut(b.allocator, .{
+ .arch = target.cpu.arch,
+ .abi = target.abi,
+ .api_level = target.os.version_range.linux.android,
+ });
+
+ if (!gop.found_existing) {
+ const ndk_path = findNDKPath(b) orelse return error.AndroidNDKNotFound;
+
+ const ndk_triple = ndkTriple(target) orelse {
+ gop.value_ptr.* = null;
+ return error.AndroidNDKUnsupportedTarget;
+ };
+
+ const host = hostTag() orelse {
+ gop.value_ptr.* = null;
+ return error.AndroidNDKUnsupportedHost;
+ };
+
+ const sysroot = b.pathJoin(&.{
+ ndk_path,
+ "toolchains",
+ "llvm",
+ "prebuilt",
+ host,
+ "sysroot",
+ });
+ const include_dir = b.pathJoin(&.{
+ sysroot,
+ "usr",
+ "include",
+ });
+ const sys_include_dir = b.pathJoin(&.{
+ sysroot,
+ "usr",
+ "include",
+ ndk_triple,
+ });
+ const c_runtime_dir = b.pathJoin(&.{
+ sysroot,
+ "usr",
+ "lib",
+ ndk_triple,
+ b.fmt("{d}", .{target.os.version_range.linux.android}),
+ });
+ const lib = b.pathJoin(&.{
+ sysroot,
+ "usr",
+ "lib",
+ ndk_triple,
+ });
+ const cpp_include = b.pathJoin(&.{
+ sysroot,
+ "usr",
+ "include",
+ "c++",
+ "v1",
+ });
+
+ const libc_txt = b.fmt(
+ \\include_dir={s}
+ \\sys_include_dir={s}
+ \\crt_dir={s}
+ \\msvc_lib_dir=
+ \\kernel32_lib_dir=
+ \\gcc_dir=
+ , .{ include_dir, sys_include_dir, c_runtime_dir });
+
+ const wf = b.addWriteFiles();
+ const libc_path = wf.add("libc.txt", libc_txt);
+
+ gop.value_ptr.* = .{
+ .libc = libc_path,
+ .cpp_include = .{ .cwd_relative = cpp_include },
+ .lib = .{ .cwd_relative = lib },
+ };
+ }
+
+ const value = gop.value_ptr.* orelse return error.AndroidNDKNotFound;
+
+ step.setLibCFile(value.libc);
+ step.root_module.addSystemIncludePath(value.cpp_include);
+ step.root_module.addLibraryPath(value.lib);
+}
+
+fn findNDKPath(b: *std.Build) ?[]const u8 {
+ // Check if user has set the environment variable for the NDK path.
+ if (std.process.getEnvVarOwned(b.allocator, "ANDROID_NDK_HOME") catch null) |value| {
+ if (value.len == 0) return null;
+ var dir = std.fs.openDirAbsolute(value, .{}) catch return null;
+ defer dir.close();
+ return value;
+ }
+
+ // Check the common environment variables for the Android SDK path and look for the NDK inside it.
+ inline for (.{ "ANDROID_HOME", "ANDROID_SDK_ROOT" }) |env| {
+ if (std.process.getEnvVarOwned(b.allocator, env) catch null) |sdk| {
+ if (sdk.len > 0) {
+ if (findLatestNDK(b, sdk)) |ndk| return ndk;
+ }
+ }
+ }
+
+ // As a fallback, we assume the most common/default SDK path based on the OS.
+ const home = std.process.getEnvVarOwned(
+ b.allocator,
+ if (builtin.os.tag == .windows) "LOCALAPPDATA" else "HOME",
+ ) catch return null;
+
+ const default_sdk_path = b.pathJoin(
+ &.{
+ home,
+ switch (builtin.os.tag) {
+ .linux => "Android/sdk",
+ .macos => "Library/Android/Sdk",
+ .windows => "Android/Sdk",
+ else => return null,
+ },
+ },
+ );
+
+ return findLatestNDK(b, default_sdk_path);
+}
+
+fn findLatestNDK(b: *std.Build, sdk_path: []const u8) ?[]const u8 {
+ const ndk_dir = b.pathJoin(&.{ sdk_path, "ndk" });
+ var dir = std.fs.openDirAbsolute(ndk_dir, .{ .iterate = true }) catch return null;
+ defer dir.close();
+
+ var latest_: ?struct {
+ name: []const u8,
+ version: std.SemanticVersion,
+ } = null;
+ var iterator = dir.iterate();
+
+ while (iterator.next() catch null) |file| {
+ if (file.kind != .directory) continue;
+ const version = std.SemanticVersion.parse(file.name) catch continue;
+ if (latest_) |latest| {
+ if (version.order(latest.version) != .gt) continue;
+ }
+ latest_ = .{
+ .name = file.name,
+ .version = version,
+ };
+ }
+
+ const latest = latest_ orelse return null;
+
+ return b.pathJoin(&.{ sdk_path, "ndk", latest.name });
+}
+
+fn hostTag() ?[]const u8 {
+ return switch (builtin.os.tag) {
+ .linux => "linux-x86_64",
+ // All darwin hosts use the same prebuilt binaries
+ // (https://developer.android.com/ndk/guides/other_build_systems).
+ .macos => "darwin-x86_64",
+ .windows => "windows-x86_64",
+ else => null,
+ };
+}
+
+// We must map the target architecture to the corresponding NDK triple following the NDK
+// documentation: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#architectures
+fn ndkTriple(target: std.Target) ?[]const u8 {
+ return switch (target.cpu.arch) {
+ .arm => "arm-linux-androideabi",
+ .aarch64 => "aarch64-linux-android",
+ .x86 => "i686-linux-android",
+ .x86_64 => "x86_64-linux-android",
+ else => null,
+ };
+}
diff --git a/vendor/libghostty-vt/pkg/android-ndk/build.zig.zon b/vendor/libghostty-vt/pkg/android-ndk/build.zig.zon
new file mode 100644
index 00000000..eb0de682
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/android-ndk/build.zig.zon
@@ -0,0 +1,10 @@
+.{
+ .name = .android_ndk,
+ .version = "0.0.2",
+ .fingerprint = 0xee68d62c5a97b68b,
+ .dependencies = .{},
+ .paths = .{
+ "build.zig",
+ "build.zig.zon",
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/apple-sdk/build.zig b/vendor/libghostty-vt/pkg/apple-sdk/build.zig
new file mode 100644
index 00000000..c573c391
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/apple-sdk/build.zig
@@ -0,0 +1,111 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+ _ = target;
+ _ = optimize;
+}
+
+/// Setup the step to point to the proper Apple SDK for libc and
+/// frameworks. This expects and relies on the native SDK being
+/// installed on the system. Ghostty doesn't support cross-compilation
+/// for Apple platforms.
+pub fn addPaths(
+ b: *std.Build,
+ step: *std.Build.Step.Compile,
+) !void {
+ // The cache. This always uses b.allocator and never frees memory
+ // (which is idiomatic for a Zig build exe). We cache the libc txt
+ // file we create because it is expensive to generate (subprocesses).
+ const Cache = struct {
+ const Key = struct {
+ arch: std.Target.Cpu.Arch,
+ os: std.Target.Os.Tag,
+ abi: std.Target.Abi,
+ };
+
+ var map: std.AutoHashMapUnmanaged(Key, ?struct {
+ libc: std.Build.LazyPath,
+ framework: []const u8,
+ system_include: []const u8,
+ library: []const u8,
+ }) = .{};
+ };
+
+ const target = step.rootModuleTarget();
+ const gop = try Cache.map.getOrPut(b.allocator, .{
+ .arch = target.cpu.arch,
+ .os = target.os.tag,
+ .abi = target.abi,
+ });
+
+ if (!gop.found_existing) {
+ // Detect our SDK using the "findNative" Zig stdlib function.
+ // This is really important because it forces using `xcrun` to
+ // find the SDK path.
+ const libc = try std.zig.LibCInstallation.findNative(.{
+ .allocator = b.allocator,
+ .target = &step.rootModuleTarget(),
+ .verbose = false,
+ });
+
+ // Render the file compatible with the `--libc` Zig flag.
+ var stream: std.io.Writer.Allocating = .init(b.allocator);
+ defer stream.deinit();
+ try libc.render(&stream.writer);
+
+ // Create a temporary file to store the libc path because
+ // `--libc` expects a file path.
+ const wf = b.addWriteFiles();
+ const path = wf.add("libc.txt", stream.written());
+
+ // Determine our framework path. Zig has a bug where it doesn't
+ // parse this from the libc txt file for `-framework` flags:
+ // https://github.com/ziglang/zig/issues/24024
+ const framework_path = framework: {
+ const down1 = std.fs.path.dirname(libc.sys_include_dir.?).?;
+ const down2 = std.fs.path.dirname(down1).?;
+ break :framework try std.fs.path.join(b.allocator, &.{
+ down2,
+ "System",
+ "Library",
+ "Frameworks",
+ });
+ };
+
+ const library_path = library: {
+ const down1 = std.fs.path.dirname(libc.sys_include_dir.?).?;
+ break :library try std.fs.path.join(b.allocator, &.{
+ down1,
+ "lib",
+ });
+ };
+
+ gop.value_ptr.* = .{
+ .libc = path,
+ .framework = framework_path,
+ .system_include = libc.sys_include_dir.?,
+ .library = library_path,
+ };
+ }
+
+ const value = gop.value_ptr.* orelse return switch (target.os.tag) {
+ // Return a more descriptive error. Before we just returned the
+ // generic error but this was confusing a lot of community members.
+ // It costs us nothing in the build script to return something better.
+ .macos => error.XcodeMacOSSDKNotFound,
+ .ios => error.XcodeiOSSDKNotFound,
+ .tvos => error.XcodeTVOSSDKNotFound,
+ .watchos => error.XcodeWatchOSSDKNotFound,
+ else => error.XcodeAppleSDKNotFound,
+ };
+
+ step.setLibCFile(value.libc);
+
+ // This is only necessary until this bug is fixed:
+ // https://github.com/ziglang/zig/issues/24024
+ step.root_module.addSystemFrameworkPath(.{ .cwd_relative = value.framework });
+ step.root_module.addSystemIncludePath(.{ .cwd_relative = value.system_include });
+ step.root_module.addLibraryPath(.{ .cwd_relative = value.library });
+}
diff --git a/vendor/libghostty-vt/pkg/apple-sdk/build.zig.zon b/vendor/libghostty-vt/pkg/apple-sdk/build.zig.zon
new file mode 100644
index 00000000..4fa12c23
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/apple-sdk/build.zig.zon
@@ -0,0 +1,7 @@
+.{
+ .name = .apple_sdk,
+ .version = "0.1.0",
+ .dependencies = .{},
+ .fingerprint = 0xdde52860f7c464d2,
+ .paths = .{""},
+}
diff --git a/vendor/libghostty-vt/pkg/breakpad/build.zig b/vendor/libghostty-vt/pkg/breakpad/build.zig
new file mode 100644
index 00000000..56d51b15
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/breakpad/build.zig
@@ -0,0 +1,159 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const lib = b.addLibrary(.{
+ .name = "breakpad",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibCpp();
+ lib.addIncludePath(b.path("vendor"));
+ if (target.result.os.tag.isDarwin()) {
+ const apple_sdk = @import("apple_sdk");
+ try apple_sdk.addPaths(b, lib);
+ }
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+
+ if (b.lazyDependency("breakpad", .{})) |upstream| {
+ lib.addIncludePath(upstream.path("src"));
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = common,
+ .flags = flags.items,
+ });
+
+ if (target.result.os.tag.isDarwin()) {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = common_apple,
+ .flags = flags.items,
+ });
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = client_apple,
+ .flags = flags.items,
+ });
+
+ switch (target.result.os.tag) {
+ .macos => {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = common_mac,
+ .flags = flags.items,
+ });
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = client_mac,
+ .flags = flags.items,
+ });
+ },
+
+ .ios => lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = client_ios,
+ .flags = flags.items,
+ }),
+
+ else => {},
+ }
+ }
+
+ if (target.result.os.tag == .linux) {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = common_linux,
+ .flags = flags.items,
+ });
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = client_linux,
+ .flags = flags.items,
+ });
+ }
+
+ lib.installHeadersDirectory(
+ upstream.path("src"),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ b.installArtifact(lib);
+}
+
+const common: []const []const u8 = &.{
+ "src/common/convert_UTF.cc",
+ "src/common/md5.cc",
+ "src/common/string_conversion.cc",
+};
+
+const common_linux: []const []const u8 = &.{
+ "src/common/linux/elf_core_dump.cc",
+ "src/common/linux/elfutils.cc",
+ "src/common/linux/file_id.cc",
+ "src/common/linux/guid_creator.cc",
+ "src/common/linux/linux_libc_support.cc",
+ "src/common/linux/memory_mapped_file.cc",
+ "src/common/linux/safe_readlink.cc",
+ "src/common/linux/scoped_pipe.cc",
+ "src/common/linux/scoped_tmpfile.cc",
+ "src/common/linux/breakpad_getcontext.S",
+};
+
+const common_apple: []const []const u8 = &.{
+ "src/common/mac/arch_utilities.cc",
+ "src/common/mac/file_id.cc",
+ "src/common/mac/macho_id.cc",
+ "src/common/mac/macho_utilities.cc",
+ "src/common/mac/macho_walker.cc",
+ "src/common/mac/string_utilities.cc",
+};
+
+const common_mac: []const []const u8 = &.{
+ "src/common/mac/MachIPC.mm",
+ "src/common/mac/bootstrap_compat.cc",
+};
+
+const client_linux: []const []const u8 = &.{
+ "src/client/minidump_file_writer.cc",
+ "src/client/linux/crash_generation/crash_generation_client.cc",
+ "src/client/linux/crash_generation/crash_generation_server.cc",
+ "src/client/linux/dump_writer_common/thread_info.cc",
+ "src/client/linux/dump_writer_common/ucontext_reader.cc",
+ "src/client/linux/handler/exception_handler.cc",
+ "src/client/linux/handler/minidump_descriptor.cc",
+ "src/client/linux/log/log.cc",
+ "src/client/linux/microdump_writer/microdump_writer.cc",
+ "src/client/linux/minidump_writer/linux_core_dumper.cc",
+ "src/client/linux/minidump_writer/linux_dumper.cc",
+ "src/client/linux/minidump_writer/linux_ptrace_dumper.cc",
+ "src/client/linux/minidump_writer/minidump_writer.cc",
+ "src/client/linux/minidump_writer/pe_file.cc",
+};
+
+const client_apple: []const []const u8 = &.{
+ "src/client/minidump_file_writer.cc",
+ "src/client/mac/handler/breakpad_nlist_64.cc",
+ "src/client/mac/handler/dynamic_images.cc",
+ "src/client/mac/handler/minidump_generator.cc",
+};
+
+const client_mac: []const []const u8 = &.{
+ "src/client/mac/handler/exception_handler.cc",
+ "src/client/mac/crash_generation/crash_generation_client.cc",
+};
+
+const client_ios: []const []const u8 = &.{
+ "src/client/ios/exception_handler_no_mach.cc",
+ "src/client/ios/handler/ios_exception_minidump_generator.mm",
+ "src/client/mac/crash_generation/ConfigFile.mm",
+ "src/client/mac/handler/protected_memory_allocator.cc",
+};
diff --git a/vendor/libghostty-vt/pkg/breakpad/build.zig.zon b/vendor/libghostty-vt/pkg/breakpad/build.zig.zon
new file mode 100644
index 00000000..0d6c54c9
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/breakpad/build.zig.zon
@@ -0,0 +1,15 @@
+.{
+ .name = .breakpad,
+ .version = "0.1.0",
+ .fingerprint = 0xfe9f9e4c76d5f962,
+ .paths = .{""},
+ .dependencies = .{
+ .breakpad = .{
+ .url = "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz",
+ .hash = "N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ",
+ .lazy = true,
+ },
+
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/dcimgui/build.zig b/vendor/libghostty-vt/pkg/dcimgui/build.zig
new file mode 100644
index 00000000..01a5879d
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/dcimgui/build.zig
@@ -0,0 +1,210 @@
+const std = @import("std");
+const NativeTargetInfo = std.zig.system.NativeTargetInfo;
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+ const freetype = b.option(bool, "freetype", "Use Freetype") orelse false;
+ const backend_opengl3 = b.option(bool, "backend-opengl3", "OpenGL3 backend") orelse false;
+ const backend_metal = b.option(bool, "backend-metal", "Metal backend") orelse false;
+ const backend_osx = b.option(bool, "backend-osx", "OSX backend") orelse false;
+
+ // Build options
+ const options = b.addOptions();
+ options.addOption(bool, "freetype", freetype);
+ options.addOption(bool, "backend_opengl3", backend_opengl3);
+ options.addOption(bool, "backend_metal", backend_metal);
+ options.addOption(bool, "backend_osx", backend_osx);
+
+ // Main static lib
+ const lib = b.addLibrary(.{
+ .name = "dcimgui",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ // On MSVC, we must not use linkLibCpp because Zig unconditionally
+ // passes -nostdinc++ and then adds its bundled libc++/libc++abi
+ // include paths, which conflict with MSVC's own C++ runtime headers.
+ // The MSVC SDK include directories (added via linkLibC) contain
+ // both C and C++ headers, so linkLibCpp is not needed.
+ if (target.result.abi != .msvc) {
+ lib.linkLibCpp();
+ }
+ b.installArtifact(lib);
+
+ // Zig module
+ const mod = b.addModule("dcimgui", .{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ });
+ mod.addOptions("build_options", options);
+ mod.linkLibrary(lib);
+
+ // We need to add proper Apple SDKs to find stdlib headers
+ if (target.result.os.tag.isDarwin()) {
+ if (!target.query.isNative()) {
+ try @import("apple_sdk").addPaths(b, lib);
+ }
+ }
+
+ // Flags for C compilation, common to all.
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ "-DIMGUI_HAS_DOCK=1",
+ "-DIMGUI_USE_WCHAR32=1",
+ "-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1",
+ });
+ if (freetype) try flags.appendSlice(b.allocator, &.{
+ "-DIMGUI_ENABLE_FREETYPE=1",
+ });
+ if (backend_opengl3) try flags.appendSlice(b.allocator, &.{
+ "-DZIGPKG_IMGUI_ENABLE_OPENGL3=1",
+ });
+ if (target.result.os.tag == .windows) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DIMGUI_IMPL_API=extern\t\"C\"\t__declspec(dllexport)",
+ });
+ } else {
+ try flags.appendSlice(b.allocator, &.{
+ "-DIMGUI_IMPL_API=extern\t\"C\"",
+ });
+ }
+ if (target.result.os.tag == .freebsd or target.result.abi == .musl) {
+ try flags.append(b.allocator, "-fPIC");
+ }
+
+ // Add the core Dear Imgui source files
+ if (b.lazyDependency("imgui", .{})) |upstream| {
+ lib.addIncludePath(upstream.path(""));
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = &.{
+ "imgui_demo.cpp",
+ "imgui_draw.cpp",
+ "imgui_tables.cpp",
+ "imgui_widgets.cpp",
+ "imgui.cpp",
+ },
+ .flags = flags.items,
+ });
+
+ lib.installHeadersDirectory(
+ upstream.path(""),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+
+ if (freetype) {
+ lib.addCSourceFile(.{
+ .file = upstream.path("misc/freetype/imgui_freetype.cpp"),
+ .flags = flags.items,
+ });
+
+ if (b.systemIntegrationOption("freetype", .{})) {
+ lib.linkSystemLibrary2("freetype2", dynamic_link_opts);
+ } else {
+ const freetype_dep = b.dependency("freetype", .{
+ .target = target,
+ .optimize = optimize,
+ .@"enable-libpng" = true,
+ });
+ lib.linkLibrary(freetype_dep.artifact("freetype"));
+ if (freetype_dep.builder.lazyDependency(
+ "freetype",
+ .{},
+ )) |freetype_upstream| {
+ mod.addIncludePath(freetype_upstream.path("include"));
+ }
+ }
+ }
+
+ if (backend_metal) {
+ lib.addCSourceFiles(.{
+ .root = upstream.path("backends"),
+ .files = &.{"imgui_impl_metal.mm"},
+ .flags = flags.items,
+ });
+ lib.installHeadersDirectory(
+ upstream.path("backends"),
+ "",
+ .{ .include_extensions = &.{"imgui_impl_metal.h"} },
+ );
+ }
+ if (backend_osx) {
+ lib.addCSourceFiles(.{
+ .root = upstream.path("backends"),
+ .files = &.{"imgui_impl_osx.mm"},
+ .flags = flags.items,
+ });
+ lib.installHeadersDirectory(
+ upstream.path("backends"),
+ "",
+ .{ .include_extensions = &.{"imgui_impl_osx.h"} },
+ );
+ }
+ if (backend_opengl3) {
+ lib.addCSourceFiles(.{
+ .root = upstream.path("backends"),
+ .files = &.{"imgui_impl_opengl3.cpp"},
+ .flags = flags.items,
+ });
+ lib.installHeadersDirectory(
+ upstream.path("backends"),
+ "",
+ .{ .include_extensions = &.{"imgui_impl_opengl3.h"} },
+ );
+ }
+ }
+
+ // Add the C bindings
+ if (b.lazyDependency("bindings", .{})) |upstream| {
+ lib.addIncludePath(upstream.path(""));
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = &.{
+ "dcimgui.cpp",
+ "dcimgui_internal.cpp",
+ },
+ .flags = flags.items,
+ });
+ lib.addCSourceFiles(.{
+ .root = b.path(""),
+ .files = &.{"ext.cpp"},
+ .flags = flags.items,
+ });
+
+ lib.installHeadersDirectory(
+ upstream.path(""),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ const test_exe = b.addTest(.{
+ .name = "test",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ test_exe.root_module.addOptions("build_options", options);
+ test_exe.linkLibrary(lib);
+ const tests_run = b.addRunArtifact(test_exe);
+ const test_step = b.step("test", "Run tests");
+ test_step.dependOn(&tests_run.step);
+}
+
+// For dynamic linking, we prefer dynamic linking and to search by
+// mode first. Mode first will search all paths for a dynamic library
+// before falling back to static.
+const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{
+ .preferred_link_mode = .dynamic,
+ .search_strategy = .mode_first,
+};
diff --git a/vendor/libghostty-vt/pkg/dcimgui/build.zig.zon b/vendor/libghostty-vt/pkg/dcimgui/build.zig.zon
new file mode 100644
index 00000000..95d0120e
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/dcimgui/build.zig.zon
@@ -0,0 +1,26 @@
+.{
+ .name = .dcimgui,
+ .version = "1.92.5", // -docking branch
+ .fingerprint = 0x1a25797442c6324f,
+ .paths = .{""},
+ .dependencies = .{
+ // The bindings and imgui versions below must match exactly.
+
+ .bindings = .{
+ // https://github.com/dearimgui/dear_bindings
+ .url = "https://deps.files.ghostty.org/DearBindings_v0.17_ImGui_v1.92.5-docking.tar.gz",
+ .hash = "N-V-__8AANT61wB--nJ95Gj_ctmzAtcjloZ__hRqNw5lC1Kr",
+ .lazy = true,
+ },
+
+ .imgui = .{
+ // https://github.com/ocornut/imgui
+ .url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.5-docking.tar.gz",
+ .hash = "N-V-__8AAEbOfQBnvcFcCX2W5z7tDaN8vaNZGamEQtNOe0UI",
+ .lazy = true,
+ },
+
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ .freetype = .{ .path = "../freetype" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/dcimgui/ext.cpp b/vendor/libghostty-vt/pkg/dcimgui/ext.cpp
new file mode 100644
index 00000000..b686c07f
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/dcimgui/ext.cpp
@@ -0,0 +1,53 @@
+#include "imgui.h"
+
+// This file contains custom extensions for functionality that isn't
+// properly supported by Dear Bindings yet. Namely:
+// https://github.com/dearimgui/dear_bindings/issues/55
+
+// Wrap this in a namespace to keep it separate from the C++ API
+namespace cimgui
+{
+#include "dcimgui.h"
+}
+
+extern "C"
+{
+CIMGUI_API void ImFontConfig_ImFontConfig(cimgui::ImFontConfig* self)
+{
+ static_assert(sizeof(cimgui::ImFontConfig) == sizeof(::ImFontConfig), "ImFontConfig size mismatch");
+ static_assert(alignof(cimgui::ImFontConfig) == alignof(::ImFontConfig), "ImFontConfig alignment mismatch");
+ ::ImFontConfig defaults;
+ *reinterpret_cast<::ImFontConfig*>(self) = defaults;
+}
+
+CIMGUI_API void ImGuiStyle_ImGuiStyle(cimgui::ImGuiStyle* self)
+{
+ static_assert(sizeof(cimgui::ImGuiStyle) == sizeof(::ImGuiStyle), "ImGuiStyle size mismatch");
+ static_assert(alignof(cimgui::ImGuiStyle) == alignof(::ImGuiStyle), "ImGuiStyle alignment mismatch");
+ ::ImGuiStyle defaults;
+ *reinterpret_cast<::ImGuiStyle*>(self) = defaults;
+}
+
+// Perform the OpenGL3 backend shutdown and then zero out the imgl3w
+// function pointer table. ImGui_ImplOpenGL3_Shutdown() calls
+// imgl3wShutdown() which dlcloses the GL library handles but does not
+// zero out the function pointers. A subsequent ImGui_ImplOpenGL3_Init()
+// sees the stale (non-null) pointers, skips loader re-initialization,
+// and crashes when calling through them. Zeroing the table forces the
+// next Init to reload the GL function pointers via imgl3wInit().
+#ifndef IMGUI_DISABLE
+#if __has_include("backends/imgui_impl_opengl3.h")
+#ifdef ZIGPKG_IMGUI_ENABLE_OPENGL3
+#include "backends/imgui_impl_opengl3.h"
+#include "backends/imgui_impl_opengl3_loader.h"
+
+CIMGUI_API void ImGui_ImplOpenGL3_ShutdownWithLoaderCleanup()
+{
+ ::ImGui_ImplOpenGL3_Shutdown();
+ memset(&imgl3wProcs, 0, sizeof(imgl3wProcs));
+}
+#endif // ZIGPKG_IMGUI_ENABLE_OPENGL3
+#endif // __has_include("backends/imgui_impl_opengl3.h")
+#endif // IMGUI_DISABLE
+
+}
diff --git a/vendor/libghostty-vt/pkg/dcimgui/main.zig b/vendor/libghostty-vt/pkg/dcimgui/main.zig
new file mode 100644
index 00000000..40a4325c
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/dcimgui/main.zig
@@ -0,0 +1,77 @@
+pub const build_options = @import("build_options");
+
+pub const c = @cImport({
+ // This is set during the build so it also has to be set
+ // during import time to get the right types. Without this
+ // you get stack size mismatches on some structs.
+ @cDefine("IMGUI_USE_WCHAR32", "1");
+
+ @cDefine("IMGUI_HAS_DOCK", "1");
+ @cInclude("dcimgui.h");
+});
+
+// OpenGL3 backend
+pub extern fn ImGui_ImplOpenGL3_Init(glsl_version: ?[*:0]const u8) callconv(.c) bool;
+pub extern fn ImGui_ImplOpenGL3_Shutdown() callconv(.c) void;
+pub extern fn ImGui_ImplOpenGL3_NewFrame() callconv(.c) void;
+pub extern fn ImGui_ImplOpenGL3_RenderDrawData(draw_data: *c.ImDrawData) callconv(.c) void;
+
+// Extension: shutdown the OpenGL3 backend and zero out the imgl3w function
+// pointer table so a subsequent Init can re-initialize the loader.
+pub extern fn ImGui_ImplOpenGL3_ShutdownWithLoaderCleanup() callconv(.c) void;
+
+// Metal backend
+pub extern fn ImGui_ImplMetal_Init(device: *anyopaque) callconv(.c) bool;
+pub extern fn ImGui_ImplMetal_Shutdown() callconv(.c) void;
+pub extern fn ImGui_ImplMetal_NewFrame(render_pass_descriptor: *anyopaque) callconv(.c) void;
+pub extern fn ImGui_ImplMetal_RenderDrawData(draw_data: *c.ImDrawData, command_buffer: *anyopaque, command_encoder: *anyopaque) callconv(.c) void;
+
+// OSX
+pub extern fn ImGui_ImplOSX_Init(*anyopaque) callconv(.c) bool;
+pub extern fn ImGui_ImplOSX_Shutdown() callconv(.c) void;
+pub extern fn ImGui_ImplOSX_NewFrame(*anyopaque) callconv(.c) void;
+
+// Internal API types and functions from dcimgui_internal.h
+// We declare these manually because the internal header contains bitfields
+// that Zig's cImport cannot translate.
+pub const ImGuiDockNodeFlagsPrivate = struct {
+ pub const DockSpace: c.ImGuiDockNodeFlags = 1 << 10;
+ pub const CentralNode: c.ImGuiDockNodeFlags = 1 << 11;
+ pub const NoTabBar: c.ImGuiDockNodeFlags = 1 << 12;
+ pub const HiddenTabBar: c.ImGuiDockNodeFlags = 1 << 13;
+ pub const NoWindowMenuButton: c.ImGuiDockNodeFlags = 1 << 14;
+ pub const NoCloseButton: c.ImGuiDockNodeFlags = 1 << 15;
+ pub const NoResizeX: c.ImGuiDockNodeFlags = 1 << 16;
+ pub const NoResizeY: c.ImGuiDockNodeFlags = 1 << 17;
+ pub const DockedWindowsInFocusRoute: c.ImGuiDockNodeFlags = 1 << 18;
+ pub const NoDockingSplitOther: c.ImGuiDockNodeFlags = 1 << 19;
+ pub const NoDockingOverMe: c.ImGuiDockNodeFlags = 1 << 20;
+ pub const NoDockingOverOther: c.ImGuiDockNodeFlags = 1 << 21;
+ pub const NoDockingOverEmpty: c.ImGuiDockNodeFlags = 1 << 22;
+};
+pub extern fn ImGui_DockBuilderDockWindow(window_name: [*:0]const u8, node_id: c.ImGuiID) callconv(.c) void;
+pub extern fn ImGui_DockBuilderGetNode(node_id: c.ImGuiID) callconv(.c) ?*anyopaque;
+pub extern fn ImGui_DockBuilderGetCentralNode(node_id: c.ImGuiID) callconv(.c) ?*anyopaque;
+pub extern fn ImGui_DockBuilderAddNode() callconv(.c) c.ImGuiID;
+pub extern fn ImGui_DockBuilderAddNodeEx(node_id: c.ImGuiID, flags: c.ImGuiDockNodeFlags) callconv(.c) c.ImGuiID;
+pub extern fn ImGui_DockBuilderRemoveNode(node_id: c.ImGuiID) callconv(.c) void;
+pub extern fn ImGui_DockBuilderRemoveNodeDockedWindows(node_id: c.ImGuiID) callconv(.c) void;
+pub extern fn ImGui_DockBuilderRemoveNodeDockedWindowsEx(node_id: c.ImGuiID, clear_settings_refs: bool) callconv(.c) void;
+pub extern fn ImGui_DockBuilderRemoveNodeChildNodes(node_id: c.ImGuiID) callconv(.c) void;
+pub extern fn ImGui_DockBuilderSetNodePos(node_id: c.ImGuiID, pos: c.ImVec2) callconv(.c) void;
+pub extern fn ImGui_DockBuilderSetNodeSize(node_id: c.ImGuiID, size: c.ImVec2) callconv(.c) void;
+pub extern fn ImGui_DockBuilderSplitNode(node_id: c.ImGuiID, split_dir: c.ImGuiDir, size_ratio_for_node_at_dir: f32, out_id_at_dir: *c.ImGuiID, out_id_at_opposite_dir: *c.ImGuiID) callconv(.c) c.ImGuiID;
+pub extern fn ImGui_DockBuilderCopyDockSpace(src_dockspace_id: c.ImGuiID, dst_dockspace_id: c.ImGuiID, in_window_remap_pairs: *c.ImVector_const_charPtr) callconv(.c) void;
+pub extern fn ImGui_DockBuilderCopyNode(src_node_id: c.ImGuiID, dst_node_id: c.ImGuiID, out_node_remap_pairs: *c.ImVector_ImGuiID) callconv(.c) void;
+pub extern fn ImGui_DockBuilderCopyWindowSettings(src_name: [*:0]const u8, dst_name: [*:0]const u8) callconv(.c) void;
+pub extern fn ImGui_DockBuilderFinish(node_id: c.ImGuiID) callconv(.c) void;
+
+// Extension functions from ext.cpp
+pub const ext = struct {
+ pub extern fn ImFontConfig_ImFontConfig(self: *c.ImFontConfig) callconv(.c) void;
+ pub extern fn ImGuiStyle_ImGuiStyle(self: *c.ImGuiStyle) callconv(.c) void;
+};
+
+test {
+ _ = c;
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/build.zig b/vendor/libghostty-vt/pkg/fontconfig/build.zig
new file mode 100644
index 00000000..7c87d1f2
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/build.zig
@@ -0,0 +1,298 @@
+const std = @import("std");
+const NativeTargetInfo = std.zig.system.NativeTargetInfo;
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const libxml2_enabled = b.option(bool, "enable-libxml2", "Build libxml2") orelse true;
+ const libxml2_iconv_enabled = b.option(
+ bool,
+ "enable-libxml2-iconv",
+ "Build libxml2 with iconv",
+ ) orelse (target.result.os.tag != .windows);
+ const freetype_enabled = b.option(bool, "enable-freetype", "Build freetype") orelse true;
+
+ const module = b.addModule("fontconfig", .{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ });
+
+ // For dynamic linking, we prefer dynamic linking and to search by
+ // mode first. Mode first will search all paths for a dynamic library
+ // before falling back to static.
+ const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{
+ .preferred_link_mode = .dynamic,
+ .search_strategy = .mode_first,
+ };
+
+ const test_exe = b.addTest(.{
+ .name = "test",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ const tests_run = b.addRunArtifact(test_exe);
+ const test_step = b.step("test", "Run tests");
+ test_step.dependOn(&tests_run.step);
+
+ if (b.systemIntegrationOption("fontconfig", .{})) {
+ module.linkSystemLibrary("fontconfig", dynamic_link_opts);
+ test_exe.linkSystemLibrary2("fontconfig", dynamic_link_opts);
+ } else {
+ const lib = try buildLib(b, module, .{
+ .target = target,
+ .optimize = optimize,
+
+ .libxml2_enabled = libxml2_enabled,
+ .libxml2_iconv_enabled = libxml2_iconv_enabled,
+ .freetype_enabled = freetype_enabled,
+
+ .dynamic_link_opts = dynamic_link_opts,
+ });
+
+ test_exe.linkLibrary(lib);
+ }
+}
+
+fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Build.Step.Compile {
+ const target = options.target;
+ const optimize = options.optimize;
+
+ const libxml2_enabled = options.libxml2_enabled;
+ const libxml2_iconv_enabled = options.libxml2_iconv_enabled;
+ const freetype_enabled = options.freetype_enabled;
+
+ const lib = b.addLibrary(.{
+ .name = "fontconfig",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ if (target.result.os.tag != .windows) {
+ lib.linkSystemLibrary("pthread");
+ }
+
+ lib.addIncludePath(b.path("override/include"));
+ module.addIncludePath(b.path("override/include"));
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_DIRENT_H",
+ "-DHAVE_FCNTL_H",
+ "-DHAVE_STDLIB_H",
+ "-DHAVE_STRING_H",
+ "-DHAVE_UNISTD_H",
+ "-DHAVE_SYS_PARAM_H",
+
+ "-DHAVE_MKSTEMP",
+ //"-DHAVE_GETPROGNAME",
+ //"-DHAVE_GETEXECNAME",
+ "-DHAVE_RAND",
+ //"-DHAVE_RANDOM_R",
+ "-DHAVE_VPRINTF",
+
+ "-DHAVE_FT_GET_BDF_PROPERTY",
+ "-DHAVE_FT_GET_PS_FONT_INFO",
+ "-DHAVE_FT_HAS_PS_GLYPH_NAMES",
+ "-DHAVE_FT_GET_X11_FONT_FORMAT",
+ "-DHAVE_FT_DONE_MM_VAR",
+
+ "-DHAVE_POSIX_FADVISE",
+
+ //"-DHAVE_STRUCT_STATVFS_F_BASETYPE",
+ // "-DHAVE_STRUCT_STATVFS_F_FSTYPENAME",
+ // "-DHAVE_STRUCT_STATFS_F_FLAGS",
+ // "-DHAVE_STRUCT_STATFS_F_FSTYPENAME",
+ // "-DHAVE_STRUCT_DIRENT_D_TYPE",
+
+ "-DFLEXIBLE_ARRAY_MEMBER",
+
+ "-DHAVE_STDATOMIC_PRIMITIVES",
+
+ "-DFC_GPERF_SIZE_T=size_t",
+
+ // Default errors that fontconfig can't handle
+ "-Wno-implicit-function-declaration",
+ "-Wno-int-conversion",
+
+ // https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/231
+ "-fno-sanitize=undefined",
+ "-fno-sanitize-trap=undefined",
+ });
+
+ switch (target.result.ptrBitWidth()) {
+ 32 => try flags.appendSlice(b.allocator, &.{
+ "-DSIZEOF_VOID_P=4",
+ "-DALIGNOF_VOID_P=4",
+ }),
+
+ 64 => try flags.appendSlice(b.allocator, &.{
+ "-DSIZEOF_VOID_P=8",
+ "-DALIGNOF_VOID_P=8",
+ }),
+
+ else => @panic("unsupported arch"),
+ }
+ if (target.result.os.tag == .windows) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DFC_CACHEDIR=\"LOCAL_APPDATA_FONTCONFIG_CACHE\"",
+ "-DFC_TEMPLATEDIR=\"c:/share/fontconfig/conf.avail\"",
+ "-DCONFIGDIR=\"c:/etc/fonts/conf.d\"",
+ "-DFC_DEFAULT_FONTS=\"\\tWINDOWSFONTDIR\\n\\tWINDOWSUSERFONTDIR\\n\"",
+ });
+ } else {
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_FSTATFS",
+ "-DHAVE_FSTATVFS",
+ "-DHAVE_GETOPT",
+ "-DHAVE_GETOPT_LONG",
+ "-DHAVE_LINK",
+ "-DHAVE_LRAND48",
+ "-DHAVE_LSTAT",
+ "-DHAVE_MKDTEMP",
+ "-DHAVE_MKOSTEMP",
+ "-DHAVE__MKTEMP_S",
+ "-DHAVE_MMAP",
+ "-DHAVE_PTHREAD",
+ "-DHAVE_RANDOM",
+ "-DHAVE_RAND_R",
+ "-DHAVE_READLINK",
+ "-DHAVE_SYS_MOUNT_H",
+ "-DHAVE_SYS_STATVFS_H",
+
+ "-DFC_CACHEDIR=\"/var/cache/fontconfig\"",
+ "-DFC_DEFAULT_FONTS=\"/usr/share/fonts/usr/local/share/fonts\"",
+ });
+
+ if (target.result.os.tag == .freebsd) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DFC_TEMPLATEDIR=\"/usr/local/etc/fonts/conf.avail\"",
+ "-DFONTCONFIG_PATH=\"/usr/local/etc/fonts\"",
+ "-DCONFIGDIR=\"/usr/local/etc/fonts/conf.d\"",
+ });
+ } else {
+ try flags.appendSlice(b.allocator, &.{
+ "-DFC_TEMPLATEDIR=\"/usr/share/fontconfig/conf.avail\"",
+ "-DFONTCONFIG_PATH=\"/etc/fonts\"",
+ "-DCONFIGDIR=\"/usr/local/fontconfig/conf.d\"",
+ });
+ }
+
+ if (target.result.os.tag == .linux) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_SYS_STATFS_H",
+ "-DHAVE_SYS_VFS_H",
+ });
+ }
+ }
+
+ const dynamic_link_opts = options.dynamic_link_opts;
+
+ // Freetype2
+ _ = b.systemIntegrationOption("freetype", .{}); // So it shows up in help
+ if (freetype_enabled) {
+ if (b.systemIntegrationOption("freetype", .{})) {
+ lib.linkSystemLibrary2("freetype2", dynamic_link_opts);
+ } else {
+ if (b.lazyDependency(
+ "freetype",
+ .{ .target = target, .optimize = optimize },
+ )) |freetype_dep| {
+ lib.linkLibrary(freetype_dep.artifact("freetype"));
+ }
+ }
+ }
+
+ // Libxml2
+ _ = b.systemIntegrationOption("libxml2", .{}); // So it shows up in help
+ if (libxml2_enabled) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DENABLE_LIBXML2",
+ "-DLIBXML_STATIC",
+ "-DLIBXML_PUSH_ENABLED",
+ });
+ if (target.result.os.tag == .windows) {
+ // NOTE: this should be defined on all targets
+ try flags.appendSlice(b.allocator, &.{
+ "-Werror=implicit-function-declaration",
+ });
+ }
+
+ if (b.systemIntegrationOption("libxml2", .{})) {
+ lib.linkSystemLibrary2("libxml-2.0", dynamic_link_opts);
+ } else {
+ if (b.lazyDependency("libxml2", .{
+ .target = target,
+ .optimize = optimize,
+ .iconv = libxml2_iconv_enabled,
+ })) |libxml2_dep| {
+ lib.linkLibrary(libxml2_dep.artifact("xml2"));
+ }
+ }
+ }
+
+ if (b.lazyDependency("fontconfig", .{})) |upstream| {
+ lib.addIncludePath(upstream.path(""));
+ module.addIncludePath(upstream.path(""));
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = srcs,
+ .flags = flags.items,
+ });
+
+ lib.installHeadersDirectory(
+ upstream.path("fontconfig"),
+ "fontconfig",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ b.installArtifact(lib);
+
+ return lib;
+}
+
+const headers = &.{
+ "fontconfig/fontconfig.h",
+ "fontconfig/fcprivate.h",
+ "fontconfig/fcfreetype.h",
+};
+
+const srcs: []const []const u8 = &.{
+ "src/fcatomic.c",
+ "src/fccache.c",
+ "src/fccfg.c",
+ "src/fccharset.c",
+ "src/fccompat.c",
+ "src/fcdbg.c",
+ "src/fcdefault.c",
+ "src/fcdir.c",
+ "src/fcformat.c",
+ "src/fcfreetype.c",
+ "src/fcfs.c",
+ "src/fcptrlist.c",
+ "src/fchash.c",
+ "src/fcinit.c",
+ "src/fclang.c",
+ "src/fclist.c",
+ "src/fcmatch.c",
+ "src/fcmatrix.c",
+ "src/fcname.c",
+ "src/fcobjs.c",
+ "src/fcpat.c",
+ "src/fcrange.c",
+ "src/fcserialize.c",
+ "src/fcstat.c",
+ "src/fcstr.c",
+ "src/fcweight.c",
+ "src/fcxml.c",
+ "src/ftglue.c",
+};
diff --git a/vendor/libghostty-vt/pkg/fontconfig/build.zig.zon b/vendor/libghostty-vt/pkg/fontconfig/build.zig.zon
new file mode 100644
index 00000000..b1387b87
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/build.zig.zon
@@ -0,0 +1,16 @@
+.{
+ .name = .fontconfig,
+ .version = "2.14.2",
+ .fingerprint = 0x4a79a5a40c6d6d8,
+ .paths = .{""},
+ .dependencies = .{
+ .fontconfig = .{
+ .url = "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz",
+ .hash = "N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v",
+ .lazy = true,
+ },
+
+ .freetype = .{ .path = "../freetype", .lazy = true },
+ .libxml2 = .{ .path = "../libxml2", .lazy = true },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/c.zig b/vendor/libghostty-vt/pkg/fontconfig/c.zig
new file mode 100644
index 00000000..6e8ae76b
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/c.zig
@@ -0,0 +1,3 @@
+pub const c = @cImport({
+ @cInclude("fontconfig/fontconfig.h");
+});
diff --git a/vendor/libghostty-vt/pkg/fontconfig/char_set.zig b/vendor/libghostty-vt/pkg/fontconfig/char_set.zig
new file mode 100644
index 00000000..b0e3a341
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/char_set.zig
@@ -0,0 +1,40 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const c = @import("c.zig").c;
+
+pub const CharSet = opaque {
+ pub fn create() *CharSet {
+ return @ptrCast(c.FcCharSetCreate());
+ }
+
+ pub fn destroy(self: *CharSet) void {
+ c.FcCharSetDestroy(self.cval());
+ }
+
+ pub fn addChar(self: *CharSet, cp: u32) bool {
+ return c.FcCharSetAddChar(self.cval(), cp) == c.FcTrue;
+ }
+
+ pub fn hasChar(self: *const CharSet, cp: u32) bool {
+ return c.FcCharSetHasChar(self.cvalConst(), cp) == c.FcTrue;
+ }
+
+ pub inline fn cval(self: *CharSet) *c.struct__FcCharSet {
+ return @ptrCast(self);
+ }
+
+ pub inline fn cvalConst(self: *const CharSet) *const c.struct__FcCharSet {
+ return @ptrCast(self);
+ }
+};
+
+test "create" {
+ const testing = std.testing;
+
+ var fs = CharSet.create();
+ defer fs.destroy();
+
+ try testing.expect(!fs.hasChar(0x20));
+ try testing.expect(fs.addChar(0x20));
+ try testing.expect(fs.hasChar(0x20));
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/common.zig b/vendor/libghostty-vt/pkg/fontconfig/common.zig
new file mode 100644
index 00000000..6ad6f568
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/common.zig
@@ -0,0 +1,139 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const Error = @import("main.zig").Error;
+
+pub const Weight = enum(c_uint) {
+ thin = c.FC_WEIGHT_THIN,
+ extralight = c.FC_WEIGHT_EXTRALIGHT,
+ light = c.FC_WEIGHT_LIGHT,
+ demilight = c.FC_WEIGHT_DEMILIGHT,
+ book = c.FC_WEIGHT_BOOK,
+ regular = c.FC_WEIGHT_REGULAR,
+ medium = c.FC_WEIGHT_MEDIUM,
+ demibold = c.FC_WEIGHT_DEMIBOLD,
+ bold = c.FC_WEIGHT_BOLD,
+ extrabold = c.FC_WEIGHT_EXTRABOLD,
+ black = c.FC_WEIGHT_BLACK,
+ extrablack = c.FC_WEIGHT_EXTRABLACK,
+};
+
+pub const Slant = enum(c_uint) {
+ roman = c.FC_SLANT_ROMAN,
+ italic = c.FC_SLANT_ITALIC,
+ oblique = c.FC_SLANT_OBLIQUE,
+};
+
+pub const Spacing = enum(c_uint) {
+ proportional = c.FC_PROPORTIONAL,
+ dual = c.FC_DUAL,
+ mono = c.FC_MONO,
+ charcell = c.FC_CHARCELL,
+};
+
+pub const Property = enum {
+ family,
+ style,
+ slant,
+ weight,
+ size,
+ aspect,
+ pixel_size,
+ spacing,
+ foundry,
+ antialias,
+ hinting,
+ hint_style,
+ vertical_layout,
+ autohint,
+ global_advance,
+ width,
+ file,
+ index,
+ ft_face,
+ rasterizer,
+ outline,
+ scalable,
+ color,
+ variable,
+ scale,
+ symbol,
+ dpi,
+ rgba,
+ minspace,
+ source,
+ charset,
+ lang,
+ fontversion,
+ fullname,
+ familylang,
+ stylelang,
+ fullnamelang,
+ capability,
+ embolden,
+ embedded_bitmap,
+ decorative,
+ lcd_filter,
+ font_features,
+ font_variations,
+ namelang,
+ prgname,
+ hash,
+ postscript_name,
+ font_has_hint,
+ order,
+
+ pub fn cval(self: Property) [:0]const u8 {
+ @setEvalBranchQuota(10_000);
+ inline for (@typeInfo(Property).@"enum".fields) |field| {
+ if (self == @field(Property, field.name)) {
+ // Build our string in a comptime context so it is a binary
+ // constant and not stack allocated.
+ return comptime name: {
+ // Replace _ with ""
+ var buf: [field.name.len]u8 = undefined;
+ const count = std.mem.replace(u8, field.name, "_", "", &buf);
+ const replaced = buf[0 .. field.name.len - count];
+
+ // Build our string
+ var name: [replaced.len:0]u8 = undefined;
+ @memcpy(&name, replaced);
+ name[replaced.len] = 0;
+ const final = name;
+ break :name &final;
+ };
+ }
+ }
+
+ unreachable;
+ }
+
+ test "cval" {
+ const testing = std.testing;
+ try testing.expectEqualStrings("family", Property.family.cval());
+ try testing.expectEqualStrings("pixelsize", Property.pixel_size.cval());
+ }
+};
+
+pub const Result = enum(c_uint) {
+ match = c.FcResultMatch,
+ no_match = c.FcResultNoMatch,
+ type_mismatch = c.FcResultTypeMismatch,
+ no_id = c.FcResultNoId,
+ out_of_memory = c.FcResultOutOfMemory,
+
+ pub fn toError(self: Result) Error!void {
+ return switch (self) {
+ .match => {},
+ .no_match => Error.FontconfigNoMatch,
+ .type_mismatch => Error.FontconfigTypeMismatch,
+ .no_id => Error.FontconfigNoId,
+ .out_of_memory => Error.OutOfMemory,
+ };
+ }
+};
+
+pub const MatchKind = enum(c_uint) {
+ pattern = c.FcMatchPattern,
+ font = c.FcMatchFont,
+ scan = c.FcMatchScan,
+};
diff --git a/vendor/libghostty-vt/pkg/fontconfig/config.zig b/vendor/libghostty-vt/pkg/fontconfig/config.zig
new file mode 100644
index 00000000..2b3674c5
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/config.zig
@@ -0,0 +1,61 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const Error = @import("main.zig").Error;
+const CharSet = @import("char_set.zig").CharSet;
+const FontSet = @import("font_set.zig").FontSet;
+const ObjectSet = @import("object_set.zig").ObjectSet;
+const Pattern = @import("pattern.zig").Pattern;
+const Result = @import("main.zig").Result;
+const MatchKind = @import("main.zig").MatchKind;
+
+pub const Config = opaque {
+ pub fn destroy(self: *Config) void {
+ c.FcConfigDestroy(@ptrCast(self));
+ }
+
+ pub fn fontList(self: *Config, pat: *Pattern, os: *ObjectSet) *FontSet {
+ return @ptrCast(c.FcFontList(self.cval(), pat.cval(), os.cval()));
+ }
+
+ pub fn fontSort(
+ self: *Config,
+ pat: *Pattern,
+ trim: bool,
+ charset: ?[*]*CharSet,
+ ) FontSortResult {
+ var result: FontSortResult = undefined;
+ result.fs = @ptrCast(c.FcFontSort(
+ self.cval(),
+ pat.cval(),
+ if (trim) c.FcTrue else c.FcFalse,
+ @ptrCast(charset),
+ @ptrCast(&result.result),
+ ));
+
+ return result;
+ }
+
+ pub fn fontRenderPrepare(self: *Config, pat: *Pattern, font: *Pattern) Error!*Pattern {
+ return @as(
+ ?*Pattern,
+ @ptrCast(c.FcFontRenderPrepare(self.cval(), pat.cval(), font.cval())),
+ ) orelse Error.FontconfigFailed;
+ }
+
+ pub fn substituteWithPat(self: *Config, pat: *Pattern, kind: MatchKind) bool {
+ return c.FcConfigSubstitute(
+ self.cval(),
+ pat.cval(),
+ @intFromEnum(kind),
+ ) == c.FcTrue;
+ }
+
+ pub inline fn cval(self: *Config) *c.struct__FcConfig {
+ return @ptrCast(self);
+ }
+};
+
+pub const FontSortResult = struct {
+ result: Result,
+ fs: *FontSet,
+};
diff --git a/vendor/libghostty-vt/pkg/fontconfig/error.zig b/vendor/libghostty-vt/pkg/fontconfig/error.zig
new file mode 100644
index 00000000..dd88b411
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/error.zig
@@ -0,0 +1,7 @@
+pub const Error = error{
+ OutOfMemory,
+ FontconfigFailed,
+ FontconfigNoMatch,
+ FontconfigTypeMismatch,
+ FontconfigNoId,
+};
diff --git a/vendor/libghostty-vt/pkg/fontconfig/font_set.zig b/vendor/libghostty-vt/pkg/fontconfig/font_set.zig
new file mode 100644
index 00000000..c5a8c5f9
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/font_set.zig
@@ -0,0 +1,44 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const c = @import("c.zig").c;
+const Pattern = @import("pattern.zig").Pattern;
+
+pub const FontSet = opaque {
+ pub fn create() *FontSet {
+ return @ptrCast(c.FcFontSetCreate());
+ }
+
+ pub fn destroy(self: *FontSet) void {
+ c.FcFontSetDestroy(self.cval());
+ }
+
+ pub fn fonts(self: *FontSet) []*Pattern {
+ const empty: [0]*Pattern = undefined;
+ const s = self.cval();
+ if (s.fonts == null) return ∅
+ const ptr: [*]*Pattern = @ptrCast(@alignCast(s.fonts));
+ const len: usize = @intCast(s.nfont);
+ return ptr[0..len];
+ }
+
+ pub fn add(self: *FontSet, pat: *Pattern) bool {
+ return c.FcFontSetAdd(self.cval(), pat.cval()) == c.FcTrue;
+ }
+
+ pub fn print(self: *FontSet) void {
+ c.FcFontSetPrint(self.cval());
+ }
+
+ pub inline fn cval(self: *FontSet) *c.struct__FcFontSet {
+ return @ptrCast(@alignCast(self));
+ }
+};
+
+test "create" {
+ const testing = std.testing;
+
+ var fs = FontSet.create();
+ defer fs.destroy();
+
+ try testing.expectEqual(@as(usize, 0), fs.fonts().len);
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/init.zig b/vendor/libghostty-vt/pkg/fontconfig/init.zig
new file mode 100644
index 00000000..6e8f4d61
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/init.zig
@@ -0,0 +1,43 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const Config = @import("config.zig").Config;
+
+pub fn init() bool {
+ return c.FcInit() == c.FcTrue;
+}
+
+pub fn fini() void {
+ c.FcFini();
+}
+
+pub fn initLoadConfig() *Config {
+ return @ptrCast(c.FcInitLoadConfig());
+}
+
+pub fn initLoadConfigAndFonts() *Config {
+ return @ptrCast(c.FcInitLoadConfigAndFonts());
+}
+
+pub fn version() u32 {
+ return @intCast(c.FcGetVersion());
+}
+
+test "version" {
+ const testing = std.testing;
+ try testing.expect(version() > 0);
+}
+
+test "init" {
+ try std.testing.expect(init());
+ defer fini();
+}
+
+test "initLoadConfig" {
+ var config = initLoadConfig();
+ defer config.destroy();
+}
+
+test "initLoadConfigAndFonts" {
+ var config = initLoadConfigAndFonts();
+ defer config.destroy();
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/lang_set.zig b/vendor/libghostty-vt/pkg/fontconfig/lang_set.zig
new file mode 100644
index 00000000..abefcc3e
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/lang_set.zig
@@ -0,0 +1,61 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const c = @import("c.zig").c;
+
+pub const LangSet = opaque {
+ pub fn create() *LangSet {
+ return @ptrCast(c.FcLangSetCreate());
+ }
+
+ pub fn destroy(self: *LangSet) void {
+ c.FcLangSetDestroy(self.cval());
+ }
+
+ pub fn addLang(self: *LangSet, lang: [:0]const u8) bool {
+ return c.FcLangSetAdd(self.cval(), lang.ptr) == c.FcTrue;
+ }
+
+ pub fn hasLang(self: *const LangSet, lang: [:0]const u8) bool {
+ return c.FcLangSetHasLang(self.cvalConst(), lang.ptr) == c.FcLangEqual;
+ }
+
+ pub inline fn cval(self: *LangSet) *c.struct__FcLangSet {
+ return @ptrCast(self);
+ }
+
+ pub inline fn cvalConst(self: *const LangSet) *const c.struct__FcLangSet {
+ return @ptrCast(self);
+ }
+};
+
+test "create" {
+ const testing = std.testing;
+
+ var fs = LangSet.create();
+ defer fs.destroy();
+
+ try testing.expect(!fs.hasLang("und-zsye"));
+}
+
+test "hasLang exact match" {
+ const testing = std.testing;
+
+ // Test exact match: langset with "en-US" should return true for "en-US"
+ var fs = LangSet.create();
+ defer fs.destroy();
+ try testing.expect(fs.addLang("en-US"));
+ try testing.expect(fs.hasLang("en-US"));
+
+ // Test exact match: langset with "und-zsye" should return true for "und-zsye"
+ var fs_emoji = LangSet.create();
+ defer fs_emoji.destroy();
+ try testing.expect(fs_emoji.addLang("und-zsye"));
+ try testing.expect(fs_emoji.hasLang("und-zsye"));
+
+ // Test mismatch: langset with "en-US" should return false for "fr"
+ try testing.expect(!fs.hasLang("fr"));
+
+ // Test partial match: langset with "en-US" should return false for "en-GB"
+ // (different territory, but we only want exact matches)
+ try testing.expect(!fs.hasLang("en-GB"));
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/main.zig b/vendor/libghostty-vt/pkg/fontconfig/main.zig
new file mode 100644
index 00000000..61f8a329
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/main.zig
@@ -0,0 +1,45 @@
+const initpkg = @import("init.zig");
+const char_set = @import("char_set.zig");
+const common = @import("common.zig");
+const config = @import("config.zig");
+const errorpkg = @import("error.zig");
+const font_set = @import("font_set.zig");
+const lang_set = @import("lang_set.zig");
+const matrix = @import("matrix.zig");
+const object_set = @import("object_set.zig");
+const pattern = @import("pattern.zig");
+const range = @import("range.zig");
+const value = @import("value.zig");
+
+pub const c = @import("c.zig").c;
+pub const init = initpkg.init;
+pub const fini = initpkg.fini;
+pub const initLoadConfig = initpkg.initLoadConfig;
+pub const initLoadConfigAndFonts = initpkg.initLoadConfigAndFonts;
+pub const version = initpkg.version;
+pub const CharSet = char_set.CharSet;
+pub const Weight = common.Weight;
+pub const Slant = common.Slant;
+pub const Spacing = common.Spacing;
+pub const Property = common.Property;
+pub const Result = common.Result;
+pub const MatchKind = common.MatchKind;
+pub const Config = config.Config;
+pub const Error = errorpkg.Error;
+pub const FontSet = font_set.FontSet;
+pub const LangSet = lang_set.LangSet;
+pub const Matrix = matrix.Matrix;
+pub const ObjectSet = object_set.ObjectSet;
+pub const Pattern = pattern.Pattern;
+pub const Range = range.Range;
+pub const Type = value.Type;
+pub const Value = value.Value;
+pub const ValueBinding = value.ValueBinding;
+
+test {
+ @import("std").testing.refAllDecls(@This());
+}
+
+test {
+ _ = @import("test.zig");
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/matrix.zig b/vendor/libghostty-vt/pkg/fontconfig/matrix.zig
new file mode 100644
index 00000000..a9b05a9e
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/matrix.zig
@@ -0,0 +1,10 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const c = @import("c.zig").c;
+
+pub const Matrix = extern struct {
+ xx: f64,
+ xy: f64,
+ yx: f64,
+ yy: f64,
+};
diff --git a/vendor/libghostty-vt/pkg/fontconfig/object_set.zig b/vendor/libghostty-vt/pkg/fontconfig/object_set.zig
new file mode 100644
index 00000000..29cf6386
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/object_set.zig
@@ -0,0 +1,30 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const Property = @import("main.zig").Property;
+
+pub const ObjectSet = opaque {
+ pub fn create() *ObjectSet {
+ return @ptrCast(c.FcObjectSetCreate());
+ }
+
+ pub fn destroy(self: *ObjectSet) void {
+ c.FcObjectSetDestroy(self.cval());
+ }
+
+ pub fn add(self: *ObjectSet, p: Property) bool {
+ return c.FcObjectSetAdd(self.cval(), p.cval().ptr) == c.FcTrue;
+ }
+
+ pub inline fn cval(self: *ObjectSet) *c.struct__FcObjectSet {
+ return @ptrCast(@alignCast(self));
+ }
+};
+
+test "create" {
+ const testing = std.testing;
+
+ var os = ObjectSet.create();
+ defer os.destroy();
+
+ try testing.expect(os.add(.family));
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/override/include/fcalias.h b/vendor/libghostty-vt/pkg/fontconfig/override/include/fcalias.h
new file mode 100644
index 00000000..e69de29b
diff --git a/vendor/libghostty-vt/pkg/fontconfig/override/include/fcaliastail.h b/vendor/libghostty-vt/pkg/fontconfig/override/include/fcaliastail.h
new file mode 100644
index 00000000..e69de29b
diff --git a/vendor/libghostty-vt/pkg/fontconfig/override/include/fcftalias.h b/vendor/libghostty-vt/pkg/fontconfig/override/include/fcftalias.h
new file mode 100644
index 00000000..e69de29b
diff --git a/vendor/libghostty-vt/pkg/fontconfig/override/include/fcftaliastail.h b/vendor/libghostty-vt/pkg/fontconfig/override/include/fcftaliastail.h
new file mode 100644
index 00000000..e69de29b
diff --git a/vendor/libghostty-vt/pkg/fontconfig/override/include/fcobjshash.h b/vendor/libghostty-vt/pkg/fontconfig/override/include/fcobjshash.h
new file mode 100644
index 00000000..f06234ac
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/override/include/fcobjshash.h
@@ -0,0 +1,347 @@
+/* ANSI-C code produced by gperf version 3.1 */
+/* Command-line: gperf --pic -m 100 fcobjshash.gperf */
+/* Computed positions: -k'3,5' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to ."
+#endif
+
+#line 1 "fcobjshash.gperf"
+
+#line 13 "fcobjshash.gperf"
+struct FcObjectTypeInfo {
+int name;
+int id;
+};
+#include
+/* maximum key range = 59, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+FcObjectTypeHash (register const char *str, register size_t len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 4, 10, 32,
+ 21, 29, 28, 49, 14, 4, 66, 66, 5, 31,
+ 18, 22, 27, 66, 15, 9, 8, 23, 23, 13,
+ 23, 16, 4, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66
+ };
+ register unsigned int hval = len;
+
+ switch (hval)
+ {
+ default:
+ hval += asso_values[(unsigned char)str[4]];
+ /*FALLTHROUGH*/
+ case 4:
+ case 3:
+ hval += asso_values[(unsigned char)str[2]];
+ break;
+ }
+ return hval;
+}
+
+struct FcObjectTypeNamePool_t
+ {
+ char FcObjectTypeNamePool_str7[sizeof("dpi")];
+ char FcObjectTypeNamePool_str8[sizeof("size")];
+ char FcObjectTypeNamePool_str9[sizeof("file")];
+ char FcObjectTypeNamePool_str13[sizeof("hash")];
+ char FcObjectTypeNamePool_str14[sizeof("rgba")];
+ char FcObjectTypeNamePool_str15[sizeof("spacing")];
+ char FcObjectTypeNamePool_str16[sizeof("scalable")];
+ char FcObjectTypeNamePool_str17[sizeof("slant")];
+ char FcObjectTypeNamePool_str18[sizeof("matrix")];
+ char FcObjectTypeNamePool_str19[sizeof("outline")];
+ char FcObjectTypeNamePool_str20[sizeof("charset")];
+ char FcObjectTypeNamePool_str21[sizeof("antialias")];
+ char FcObjectTypeNamePool_str22[sizeof("lang")];
+ char FcObjectTypeNamePool_str23[sizeof("embolden")];
+ char FcObjectTypeNamePool_str24[sizeof("weight")];
+ char FcObjectTypeNamePool_str25[sizeof("color")];
+ char FcObjectTypeNamePool_str26[sizeof("charwidth")];
+ char FcObjectTypeNamePool_str27[sizeof("variable")];
+ char FcObjectTypeNamePool_str28[sizeof("charheight")];
+ char FcObjectTypeNamePool_str29[sizeof("hinting")];
+ char FcObjectTypeNamePool_str30[sizeof("autohint")];
+ char FcObjectTypeNamePool_str31[sizeof("fullname")];
+ char FcObjectTypeNamePool_str32[sizeof("postscriptname")];
+ char FcObjectTypeNamePool_str33[sizeof("verticallayout")];
+ char FcObjectTypeNamePool_str34[sizeof("lcdfilter")];
+ char FcObjectTypeNamePool_str35[sizeof("fullnamelang")];
+ char FcObjectTypeNamePool_str36[sizeof("hintstyle")];
+ char FcObjectTypeNamePool_str37[sizeof("pixelsize")];
+ char FcObjectTypeNamePool_str38[sizeof("scale")];
+ char FcObjectTypeNamePool_str39[sizeof("globaladvance")];
+ char FcObjectTypeNamePool_str40[sizeof("width")];
+ char FcObjectTypeNamePool_str41[sizeof("order")];
+ char FcObjectTypeNamePool_str42[sizeof("family")];
+ char FcObjectTypeNamePool_str43[sizeof("fonthashint")];
+ char FcObjectTypeNamePool_str44[sizeof("namelang")];
+ char FcObjectTypeNamePool_str45[sizeof("embeddedbitmap")];
+ char FcObjectTypeNamePool_str46[sizeof("familylang")];
+ char FcObjectTypeNamePool_str47[sizeof("capability")];
+ char FcObjectTypeNamePool_str48[sizeof("rasterizer")];
+ char FcObjectTypeNamePool_str49[sizeof("index")];
+ char FcObjectTypeNamePool_str50[sizeof("style")];
+ char FcObjectTypeNamePool_str51[sizeof("foundry")];
+ char FcObjectTypeNamePool_str52[sizeof("fontversion")];
+ char FcObjectTypeNamePool_str53[sizeof("minspace")];
+ char FcObjectTypeNamePool_str54[sizeof("stylelang")];
+ char FcObjectTypeNamePool_str55[sizeof("fontvariations")];
+ char FcObjectTypeNamePool_str56[sizeof("fontformat")];
+ char FcObjectTypeNamePool_str57[sizeof("decorative")];
+ char FcObjectTypeNamePool_str58[sizeof("fontfeatures")];
+ char FcObjectTypeNamePool_str59[sizeof("symbol")];
+ char FcObjectTypeNamePool_str60[sizeof("prgname")];
+ char FcObjectTypeNamePool_str65[sizeof("aspect")];
+ };
+static const struct FcObjectTypeNamePool_t FcObjectTypeNamePool_contents =
+ {
+ "dpi",
+ "size",
+ "file",
+ "hash",
+ "rgba",
+ "spacing",
+ "scalable",
+ "slant",
+ "matrix",
+ "outline",
+ "charset",
+ "antialias",
+ "lang",
+ "embolden",
+ "weight",
+ "color",
+ "charwidth",
+ "variable",
+ "charheight",
+ "hinting",
+ "autohint",
+ "fullname",
+ "postscriptname",
+ "verticallayout",
+ "lcdfilter",
+ "fullnamelang",
+ "hintstyle",
+ "pixelsize",
+ "scale",
+ "globaladvance",
+ "width",
+ "order",
+ "family",
+ "fonthashint",
+ "namelang",
+ "embeddedbitmap",
+ "familylang",
+ "capability",
+ "rasterizer",
+ "index",
+ "style",
+ "foundry",
+ "fontversion",
+ "minspace",
+ "stylelang",
+ "fontvariations",
+ "fontformat",
+ "decorative",
+ "fontfeatures",
+ "symbol",
+ "prgname",
+ "aspect"
+ };
+#define FcObjectTypeNamePool ((const char *) &FcObjectTypeNamePool_contents)
+const struct FcObjectTypeInfo *
+FcObjectTypeLookup (register const char *str, register size_t len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 52,
+ MIN_WORD_LENGTH = 3,
+ MAX_WORD_LENGTH = 14,
+ MIN_HASH_VALUE = 7,
+ MAX_HASH_VALUE = 65
+ };
+
+ static const struct FcObjectTypeInfo wordlist[] =
+ {
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 43 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str7,FC_DPI_OBJECT},
+#line 27 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str8,FC_SIZE_OBJECT},
+#line 38 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str9,FC_FILE_OBJECT},
+ {-1}, {-1}, {-1},
+#line 62 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str13,FC_HASH_OBJECT},
+#line 44 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str14,FC_RGBA_OBJECT},
+#line 30 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str15,FC_SPACING_OBJECT},
+#line 42 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str16,FC_SCALABLE_OBJECT},
+#line 24 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str17,FC_SLANT_OBJECT},
+#line 49 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str18,FC_MATRIX_OBJECT},
+#line 41 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str19,FC_OUTLINE_OBJECT},
+#line 50 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str20,FC_CHARSET_OBJECT},
+#line 32 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str21,FC_ANTIALIAS_OBJECT},
+#line 51 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str22,FC_LANG_OBJECT},
+#line 55 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str23,FC_EMBOLDEN_OBJECT},
+#line 25 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str24,FC_WEIGHT_OBJECT},
+#line 64 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str25,FC_COLOR_OBJECT},
+#line 47 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str26,FC_CHARWIDTH_OBJECT},
+#line 67 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str27,FC_VARIABLE_OBJECT},
+#line 48 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str28,FC_CHAR_HEIGHT_OBJECT},
+#line 34 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str29,FC_HINTING_OBJECT},
+#line 36 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str30,FC_AUTOHINT_OBJECT},
+#line 22 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str31,FC_FULLNAME_OBJECT},
+#line 63 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str32,FC_POSTSCRIPT_NAME_OBJECT},
+#line 35 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str33,FC_VERTICAL_LAYOUT_OBJECT},
+#line 58 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str34,FC_LCD_FILTER_OBJECT},
+#line 23 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str35,FC_FULLNAMELANG_OBJECT},
+#line 33 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str36,FC_HINT_STYLE_OBJECT},
+#line 29 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str37,FC_PIXEL_SIZE_OBJECT},
+#line 45 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str38,FC_SCALE_OBJECT},
+#line 37 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str39,FC_GLOBAL_ADVANCE_OBJECT},
+#line 26 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str40,FC_WIDTH_OBJECT},
+#line 69 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str41,FC_ORDER_OBJECT},
+#line 18 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str42,FC_FAMILY_OBJECT},
+#line 68 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_FONT_HAS_HINT_OBJECT},
+#line 59 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str44,FC_NAMELANG_OBJECT},
+#line 56 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_EMBEDDED_BITMAP_OBJECT},
+#line 19 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_FAMILYLANG_OBJECT},
+#line 53 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str47,FC_CAPABILITY_OBJECT},
+#line 40 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str48,FC_RASTERIZER_OBJECT},
+#line 39 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str49,FC_INDEX_OBJECT},
+#line 20 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str50,FC_STYLE_OBJECT},
+#line 31 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str51,FC_FOUNDRY_OBJECT},
+#line 52 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str52,FC_FONTVERSION_OBJECT},
+#line 46 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str53,FC_MINSPACE_OBJECT},
+#line 21 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str54,FC_STYLELANG_OBJECT},
+#line 66 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str55,FC_FONT_VARIATIONS_OBJECT},
+#line 54 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str56,FC_FONTFORMAT_OBJECT},
+#line 57 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str57,FC_DECORATIVE_OBJECT},
+#line 60 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str58,FC_FONT_FEATURES_OBJECT},
+#line 65 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str59,FC_SYMBOL_OBJECT},
+#line 61 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str60,FC_PRGNAME_OBJECT},
+ {-1}, {-1}, {-1}, {-1},
+#line 28 "fcobjshash.gperf"
+ {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str65,FC_ASPECT_OBJECT}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register unsigned int key = FcObjectTypeHash (str, len);
+
+ if (key <= MAX_HASH_VALUE)
+ {
+ register int o = wordlist[key].name;
+ if (o >= 0)
+ {
+ register const char *s = o + FcObjectTypeNamePool;
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &wordlist[key];
+ }
+ }
+ }
+ return 0;
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/pattern.zig b/vendor/libghostty-vt/pkg/fontconfig/pattern.zig
new file mode 100644
index 00000000..3a623e22
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/pattern.zig
@@ -0,0 +1,168 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const c = @import("c.zig").c;
+const Error = @import("main.zig").Error;
+const ObjectSet = @import("main.zig").ObjectSet;
+const Property = @import("main.zig").Property;
+const Result = @import("main.zig").Result;
+const Value = @import("main.zig").Value;
+const ValueBinding = @import("main.zig").ValueBinding;
+const Weight = @import("main.zig").Weight;
+
+pub const Pattern = opaque {
+ pub fn create() *Pattern {
+ return @ptrCast(c.FcPatternCreate());
+ }
+
+ pub fn parse(str: [:0]const u8) *Pattern {
+ return @ptrCast(c.FcNameParse(str.ptr));
+ }
+
+ pub fn destroy(self: *Pattern) void {
+ c.FcPatternDestroy(self.cval());
+ }
+
+ pub fn defaultSubstitute(self: *Pattern) void {
+ c.FcDefaultSubstitute(self.cval());
+ }
+
+ pub fn add(self: *Pattern, prop: Property, value: Value, append: bool) bool {
+ return c.FcPatternAdd(
+ self.cval(),
+ prop.cval().ptr,
+ value.cval(),
+ if (append) c.FcTrue else c.FcFalse,
+ ) == c.FcTrue;
+ }
+
+ pub fn get(self: *Pattern, prop: Property, id: u32) Error!Value {
+ var val: c.struct__FcValue = undefined;
+ try @as(Result, @enumFromInt(c.FcPatternGet(
+ self.cval(),
+ prop.cval().ptr,
+ @intCast(id),
+ &val,
+ ))).toError();
+
+ return .init(&val);
+ }
+
+ pub fn delete(self: *Pattern, prop: Property) bool {
+ return c.FcPatternDel(self.cval(), prop.cval()) == c.FcTrue;
+ }
+
+ pub fn filter(self: *Pattern, os: *const ObjectSet) *Pattern {
+ return @ptrCast(c.FcPatternFilter(self.cval(), os.cval()));
+ }
+
+ pub fn objectIterator(self: *Pattern) ObjectIterator {
+ return .{ .pat = self.cval(), .iter = null };
+ }
+
+ pub fn print(self: *Pattern) void {
+ c.FcPatternPrint(self.cval());
+ }
+
+ pub inline fn cval(self: *Pattern) *c.struct__FcPattern {
+ return @ptrCast(self);
+ }
+
+ pub const ObjectIterator = struct {
+ pat: *c.struct__FcPattern,
+ iter: ?c.struct__FcPatternIter,
+
+ /// Move to the next object, returns true if there is another
+ /// object and false otherwise. If this is the first call, this
+ /// will be the first object.
+ pub fn next(self: *ObjectIterator) bool {
+ // Null means our first iterator
+ if (self.iter == null) {
+ // If we have no objects, do not create iterator
+ if (c.FcPatternObjectCount(self.pat) == 0) return false;
+
+ var iter: c.struct__FcPatternIter = undefined;
+ c.FcPatternIterStart(
+ self.pat,
+ &iter,
+ );
+ assert(c.FcPatternIterIsValid(self.pat, &iter) == c.FcTrue);
+ self.iter = iter;
+
+ // Return right away because the fontconfig iterator pattern
+ // is do/while.
+ return true;
+ }
+
+ return c.FcPatternIterNext(self.pat, @ptrCast(&self.iter)) == c.FcTrue;
+ }
+
+ pub fn object(self: *ObjectIterator) []const u8 {
+ return std.mem.sliceTo(c.FcPatternIterGetObject(
+ self.pat,
+ &self.iter.?,
+ ), 0);
+ }
+
+ pub fn valueLen(self: *ObjectIterator) usize {
+ return @intCast(c.FcPatternIterValueCount(self.pat, &self.iter.?));
+ }
+
+ pub fn valueIterator(self: *ObjectIterator) ValueIterator {
+ return .{
+ .pat = self.pat,
+ .iter = &self.iter.?,
+ .max = c.FcPatternIterValueCount(self.pat, &self.iter.?),
+ };
+ }
+ };
+
+ pub const ValueIterator = struct {
+ pat: *c.struct__FcPattern,
+ iter: *c.struct__FcPatternIter,
+ max: c_int,
+ id: c_int = 0,
+
+ pub const Entry = struct {
+ result: Result,
+ value: Value,
+ binding: ValueBinding,
+ };
+
+ pub fn next(self: *ValueIterator) ?Entry {
+ if (self.id >= self.max) return null;
+ var value: c.struct__FcValue = undefined;
+ var binding: c.FcValueBinding = undefined;
+ const result = c.FcPatternIterGetValue(self.pat, self.iter, self.id, &value, &binding);
+ self.id += 1;
+
+ return Entry{
+ .result = @enumFromInt(result),
+ .binding = @enumFromInt(binding),
+ .value = .init(&value),
+ };
+ }
+ };
+};
+
+test "create" {
+ const testing = std.testing;
+
+ var pat = Pattern.create();
+ defer pat.destroy();
+
+ try testing.expect(pat.add(.family, .{ .string = "monospace" }, false));
+ try testing.expect(pat.add(.weight, .{ .integer = @intFromEnum(Weight.bold) }, false));
+
+ {
+ const val = try pat.get(.family, 0);
+ try testing.expect(val == .string);
+ try testing.expectEqualStrings("monospace", val.string);
+ }
+}
+
+test "name parse" {
+ var pat = Pattern.parse(":monospace");
+ defer pat.destroy();
+
+ pat.defaultSubstitute();
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/range.zig b/vendor/libghostty-vt/pkg/fontconfig/range.zig
new file mode 100644
index 00000000..9eb0ef26
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/range.zig
@@ -0,0 +1,13 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const c = @import("c.zig").c;
+
+pub const Range = opaque {
+ pub fn destroy(self: *Range) void {
+ c.FcRangeDestroy(self.cval());
+ }
+
+ pub inline fn cval(self: *Range) *c.struct__FcRange {
+ return @ptrCast(self);
+ }
+};
diff --git a/vendor/libghostty-vt/pkg/fontconfig/test.zig b/vendor/libghostty-vt/pkg/fontconfig/test.zig
new file mode 100644
index 00000000..bd121c1b
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/test.zig
@@ -0,0 +1,66 @@
+const std = @import("std");
+const fontconfig = @import("main.zig");
+
+test "fc-list" {
+ const testing = std.testing;
+
+ var cfg = fontconfig.initLoadConfigAndFonts();
+ defer cfg.destroy();
+
+ var pat = fontconfig.Pattern.create();
+ defer pat.destroy();
+
+ var os = fontconfig.ObjectSet.create();
+ defer os.destroy();
+
+ var fs = cfg.fontList(pat, os);
+ defer fs.destroy();
+
+ // Note: this is environmental, but in general we expect all our
+ // testing environments to have at least one font.
+ try testing.expect(fs.fonts().len > 0);
+}
+
+test "fc-match" {
+ const testing = std.testing;
+
+ var cfg = fontconfig.initLoadConfigAndFonts();
+ defer cfg.destroy();
+
+ var pat = fontconfig.Pattern.create();
+ errdefer pat.destroy();
+ try testing.expect(cfg.substituteWithPat(pat, .pattern));
+ pat.defaultSubstitute();
+
+ const result = cfg.fontSort(pat, false, null);
+ errdefer result.fs.destroy();
+
+ var fs = fontconfig.FontSet.create();
+ defer fs.destroy();
+ defer for (fs.fonts()) |font| font.destroy();
+
+ {
+ const fonts = result.fs.fonts();
+ try testing.expect(fonts.len > 0);
+ for (fonts) |font| {
+ const pat_prep = try cfg.fontRenderPrepare(pat, font);
+ try testing.expect(fs.add(pat_prep));
+ }
+ result.fs.destroy();
+ pat.destroy();
+ }
+
+ {
+ for (fs.fonts()) |font| {
+ var it = font.objectIterator();
+ while (it.next()) {
+ try testing.expect(it.object().len > 0);
+ try testing.expect(it.valueLen() > 0);
+ var value_it = it.valueIterator();
+ while (value_it.next()) |entry| {
+ try testing.expect(entry.value != .unknown);
+ }
+ }
+ }
+ }
+}
diff --git a/vendor/libghostty-vt/pkg/fontconfig/value.zig b/vendor/libghostty-vt/pkg/fontconfig/value.zig
new file mode 100644
index 00000000..89f796a2
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/fontconfig/value.zig
@@ -0,0 +1,76 @@
+const std = @import("std");
+const assert = std.debug.assert;
+const c = @import("c.zig").c;
+const CharSet = @import("main.zig").CharSet;
+const LangSet = @import("main.zig").LangSet;
+const Matrix = @import("main.zig").Matrix;
+const Range = @import("main.zig").Range;
+
+pub const Type = enum(c_int) {
+ unknown = c.FcTypeUnknown,
+ void = c.FcTypeVoid,
+ integer = c.FcTypeInteger,
+ double = c.FcTypeDouble,
+ string = c.FcTypeString,
+ bool = c.FcTypeBool,
+ matrix = c.FcTypeMatrix,
+ char_set = c.FcTypeCharSet,
+ ft_face = c.FcTypeFTFace,
+ lang_set = c.FcTypeLangSet,
+ range = c.FcTypeRange,
+};
+
+pub const Value = union(Type) {
+ unknown: void,
+ void: void,
+ integer: i32,
+ double: f64,
+ string: [:0]const u8,
+ bool: bool,
+ matrix: *const Matrix,
+ char_set: *const CharSet,
+ ft_face: *anyopaque,
+ lang_set: *const LangSet,
+ range: *const Range,
+
+ pub fn init(cvalue: *c.struct__FcValue) Value {
+ return switch (@as(Type, @enumFromInt(cvalue.type))) {
+ .unknown => .{ .unknown = {} },
+ .void => .{ .void = {} },
+ .string => .{ .string = std.mem.sliceTo(cvalue.u.s, 0) },
+ .integer => .{ .integer = @intCast(cvalue.u.i) },
+ .double => .{ .double = cvalue.u.d },
+ .bool => .{ .bool = cvalue.u.b == c.FcTrue },
+ .matrix => .{ .matrix = @ptrCast(cvalue.u.m) },
+ .char_set => .{ .char_set = @ptrCast(cvalue.u.c) },
+ .ft_face => .{ .ft_face = @ptrCast(cvalue.u.f) },
+ .lang_set => .{ .lang_set = @ptrCast(cvalue.u.l) },
+ .range => .{ .range = @ptrCast(cvalue.u.r) },
+ };
+ }
+
+ pub fn cval(self: Value) c.struct__FcValue {
+ return .{
+ .type = @intFromEnum(std.meta.activeTag(self)),
+ .u = switch (self) {
+ .unknown => undefined,
+ .void => undefined,
+ .integer => |v| .{ .i = @intCast(v) },
+ .double => |v| .{ .d = v },
+ .string => |v| .{ .s = v.ptr },
+ .bool => |v| .{ .b = if (v) c.FcTrue else c.FcFalse },
+ .matrix => |v| .{ .m = @ptrCast(v) },
+ .char_set => |v| .{ .c = @ptrCast(v) },
+ .ft_face => |v| .{ .f = v },
+ .lang_set => |v| .{ .l = @ptrCast(v) },
+ .range => |v| .{ .r = @ptrCast(v) },
+ },
+ };
+ }
+};
+
+pub const ValueBinding = enum(c_int) {
+ weak = c.FcValueBindingWeak,
+ strong = c.FcValueBindingStrong,
+ same = c.FcValueBindingSame,
+};
diff --git a/vendor/libghostty-vt/pkg/freetype/Library.zig b/vendor/libghostty-vt/pkg/freetype/Library.zig
new file mode 100644
index 00000000..1cff7921
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/Library.zig
@@ -0,0 +1,92 @@
+const Library = @This();
+
+const std = @import("std");
+const c = @import("c.zig").c;
+const Face = @import("face.zig").Face;
+const errors = @import("errors.zig");
+const Error = errors.Error;
+const intToError = errors.intToError;
+
+handle: c.FT_Library,
+
+/// Initialize a new FreeType library object. The set of modules that are
+/// registered by this function is determined at build time.
+pub fn init() Error!Library {
+ var res = Library{ .handle = undefined };
+ try intToError(c.FT_Init_FreeType(&res.handle));
+ return res;
+}
+
+/// Destroy a given FreeType library object and all of its children,
+/// including resources, drivers, faces, sizes, etc.
+pub fn deinit(self: Library) void {
+ _ = c.FT_Done_FreeType(self.handle);
+}
+
+/// Return the version of the FreeType library being used. This is useful when
+/// dynamically linking to the library, since one cannot use the macros
+/// FREETYPE_MAJOR, FREETYPE_MINOR, and FREETYPE_PATCH.
+pub fn version(self: Library) Version {
+ var v: Version = undefined;
+ c.FT_Library_Version(self.handle, &v.major, &v.minor, &v.patch);
+ return v;
+}
+
+/// Call FT_New_Face to open a font from a file.
+pub fn initFace(self: Library, path: [:0]const u8, index: i32) Error!Face {
+ var face: Face = undefined;
+ try intToError(c.FT_New_Face(
+ self.handle,
+ path.ptr,
+ index,
+ &face.handle,
+ ));
+ return face;
+}
+
+/// Call FT_Open_Face to open a font that has been loaded into memory.
+pub fn initMemoryFace(self: Library, data: []const u8, index: i32) Error!Face {
+ var face: Face = undefined;
+ try intToError(c.FT_New_Memory_Face(
+ self.handle,
+ data.ptr,
+ @intCast(data.len),
+ index,
+ &face.handle,
+ ));
+ return face;
+}
+
+/// Call when you're done with a loaded MM var.
+pub fn doneMMVar(self: Library, mm: *c.FT_MM_Var) void {
+ _ = c.FT_Done_MM_Var(self.handle, mm);
+}
+
+pub const Version = struct {
+ major: i32,
+ minor: i32,
+ patch: i32,
+
+ /// Convert the version to a string. The buffer should be able to
+ /// accommodate the size, recommended to be at least 8 chars wide.
+ /// The returned slice will be a slice of buf that contains the full
+ /// version string.
+ pub fn toString(self: Version, buf: []u8) ![]const u8 {
+ return try std.fmt.bufPrint(buf, "{d}.{d}.{d}", .{
+ self.major, self.minor, self.patch,
+ });
+ }
+};
+
+test "basics" {
+ const testing = std.testing;
+
+ var lib = try init();
+ defer lib.deinit();
+
+ const vsn = lib.version();
+ try testing.expect(vsn.major > 1);
+
+ var buf: [32]u8 = undefined;
+ _ = try vsn.toString(&buf);
+}
diff --git a/vendor/libghostty-vt/pkg/freetype/build.zig b/vendor/libghostty-vt/pkg/freetype/build.zig
new file mode 100644
index 00000000..b85310a5
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/build.zig
@@ -0,0 +1,219 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+ const libpng_enabled = b.option(bool, "enable-libpng", "Build libpng") orelse false;
+
+ const module = b.addModule("freetype", .{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ });
+
+ // For dynamic linking, we prefer dynamic linking and to search by
+ // mode first. Mode first will search all paths for a dynamic library
+ // before falling back to static.
+ const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{
+ .preferred_link_mode = .dynamic,
+ .search_strategy = .mode_first,
+ };
+
+ var test_exe: ?*std.Build.Step.Compile = null;
+ if (target.query.isNative()) {
+ test_exe = b.addTest(.{
+ .name = "test",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ const tests_run = b.addRunArtifact(test_exe.?);
+ const test_step = b.step("test", "Run tests");
+ test_step.dependOn(&tests_run.step);
+ }
+
+ module.addIncludePath(b.path(""));
+
+ if (b.systemIntegrationOption("freetype", .{})) {
+ module.linkSystemLibrary("freetype2", dynamic_link_opts);
+ if (test_exe) |exe| {
+ exe.linkSystemLibrary2("freetype2", dynamic_link_opts);
+ }
+ } else {
+ const lib = try buildLib(b, module, .{
+ .target = target,
+ .optimize = optimize,
+
+ .libpng_enabled = libpng_enabled,
+
+ .dynamic_link_opts = dynamic_link_opts,
+ });
+
+ if (test_exe) |exe| {
+ exe.linkLibrary(lib);
+ }
+ }
+}
+
+fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Build.Step.Compile {
+ const target = options.target;
+ const optimize = options.optimize;
+
+ const libpng_enabled = options.libpng_enabled;
+
+ const lib = b.addLibrary(.{
+ .name = "freetype",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ if (target.result.os.tag.isDarwin()) {
+ const apple_sdk = @import("apple_sdk");
+ try apple_sdk.addPaths(b, lib);
+ }
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ "-DFT2_BUILD_LIBRARY",
+
+ "-DFT_CONFIG_OPTION_SYSTEM_ZLIB=1",
+
+ "-fno-sanitize=undefined",
+ });
+ if (target.result.os.tag != .windows) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_UNISTD_H",
+ "-DHAVE_FCNTL_H",
+ });
+ }
+
+ if (target.result.os.tag == .freebsd or target.result.abi == .musl) {
+ try flags.append(b.allocator, "-fPIC");
+ }
+
+ const dynamic_link_opts = options.dynamic_link_opts;
+
+ // Zlib
+ if (b.systemIntegrationOption("zlib", .{})) {
+ lib.linkSystemLibrary2("zlib", dynamic_link_opts);
+ } else {
+ const zlib_dep = b.dependency("zlib", .{ .target = target, .optimize = optimize });
+ lib.linkLibrary(zlib_dep.artifact("z"));
+ }
+
+ // Libpng
+ _ = b.systemIntegrationOption("libpng", .{}); // So it shows up in help
+ if (libpng_enabled) {
+ try flags.append(b.allocator, "-DFT_CONFIG_OPTION_USE_PNG=1");
+
+ if (b.systemIntegrationOption("libpng", .{})) {
+ lib.linkSystemLibrary2("libpng", dynamic_link_opts);
+ } else {
+ const libpng_dep = b.dependency(
+ "libpng",
+ .{ .target = target, .optimize = optimize },
+ );
+ lib.linkLibrary(libpng_dep.artifact("png"));
+ }
+ }
+
+ if (b.lazyDependency("freetype", .{})) |upstream| {
+ lib.addIncludePath(upstream.path("include"));
+ module.addIncludePath(upstream.path("include"));
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = srcs,
+ .flags = flags.items,
+ });
+
+ switch (target.result.os.tag) {
+ .linux => lib.addCSourceFile(.{
+ .file = upstream.path("builds/unix/ftsystem.c"),
+ .flags = flags.items,
+ }),
+ .windows => lib.addCSourceFile(.{
+ .file = upstream.path("builds/windows/ftsystem.c"),
+ .flags = flags.items,
+ }),
+ else => lib.addCSourceFile(.{
+ .file = upstream.path("src/base/ftsystem.c"),
+ .flags = flags.items,
+ }),
+ }
+ switch (target.result.os.tag) {
+ .windows => {
+ lib.addCSourceFile(.{
+ .file = upstream.path("builds/windows/ftdebug.c"),
+ .flags = flags.items,
+ });
+ lib.addWin32ResourceFile(.{
+ .file = upstream.path("src/base/ftver.rc"),
+ });
+ },
+ else => lib.addCSourceFile(.{
+ .file = upstream.path("src/base/ftdebug.c"),
+ .flags = flags.items,
+ }),
+ }
+
+ lib.installHeader(b.path("freetype-zig.h"), "freetype-zig.h");
+ lib.installHeadersDirectory(
+ upstream.path("include"),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ b.installArtifact(lib);
+
+ return lib;
+}
+
+const srcs: []const []const u8 = &.{
+ "src/autofit/autofit.c",
+ "src/base/ftbase.c",
+ "src/base/ftbbox.c",
+ "src/base/ftbdf.c",
+ "src/base/ftbitmap.c",
+ "src/base/ftcid.c",
+ "src/base/ftfstype.c",
+ "src/base/ftgasp.c",
+ "src/base/ftglyph.c",
+ "src/base/ftgxval.c",
+ "src/base/ftinit.c",
+ "src/base/ftmm.c",
+ "src/base/ftotval.c",
+ "src/base/ftpatent.c",
+ "src/base/ftpfr.c",
+ "src/base/ftstroke.c",
+ "src/base/ftsynth.c",
+ "src/base/fttype1.c",
+ "src/base/ftwinfnt.c",
+ "src/bdf/bdf.c",
+ "src/bzip2/ftbzip2.c",
+ "src/cache/ftcache.c",
+ "src/cff/cff.c",
+ "src/cid/type1cid.c",
+ "src/gzip/ftgzip.c",
+ "src/lzw/ftlzw.c",
+ "src/pcf/pcf.c",
+ "src/pfr/pfr.c",
+ "src/psaux/psaux.c",
+ "src/pshinter/pshinter.c",
+ "src/psnames/psnames.c",
+ "src/raster/raster.c",
+ "src/sdf/sdf.c",
+ "src/sfnt/sfnt.c",
+ "src/smooth/smooth.c",
+ "src/svg/svg.c",
+ "src/truetype/truetype.c",
+ "src/type1/type1.c",
+ "src/type42/type42.c",
+ "src/winfonts/winfnt.c",
+};
diff --git a/vendor/libghostty-vt/pkg/freetype/build.zig.zon b/vendor/libghostty-vt/pkg/freetype/build.zig.zon
new file mode 100644
index 00000000..8ed1516b
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/build.zig.zon
@@ -0,0 +1,18 @@
+.{
+ .name = .freetype,
+ .version = "2.13.2",
+ .fingerprint = 0xac2059b6f7bbfe0a,
+ .paths = .{""},
+ .dependencies = .{
+ // freetype/freetype
+ .freetype = .{
+ .url = "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz",
+ .hash = "N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub",
+ .lazy = true,
+ },
+
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ .libpng = .{ .path = "../libpng" },
+ .zlib = .{ .path = "../zlib" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/freetype/c.zig b/vendor/libghostty-vt/pkg/freetype/c.zig
new file mode 100644
index 00000000..9431abeb
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/c.zig
@@ -0,0 +1,3 @@
+pub const c = @cImport({
+ @cInclude("freetype-zig.h");
+});
diff --git a/vendor/libghostty-vt/pkg/freetype/computations.zig b/vendor/libghostty-vt/pkg/freetype/computations.zig
new file mode 100644
index 00000000..fc9b2ccb
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/computations.zig
@@ -0,0 +1,8 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+
+/// Compute (a*b)/0x10000 with maximum accuracy. Its main use is to multiply
+/// a given value by a 16.16 fixed-point factor.
+pub fn mulFix(a: i32, b: i32) i32 {
+ return @intCast(c.FT_MulFix(a, b));
+}
diff --git a/vendor/libghostty-vt/pkg/freetype/errors.zig b/vendor/libghostty-vt/pkg/freetype/errors.zig
new file mode 100644
index 00000000..9eddc057
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/errors.zig
@@ -0,0 +1,295 @@
+const c = @import("c.zig").c;
+
+// Thanks to Mach (https://github.com/hexops/mach) for this work, I didn't
+// do this manually. I wrote the other Freetype bindings by hand but this
+// one was... too tedius.
+
+pub const Error = error{
+ CannotOpenResource,
+ UnknownFileFormat,
+ InvalidFileFormat,
+ InvalidVersion,
+ LowerModuleVersion,
+ InvalidArgument,
+ UnimplementedFeature,
+ InvalidTable,
+ InvalidOffset,
+ ArrayTooLarge,
+ MissingModule,
+ MissingProperty,
+ InvalidGlyphIndex,
+ InvalidCharacterCode,
+ InvalidGlyphFormat,
+ CannotRenderGlyph,
+ InvalidOutline,
+ InvalidComposite,
+ TooManyHints,
+ InvalidPixelSize,
+ InvalidHandle,
+ InvalidLibraryHandle,
+ InvalidDriverHandle,
+ InvalidFaceHandle,
+ InvalidSizeHandle,
+ InvalidSlotHandle,
+ InvalidCharMapHandle,
+ InvalidCacheHandle,
+ InvalidStreamHandle,
+ TooManyDrivers,
+ TooManyExtensions,
+ OutOfMemory,
+ UnlistedObject,
+ CannotOpenStream,
+ InvalidStreamSeek,
+ InvalidStreamSkip,
+ InvalidStreamRead,
+ InvalidStreamOperation,
+ InvalidFrameOperation,
+ NestedFrameAccess,
+ InvalidFrameRead,
+ RasterUninitialized,
+ RasterCorrupted,
+ RasterOverflow,
+ RasterNegativeHeight,
+ TooManyCaches,
+ InvalidOpcode,
+ TooFewArguments,
+ StackOverflow,
+ CodeOverflow,
+ BadArgument,
+ DivideByZero,
+ InvalidReference,
+ DebugOpCode,
+ ENDFInExecStream,
+ NestedDEFS,
+ InvalidCodeRange,
+ ExecutionTooLong,
+ TooManyFunctionDefs,
+ TooManyInstructionDefs,
+ TableMissing,
+ HorizHeaderMissing,
+ LocationsMissing,
+ NameTableMissing,
+ CMapTableMissing,
+ HmtxTableMissing,
+ PostTableMissing,
+ InvalidHorizMetrics,
+ InvalidCharMapFormat,
+ InvalidPPem,
+ InvalidVertMetrics,
+ CouldNotFindContext,
+ InvalidPostTableFormat,
+ InvalidPostTable,
+ Syntax,
+ StackUnderflow,
+ Ignore,
+ NoUnicodeGlyphName,
+ MissingStartfontField,
+ MissingFontField,
+ MissingSizeField,
+ MissingFontboundingboxField,
+ MissingCharsField,
+ MissingStartcharField,
+ MissingEncodingField,
+ MissingBbxField,
+ BbxTooBig,
+ CorruptedFontHeader,
+ CorruptedFontGlyphs,
+ UnknownFreetypeError,
+};
+
+pub fn intToError(err: c_int) Error!void {
+ return switch (err) {
+ c.FT_Err_Ok => {},
+ c.FT_Err_Cannot_Open_Resource => Error.CannotOpenResource,
+ c.FT_Err_Unknown_File_Format => Error.UnknownFileFormat,
+ c.FT_Err_Invalid_File_Format => Error.InvalidFileFormat,
+ c.FT_Err_Invalid_Version => Error.InvalidVersion,
+ c.FT_Err_Lower_Module_Version => Error.LowerModuleVersion,
+ c.FT_Err_Invalid_Argument => Error.InvalidArgument,
+ c.FT_Err_Unimplemented_Feature => Error.UnimplementedFeature,
+ c.FT_Err_Invalid_Table => Error.InvalidTable,
+ c.FT_Err_Invalid_Offset => Error.InvalidOffset,
+ c.FT_Err_Array_Too_Large => Error.ArrayTooLarge,
+ c.FT_Err_Missing_Module => Error.MissingModule,
+ c.FT_Err_Missing_Property => Error.MissingProperty,
+ c.FT_Err_Invalid_Glyph_Index => Error.InvalidGlyphIndex,
+ c.FT_Err_Invalid_Character_Code => Error.InvalidCharacterCode,
+ c.FT_Err_Invalid_Glyph_Format => Error.InvalidGlyphFormat,
+ c.FT_Err_Cannot_Render_Glyph => Error.CannotRenderGlyph,
+ c.FT_Err_Invalid_Outline => Error.InvalidOutline,
+ c.FT_Err_Invalid_Composite => Error.InvalidComposite,
+ c.FT_Err_Too_Many_Hints => Error.TooManyHints,
+ c.FT_Err_Invalid_Pixel_Size => Error.InvalidPixelSize,
+ c.FT_Err_Invalid_Handle => Error.InvalidHandle,
+ c.FT_Err_Invalid_Library_Handle => Error.InvalidLibraryHandle,
+ c.FT_Err_Invalid_Driver_Handle => Error.InvalidDriverHandle,
+ c.FT_Err_Invalid_Face_Handle => Error.InvalidFaceHandle,
+ c.FT_Err_Invalid_Size_Handle => Error.InvalidSizeHandle,
+ c.FT_Err_Invalid_Slot_Handle => Error.InvalidSlotHandle,
+ c.FT_Err_Invalid_CharMap_Handle => Error.InvalidCharMapHandle,
+ c.FT_Err_Invalid_Cache_Handle => Error.InvalidCacheHandle,
+ c.FT_Err_Invalid_Stream_Handle => Error.InvalidStreamHandle,
+ c.FT_Err_Too_Many_Drivers => Error.TooManyDrivers,
+ c.FT_Err_Too_Many_Extensions => Error.TooManyExtensions,
+ c.FT_Err_Out_Of_Memory => Error.OutOfMemory,
+ c.FT_Err_Unlisted_Object => Error.UnlistedObject,
+ c.FT_Err_Cannot_Open_Stream => Error.CannotOpenStream,
+ c.FT_Err_Invalid_Stream_Seek => Error.InvalidStreamSeek,
+ c.FT_Err_Invalid_Stream_Skip => Error.InvalidStreamSkip,
+ c.FT_Err_Invalid_Stream_Read => Error.InvalidStreamRead,
+ c.FT_Err_Invalid_Stream_Operation => Error.InvalidStreamOperation,
+ c.FT_Err_Invalid_Frame_Operation => Error.InvalidFrameOperation,
+ c.FT_Err_Nested_Frame_Access => Error.NestedFrameAccess,
+ c.FT_Err_Invalid_Frame_Read => Error.InvalidFrameRead,
+ c.FT_Err_Raster_Uninitialized => Error.RasterUninitialized,
+ c.FT_Err_Raster_Corrupted => Error.RasterCorrupted,
+ c.FT_Err_Raster_Overflow => Error.RasterOverflow,
+ c.FT_Err_Raster_Negative_Height => Error.RasterNegativeHeight,
+ c.FT_Err_Too_Many_Caches => Error.TooManyCaches,
+ c.FT_Err_Invalid_Opcode => Error.InvalidOpcode,
+ c.FT_Err_Too_Few_Arguments => Error.TooFewArguments,
+ c.FT_Err_Stack_Overflow => Error.StackOverflow,
+ c.FT_Err_Code_Overflow => Error.CodeOverflow,
+ c.FT_Err_Bad_Argument => Error.BadArgument,
+ c.FT_Err_Divide_By_Zero => Error.DivideByZero,
+ c.FT_Err_Invalid_Reference => Error.InvalidReference,
+ c.FT_Err_Debug_OpCode => Error.DebugOpCode,
+ c.FT_Err_ENDF_In_Exec_Stream => Error.ENDFInExecStream,
+ c.FT_Err_Nested_DEFS => Error.NestedDEFS,
+ c.FT_Err_Invalid_CodeRange => Error.InvalidCodeRange,
+ c.FT_Err_Execution_Too_Long => Error.ExecutionTooLong,
+ c.FT_Err_Too_Many_Function_Defs => Error.TooManyFunctionDefs,
+ c.FT_Err_Too_Many_Instruction_Defs => Error.TooManyInstructionDefs,
+ c.FT_Err_Table_Missing => Error.TableMissing,
+ c.FT_Err_Horiz_Header_Missing => Error.HorizHeaderMissing,
+ c.FT_Err_Locations_Missing => Error.LocationsMissing,
+ c.FT_Err_Name_Table_Missing => Error.NameTableMissing,
+ c.FT_Err_CMap_Table_Missing => Error.CMapTableMissing,
+ c.FT_Err_Hmtx_Table_Missing => Error.HmtxTableMissing,
+ c.FT_Err_Post_Table_Missing => Error.PostTableMissing,
+ c.FT_Err_Invalid_Horiz_Metrics => Error.InvalidHorizMetrics,
+ c.FT_Err_Invalid_CharMap_Format => Error.InvalidCharMapFormat,
+ c.FT_Err_Invalid_PPem => Error.InvalidPPem,
+ c.FT_Err_Invalid_Vert_Metrics => Error.InvalidVertMetrics,
+ c.FT_Err_Could_Not_Find_Context => Error.CouldNotFindContext,
+ c.FT_Err_Invalid_Post_Table_Format => Error.InvalidPostTableFormat,
+ c.FT_Err_Invalid_Post_Table => Error.InvalidPostTable,
+ c.FT_Err_Syntax_Error => Error.Syntax,
+ c.FT_Err_Stack_Underflow => Error.StackUnderflow,
+ c.FT_Err_Ignore => Error.Ignore,
+ c.FT_Err_No_Unicode_Glyph_Name => Error.NoUnicodeGlyphName,
+ c.FT_Err_Missing_Startfont_Field => Error.MissingStartfontField,
+ c.FT_Err_Missing_Font_Field => Error.MissingFontField,
+ c.FT_Err_Missing_Size_Field => Error.MissingSizeField,
+ c.FT_Err_Missing_Fontboundingbox_Field => Error.MissingFontboundingboxField,
+ c.FT_Err_Missing_Chars_Field => Error.MissingCharsField,
+ c.FT_Err_Missing_Startchar_Field => Error.MissingStartcharField,
+ c.FT_Err_Missing_Encoding_Field => Error.MissingEncodingField,
+ c.FT_Err_Missing_Bbx_Field => Error.MissingBbxField,
+ c.FT_Err_Bbx_Too_Big => Error.BbxTooBig,
+ c.FT_Err_Corrupted_Font_Header => Error.CorruptedFontHeader,
+ c.FT_Err_Corrupted_Font_Glyphs => Error.CorruptedFontGlyphs,
+ else => Error.UnknownFreetypeError,
+ };
+}
+
+pub fn errorToInt(err: Error) c_int {
+ return switch (err) {
+ Error.CannotOpenResource => c.FT_Err_Cannot_Open_Resource,
+ Error.UnknownFileFormat => c.FT_Err_Unknown_File_Format,
+ Error.InvalidFileFormat => c.FT_Err_Invalid_File_Format,
+ Error.InvalidVersion => c.FT_Err_Invalid_Version,
+ Error.LowerModuleVersion => c.FT_Err_Lower_Module_Version,
+ Error.InvalidArgument => c.FT_Err_Invalid_Argument,
+ Error.UnimplementedFeature => c.FT_Err_Unimplemented_Feature,
+ Error.InvalidTable => c.FT_Err_Invalid_Table,
+ Error.InvalidOffset => c.FT_Err_Invalid_Offset,
+ Error.ArrayTooLarge => c.FT_Err_Array_Too_Large,
+ Error.MissingModule => c.FT_Err_Missing_Module,
+ Error.MissingProperty => c.FT_Err_Missing_Property,
+ Error.InvalidGlyphIndex => c.FT_Err_Invalid_Glyph_Index,
+ Error.InvalidCharacterCode => c.FT_Err_Invalid_Character_Code,
+ Error.InvalidGlyphFormat => c.FT_Err_Invalid_Glyph_Format,
+ Error.CannotRenderGlyph => c.FT_Err_Cannot_Render_Glyph,
+ Error.InvalidOutline => c.FT_Err_Invalid_Outline,
+ Error.InvalidComposite => c.FT_Err_Invalid_Composite,
+ Error.TooManyHints => c.FT_Err_Too_Many_Hints,
+ Error.InvalidPixelSize => c.FT_Err_Invalid_Pixel_Size,
+ Error.InvalidHandle => c.FT_Err_Invalid_Handle,
+ Error.InvalidLibraryHandle => c.FT_Err_Invalid_Library_Handle,
+ Error.InvalidDriverHandle => c.FT_Err_Invalid_Driver_Handle,
+ Error.InvalidFaceHandle => c.FT_Err_Invalid_Face_Handle,
+ Error.InvalidSizeHandle => c.FT_Err_Invalid_Size_Handle,
+ Error.InvalidSlotHandle => c.FT_Err_Invalid_Slot_Handle,
+ Error.InvalidCharMapHandle => c.FT_Err_Invalid_CharMap_Handle,
+ Error.InvalidCacheHandle => c.FT_Err_Invalid_Cache_Handle,
+ Error.InvalidStreamHandle => c.FT_Err_Invalid_Stream_Handle,
+ Error.TooManyDrivers => c.FT_Err_Too_Many_Drivers,
+ Error.TooManyExtensions => c.FT_Err_Too_Many_Extensions,
+ Error.OutOfMemory => c.FT_Err_Out_Of_Memory,
+ Error.UnlistedObject => c.FT_Err_Unlisted_Object,
+ Error.CannotOpenStream => c.FT_Err_Cannot_Open_Stream,
+ Error.InvalidStreamSeek => c.FT_Err_Invalid_Stream_Seek,
+ Error.InvalidStreamSkip => c.FT_Err_Invalid_Stream_Skip,
+ Error.InvalidStreamRead => c.FT_Err_Invalid_Stream_Read,
+ Error.InvalidStreamOperation => c.FT_Err_Invalid_Stream_Operation,
+ Error.InvalidFrameOperation => c.FT_Err_Invalid_Frame_Operation,
+ Error.NestedFrameAccess => c.FT_Err_Nested_Frame_Access,
+ Error.InvalidFrameRead => c.FT_Err_Invalid_Frame_Read,
+ Error.RasterUninitialized => c.FT_Err_Raster_Uninitialized,
+ Error.RasterCorrupted => c.FT_Err_Raster_Corrupted,
+ Error.RasterOverflow => c.FT_Err_Raster_Overflow,
+ Error.RasterNegativeHeight => c.FT_Err_Raster_Negative_Height,
+ Error.TooManyCaches => c.FT_Err_Too_Many_Caches,
+ Error.InvalidOpcode => c.FT_Err_Invalid_Opcode,
+ Error.TooFewArguments => c.FT_Err_Too_Few_Arguments,
+ Error.StackOverflow => c.FT_Err_Stack_Overflow,
+ Error.CodeOverflow => c.FT_Err_Code_Overflow,
+ Error.BadArgument => c.FT_Err_Bad_Argument,
+ Error.DivideByZero => c.FT_Err_Divide_By_Zero,
+ Error.InvalidReference => c.FT_Err_Invalid_Reference,
+ Error.DebugOpCode => c.FT_Err_Debug_OpCode,
+ Error.ENDFInExecStream => c.FT_Err_ENDF_In_Exec_Stream,
+ Error.NestedDEFS => c.FT_Err_Nested_DEFS,
+ Error.InvalidCodeRange => c.FT_Err_Invalid_CodeRange,
+ Error.ExecutionTooLong => c.FT_Err_Execution_Too_Long,
+ Error.TooManyFunctionDefs => c.FT_Err_Too_Many_Function_Defs,
+ Error.TooManyInstructionDefs => c.FT_Err_Too_Many_Instruction_Defs,
+ Error.TableMissing => c.FT_Err_Table_Missing,
+ Error.HorizHeaderMissing => c.FT_Err_Horiz_Header_Missing,
+ Error.LocationsMissing => c.FT_Err_Locations_Missing,
+ Error.NameTableMissing => c.FT_Err_Name_Table_Missing,
+ Error.CMapTableMissing => c.FT_Err_CMap_Table_Missing,
+ Error.HmtxTableMissing => c.FT_Err_Hmtx_Table_Missing,
+ Error.PostTableMissing => c.FT_Err_Post_Table_Missing,
+ Error.InvalidHorizMetrics => c.FT_Err_Invalid_Horiz_Metrics,
+ Error.InvalidCharMapFormat => c.FT_Err_Invalid_CharMap_Format,
+ Error.InvalidPPem => c.FT_Err_Invalid_PPem,
+ Error.InvalidVertMetrics => c.FT_Err_Invalid_Vert_Metrics,
+ Error.CouldNotFindContext => c.FT_Err_Could_Not_Find_Context,
+ Error.InvalidPostTableFormat => c.FT_Err_Invalid_Post_Table_Format,
+ Error.InvalidPostTable => c.FT_Err_Invalid_Post_Table,
+ Error.Syntax => c.FT_Err_Syntax_Error,
+ Error.StackUnderflow => c.FT_Err_Stack_Underflow,
+ Error.Ignore => c.FT_Err_Ignore,
+ Error.NoUnicodeGlyphName => c.FT_Err_No_Unicode_Glyph_Name,
+ Error.MissingStartfontField => c.FT_Err_Missing_Startfont_Field,
+ Error.MissingFontField => c.FT_Err_Missing_Font_Field,
+ Error.MissingSizeField => c.FT_Err_Missing_Size_Field,
+ Error.MissingFontboundingboxField => c.FT_Err_Missing_Fontboundingbox_Field,
+ Error.MissingCharsField => c.FT_Err_Missing_Chars_Field,
+ Error.MissingStartcharField => c.FT_Err_Missing_Startchar_Field,
+ Error.MissingEncodingField => c.FT_Err_Missing_Encoding_Field,
+ Error.MissingBbxField => c.FT_Err_Missing_Bbx_Field,
+ Error.BbxTooBig => c.FT_Err_Bbx_Too_Big,
+ Error.CorruptedFontHeader => c.FT_Err_Corrupted_Font_Header,
+ Error.CorruptedFontGlyphs => c.FT_Err_Corrupted_Font_Glyphs,
+ };
+}
+
+test "error conversion" {
+ const expectError = @import("std").testing.expectError;
+
+ try intToError(c.FT_Err_Ok);
+ try expectError(Error.OutOfMemory, intToError(c.FT_Err_Out_Of_Memory));
+}
diff --git a/vendor/libghostty-vt/pkg/freetype/face.zig b/vendor/libghostty-vt/pkg/freetype/face.zig
new file mode 100644
index 00000000..cd949e35
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/face.zig
@@ -0,0 +1,385 @@
+const std = @import("std");
+const Allocator = std.mem.Allocator;
+const c = @import("c.zig").c;
+const errors = @import("errors.zig");
+const Library = @import("Library.zig");
+const Tag = @import("tag.zig").Tag;
+const Error = errors.Error;
+const intToError = errors.intToError;
+
+pub const Face = struct {
+ handle: c.FT_Face,
+
+ pub fn deinit(self: Face) void {
+ _ = c.FT_Done_Face(self.handle);
+ }
+
+ /// Increment the counter of the face.
+ pub fn ref(self: Face) void {
+ _ = c.FT_Reference_Face(self.handle);
+ }
+
+ /// A macro that returns true whenever a face object contains some
+ /// embedded bitmaps. See the available_sizes field of the FT_FaceRec structure.
+ pub fn hasFixedSizes(self: Face) bool {
+ return c.FT_HAS_FIXED_SIZES(self.handle);
+ }
+
+ /// A macro that returns true whenever a face object contains tables for
+ /// color glyphs.
+ pub fn hasColor(self: Face) bool {
+ return c.FT_HAS_COLOR(self.handle);
+ }
+
+ /// A macro that returns true whenever a face object contains an ‘sbix’
+ /// OpenType table and outline glyphs.
+ pub fn hasSBIX(self: Face) bool {
+ return c.FT_HAS_SBIX(self.handle);
+ }
+
+ /// A macro that returns true whenever a face object contains some
+ /// multiple masters.
+ pub fn hasMultipleMasters(self: Face) bool {
+ return c.FT_HAS_MULTIPLE_MASTERS(self.handle);
+ }
+
+ /// A macro that returns true whenever a face object contains a scalable
+ /// font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF,
+ /// and PFR font formats).
+ pub fn isScalable(self: Face) bool {
+ return c.FT_IS_SCALABLE(self.handle);
+ }
+
+ /// Select a given charmap by its encoding tag (as listed in freetype.h).
+ pub fn selectCharmap(self: Face, encoding: Encoding) Error!void {
+ return intToError(c.FT_Select_Charmap(self.handle, @intCast(@intFromEnum(encoding))));
+ }
+
+ /// Call FT_Request_Size to request the nominal size (in points).
+ pub fn setCharSize(
+ self: Face,
+ char_width: i32,
+ char_height: i32,
+ horz_resolution: u16,
+ vert_resolution: u16,
+ ) Error!void {
+ return intToError(c.FT_Set_Char_Size(
+ self.handle,
+ char_width,
+ char_height,
+ horz_resolution,
+ vert_resolution,
+ ));
+ }
+
+ /// Select a bitmap strike. To be more precise, this function sets the
+ /// scaling factors of the active FT_Size object in a face so that bitmaps
+ /// from this particular strike are taken by FT_Load_Glyph and friends.
+ pub fn selectSize(self: Face, idx: i32) Error!void {
+ return intToError(c.FT_Select_Size(self.handle, idx));
+ }
+
+ /// Return the glyph index of a given character code. This function uses
+ /// the currently selected charmap to do the mapping.
+ pub fn getCharIndex(self: Face, char: u32) ?u32 {
+ const i = c.FT_Get_Char_Index(self.handle, char);
+ return if (i == 0) null else i;
+ }
+
+ /// Load a glyph into the glyph slot of a face object.
+ pub fn loadGlyph(self: Face, glyph_index: u32, load_flags: LoadFlags) Error!void {
+ return intToError(c.FT_Load_Glyph(
+ self.handle,
+ glyph_index,
+ @bitCast(load_flags),
+ ));
+ }
+
+ /// Convert a given glyph image to a bitmap.
+ pub fn renderGlyph(self: Face, render_mode: RenderMode) Error!void {
+ return intToError(c.FT_Render_Glyph(
+ self.handle.*.glyph,
+ @intCast(@intFromEnum(render_mode)),
+ ));
+ }
+
+ /// Return a pointer to a given SFNT table stored within a face.
+ pub fn getSfntTable(self: Face, comptime tag: SfntTag) ?*tag.DataType() {
+ return @ptrCast(@alignCast(c.FT_Get_Sfnt_Table(
+ self.handle,
+ @intFromEnum(tag),
+ )));
+ }
+
+ /// Retrieve the number of name strings in the SFNT ‘name’ table.
+ pub fn getSfntNameCount(self: Face) usize {
+ return @intCast(c.FT_Get_Sfnt_Name_Count(self.handle));
+ }
+
+ /// Retrieve a string of the SFNT ‘name’ table for a given index.
+ pub fn getSfntName(self: Face, i: usize) Error!c.FT_SfntName {
+ var name: c.FT_SfntName = undefined;
+ const res = c.FT_Get_Sfnt_Name(self.handle, @intCast(i), &name);
+ return if (intToError(res)) |_| name else |err| err;
+ }
+
+ /// Load any SFNT font table into client memory.
+ pub fn loadSfntTable(
+ self: Face,
+ alloc: Allocator,
+ tag: Tag,
+ ) (Allocator.Error || Error)!?[]u8 {
+ const tag_c: c_ulong = @intCast(@as(u32, @bitCast(tag)));
+
+ // Get the length of the table in bytes
+ var len: c_ulong = 0;
+ var res = c.FT_Load_Sfnt_Table(self.handle, tag_c, 0, null, &len);
+ _ = intToError(res) catch |err| return err;
+
+ // If our length is zero we don't have a table.
+ if (len == 0) return null;
+
+ // Allocate a buffer to hold the table and load it
+ const buf = try alloc.alloc(u8, len);
+ errdefer alloc.free(buf);
+ res = c.FT_Load_Sfnt_Table(self.handle, tag_c, 0, buf.ptr, &len);
+ _ = intToError(res) catch |err| return err;
+
+ return buf;
+ }
+
+ /// Check whether a given SFNT table is available in a face.
+ pub fn hasSfntTable(self: Face, tag: Tag) bool {
+ const tag_c: c_ulong = @intCast(@as(u32, @bitCast(tag)));
+ var len: c_ulong = 0;
+ const res = c.FT_Load_Sfnt_Table(self.handle, tag_c, 0, null, &len);
+ _ = intToError(res) catch return false;
+ return len != 0;
+ }
+
+ /// Retrieve the font variation descriptor for a font.
+ pub fn getMMVar(self: Face) Error!*c.FT_MM_Var {
+ var result: *c.FT_MM_Var = undefined;
+ const res = c.FT_Get_MM_Var(self.handle, @ptrCast(&result));
+ return if (intToError(res)) |_| result else |err| err;
+ }
+
+ /// Get the design coordinates of the currently selected interpolated font.
+ pub fn getVarDesignCoordinates(self: Face, coords: []c.FT_Fixed) Error!void {
+ const res = c.FT_Get_Var_Design_Coordinates(
+ self.handle,
+ @intCast(coords.len),
+ coords.ptr,
+ );
+ return intToError(res);
+ }
+
+ /// Choose an interpolated font design through design coordinates.
+ pub fn setVarDesignCoordinates(self: Face, coords: []c.FT_Fixed) Error!void {
+ const res = c.FT_Set_Var_Design_Coordinates(
+ self.handle,
+ @intCast(coords.len),
+ coords.ptr,
+ );
+ return intToError(res);
+ }
+
+ /// Set the transformation that is applied to glyph images when they are
+ /// loaded into a glyph slot through FT_Load_Glyph.
+ pub fn setTransform(
+ self: Face,
+ matrix: ?*const c.FT_Matrix,
+ delta: ?*const c.FT_Vector,
+ ) void {
+ c.FT_Set_Transform(
+ self.handle,
+ @ptrCast(@constCast(matrix)),
+ @ptrCast(@constCast(delta)),
+ );
+ }
+};
+
+/// An enumeration to specify indices of SFNT tables loaded and parsed by
+/// FreeType during initialization of an SFNT font. Used in the
+/// FT_Get_Sfnt_Table API function.
+pub const SfntTag = enum(c_int) {
+ head = c.FT_SFNT_HEAD,
+ maxp = c.FT_SFNT_MAXP,
+ os2 = c.FT_SFNT_OS2,
+ hhea = c.FT_SFNT_HHEA,
+ vhea = c.FT_SFNT_VHEA,
+ post = c.FT_SFNT_POST,
+ pclt = c.FT_SFNT_PCLT,
+
+ /// The data type for a given sfnt tag.
+ pub fn DataType(comptime self: SfntTag) type {
+ return switch (self) {
+ .os2 => c.TT_OS2,
+ .head => c.TT_Header,
+ .post => c.TT_Postscript,
+ .hhea => c.TT_HoriHeader,
+ else => unreachable, // As-needed...
+ };
+ }
+};
+
+/// An enumeration to specify character sets supported by charmaps. Used in the
+/// FT_Select_Charmap API function.
+pub const Encoding = enum(u31) {
+ none = c.FT_ENCODING_NONE,
+ ms_symbol = c.FT_ENCODING_MS_SYMBOL,
+ unicode = c.FT_ENCODING_UNICODE,
+ sjis = c.FT_ENCODING_SJIS,
+ prc = c.FT_ENCODING_PRC,
+ big5 = c.FT_ENCODING_BIG5,
+ wansung = c.FT_ENCODING_WANSUNG,
+ johab = c.FT_ENCODING_JOHAB,
+ adobe_standard = c.FT_ENCODING_ADOBE_STANDARD,
+ adobe_expert = c.FT_ENCODING_ADOBE_EXPERT,
+ adobe_custom = c.FT_ENCODING_ADOBE_CUSTOM,
+ adobe_latin_1 = c.FT_ENCODING_ADOBE_LATIN_1,
+ old_latin_2 = c.FT_ENCODING_OLD_LATIN_2,
+ apple_roman = c.FT_ENCODING_APPLE_ROMAN,
+};
+
+/// https://freetype.org/freetype2/docs/reference/ft2-glyph_retrieval.html#ft_render_mode
+pub const RenderMode = enum(c_uint) {
+ normal = c.FT_RENDER_MODE_NORMAL,
+ light = c.FT_RENDER_MODE_LIGHT,
+ mono = c.FT_RENDER_MODE_MONO,
+ lcd = c.FT_RENDER_MODE_LCD,
+ lcd_v = c.FT_RENDER_MODE_LCD_V,
+ sdf = c.FT_RENDER_MODE_SDF,
+};
+
+/// A collection of flags for FT_Load_Glyph that indicate
+/// what kind of operations to perform during glyph loading.
+///
+/// Some of these flags are not included in the official FreeType
+/// documentation, but are nevertheless present and named in the
+/// header, so the names have been copied from there.
+pub const LoadFlags = packed struct(c_int) {
+ no_scale: bool = false,
+ no_hinting: bool = false,
+ render: bool = false,
+ no_bitmap: bool = false,
+ vertical_layout: bool = false,
+ force_autohint: bool = false,
+ crop_bitmap: bool = false,
+ pedantic: bool = false,
+ advance_only: bool = false,
+ ignore_global_advance_width: bool = false,
+ no_recurse: bool = false,
+ ignore_transform: bool = false,
+ monochrome: bool = false,
+ linear_design: bool = false,
+ sbits_only: bool = false,
+ no_autohint: bool = false,
+ target: Target = .normal,
+ color: bool = false,
+ compute_metrics: bool = false,
+ bitmap_metrics_only: bool = false,
+ svg_only: bool = false,
+ no_svg: bool = false,
+ _padding: u7 = 0,
+
+ pub const Target = enum(u4) {
+ normal = 0,
+ light = 1,
+ mono = 2,
+ lcd = 3,
+ lcd_v = 4,
+ };
+
+ test "bitcast" {
+ const testing = std.testing;
+
+ const cval: i32 = c.FT_LOAD_RENDER | c.FT_LOAD_PEDANTIC | c.FT_LOAD_COLOR;
+ const flags = @as(LoadFlags, @bitCast(cval));
+ try testing.expect(!flags.no_hinting);
+ try testing.expect(flags.render);
+ try testing.expect(flags.pedantic);
+ try testing.expect(flags.color);
+
+ // Verify bit alignment (for bit 9)
+ const cval2: i32 = c.FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
+ const flags2 = @as(LoadFlags, @bitCast(cval2));
+ try testing.expect(flags2.ignore_global_advance_width);
+ try testing.expect(!flags2.no_recurse);
+ }
+
+ test "all flags individually" {
+ const testing = std.testing;
+
+ try testing.expectEqual(
+ c.FT_LOAD_DEFAULT,
+ @as(c_int, @bitCast(LoadFlags{})),
+ );
+
+ inline for ([_]struct { c_int, []const u8 }{
+ .{ c.FT_LOAD_NO_SCALE, "no_scale" },
+ .{ c.FT_LOAD_NO_HINTING, "no_hinting" },
+ .{ c.FT_LOAD_RENDER, "render" },
+ .{ c.FT_LOAD_NO_BITMAP, "no_bitmap" },
+ .{ c.FT_LOAD_VERTICAL_LAYOUT, "vertical_layout" },
+ .{ c.FT_LOAD_FORCE_AUTOHINT, "force_autohint" },
+ .{ c.FT_LOAD_CROP_BITMAP, "crop_bitmap" },
+ .{ c.FT_LOAD_PEDANTIC, "pedantic" },
+ .{ c.FT_LOAD_ADVANCE_ONLY, "advance_only" },
+ .{ c.FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH, "ignore_global_advance_width" },
+ .{ c.FT_LOAD_NO_RECURSE, "no_recurse" },
+ .{ c.FT_LOAD_IGNORE_TRANSFORM, "ignore_transform" },
+ .{ c.FT_LOAD_MONOCHROME, "monochrome" },
+ .{ c.FT_LOAD_LINEAR_DESIGN, "linear_design" },
+ .{ c.FT_LOAD_SBITS_ONLY, "sbits_only" },
+ .{ c.FT_LOAD_NO_AUTOHINT, "no_autohint" },
+ .{ c.FT_LOAD_COLOR, "color" },
+ .{ c.FT_LOAD_COMPUTE_METRICS, "compute_metrics" },
+ .{ c.FT_LOAD_BITMAP_METRICS_ONLY, "bitmap_metrics_only" },
+ .{ c.FT_LOAD_SVG_ONLY, "svg_only" },
+ .{ c.FT_LOAD_NO_SVG, "no_svg" },
+ }) |pair| {
+ var flags: LoadFlags = .{};
+ @field(flags, pair[1]) = true;
+ try testing.expectEqual(pair[0], @as(c_int, @bitCast(flags)));
+ }
+ }
+
+ test "all load targets" {
+ const testing = std.testing;
+
+ inline for ([_]struct { c_int, Target }{
+ .{ c.FT_LOAD_TARGET_NORMAL, .normal },
+ .{ c.FT_LOAD_TARGET_LIGHT, .light },
+ .{ c.FT_LOAD_TARGET_MONO, .mono },
+ .{ c.FT_LOAD_TARGET_LCD, .lcd },
+ .{ c.FT_LOAD_TARGET_LCD_V, .lcd_v },
+ }) |pair| {
+ const flags: LoadFlags = .{ .target = pair[1] };
+ try testing.expectEqual(pair[0], @as(c_int, @bitCast(flags)));
+ }
+ }
+};
+
+test "loading memory font" {
+ const testing = std.testing;
+ const font_data = @import("test.zig").font_regular;
+
+ var lib = try Library.init();
+ defer lib.deinit();
+ var face = try lib.initMemoryFace(font_data, 0);
+ defer face.deinit();
+
+ // Try APIs
+ try face.selectCharmap(.unicode);
+ try testing.expect(!face.hasFixedSizes());
+ try face.setCharSize(12, 0, 0, 0);
+
+ // Try loading
+ const idx = face.getCharIndex('A').?;
+ try face.loadGlyph(idx, .{});
+
+ // Try getting a truetype table
+ const os2 = face.getSfntTable(.os2);
+ try testing.expect(os2 != null);
+}
diff --git a/vendor/libghostty-vt/pkg/freetype/freetype-zig.h b/vendor/libghostty-vt/pkg/freetype/freetype-zig.h
new file mode 100644
index 00000000..dcc65e51
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/freetype-zig.h
@@ -0,0 +1,9 @@
+#include
+#include FT_FREETYPE_H
+#include FT_TRUETYPE_TABLES_H
+#include
+#include
+#include
+#include
+#include
+#include
diff --git a/vendor/libghostty-vt/pkg/freetype/main.zig b/vendor/libghostty-vt/pkg/freetype/main.zig
new file mode 100644
index 00000000..6ec81818
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/main.zig
@@ -0,0 +1,18 @@
+const computations = @import("computations.zig");
+const errors = @import("errors.zig");
+const face = @import("face.zig");
+const tag = @import("tag.zig");
+
+pub const c = @import("c.zig").c;
+pub const testing = @import("test.zig");
+pub const Library = @import("Library.zig");
+
+pub const Error = errors.Error;
+pub const Face = face.Face;
+pub const LoadFlags = face.LoadFlags;
+pub const Tag = tag.Tag;
+pub const mulFix = computations.mulFix;
+
+test {
+ @import("std").testing.refAllDecls(@This());
+}
diff --git a/vendor/libghostty-vt/pkg/freetype/res/FiraCode-Regular.ttf b/vendor/libghostty-vt/pkg/freetype/res/FiraCode-Regular.ttf
new file mode 100755
index 00000000..bd736851
Binary files /dev/null and b/vendor/libghostty-vt/pkg/freetype/res/FiraCode-Regular.ttf differ
diff --git a/vendor/libghostty-vt/pkg/freetype/tag.zig b/vendor/libghostty-vt/pkg/freetype/tag.zig
new file mode 100644
index 00000000..32dab2a0
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/tag.zig
@@ -0,0 +1,17 @@
+/// FT_Tag
+pub const Tag = packed struct(u32) {
+ d: u8,
+ c: u8,
+ b: u8,
+ a: u8,
+
+ pub fn init(v: *const [4]u8) Tag {
+ return .{ .a = v[0], .b = v[1], .c = v[2], .d = v[3] };
+ }
+
+ /// Converts the ID to a string. The return value is only valid
+ /// for the lifetime of the self pointer.
+ pub fn str(self: Tag) [4]u8 {
+ return .{ self.a, self.b, self.c, self.d };
+ }
+};
diff --git a/vendor/libghostty-vt/pkg/freetype/test.zig b/vendor/libghostty-vt/pkg/freetype/test.zig
new file mode 100644
index 00000000..866c6f2a
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/freetype/test.zig
@@ -0,0 +1 @@
+pub const font_regular = @embedFile("res/FiraCode-Regular.ttf");
diff --git a/vendor/libghostty-vt/pkg/glslang/build.zig b/vendor/libghostty-vt/pkg/glslang/build.zig
new file mode 100644
index 00000000..1dc82a6e
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/build.zig
@@ -0,0 +1,169 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const module = b.addModule("glslang", .{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ });
+
+ const upstream = b.lazyDependency("glslang", .{});
+ const lib = try buildGlslang(b, upstream, target, optimize);
+ b.installArtifact(lib);
+
+ if (upstream) |v| module.addIncludePath(v.path(""));
+ module.addIncludePath(b.path("override"));
+
+ if (target.query.isNative()) {
+ const test_exe = b.addTest(.{
+ .name = "test",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ test_exe.linkLibrary(lib);
+ const tests_run = b.addRunArtifact(test_exe);
+ const test_step = b.step("test", "Run tests");
+ test_step.dependOn(&tests_run.step);
+
+ // Uncomment this if we're debugging tests
+ // b.installArtifact(test_exe);
+ }
+}
+
+fn buildGlslang(
+ b: *std.Build,
+ upstream_: ?*std.Build.Dependency,
+ target: std.Build.ResolvedTarget,
+ optimize: std.builtin.OptimizeMode,
+) !*std.Build.Step.Compile {
+ const lib = b.addLibrary(.{
+ .name = "glslang",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ // On MSVC, we must not use linkLibCpp because Zig unconditionally
+ // passes -nostdinc++ and then adds its bundled libc++/libc++abi
+ // include paths, which conflict with MSVC's own C++ runtime headers.
+ // The MSVC SDK include directories (added via linkLibC) contain
+ // both C and C++ headers, so linkLibCpp is not needed.
+ if (target.result.abi != .msvc) {
+ lib.linkLibCpp();
+ }
+ if (upstream_) |upstream| lib.addIncludePath(upstream.path(""));
+ lib.addIncludePath(b.path("override"));
+ if (target.result.os.tag.isDarwin()) {
+ const apple_sdk = @import("apple_sdk");
+ try apple_sdk.addPaths(b, lib);
+ }
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ "-fno-sanitize=undefined",
+ "-fno-sanitize-trap=undefined",
+ });
+ // MSVC requires explicit std specification otherwise C++17 features
+ // like std::variant, std::filesystem, and inline variables are
+ // guarded behind _HAS_CXX17.
+ try flags.append(b.allocator, "-std=c++17");
+
+ if (target.result.os.tag == .freebsd or target.result.abi == .musl) {
+ try flags.append(b.allocator, "-fPIC");
+ }
+
+ if (upstream_) |upstream| {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .flags = flags.items,
+ .files = &.{
+ // GenericCodeGen
+ "glslang/GenericCodeGen/CodeGen.cpp",
+ "glslang/GenericCodeGen/Link.cpp",
+
+ // MachineIndependent
+ //"MachineIndependent/glslang.y",
+ "glslang/MachineIndependent/glslang_tab.cpp",
+ "glslang/MachineIndependent/attribute.cpp",
+ "glslang/MachineIndependent/Constant.cpp",
+ "glslang/MachineIndependent/iomapper.cpp",
+ "glslang/MachineIndependent/InfoSink.cpp",
+ "glslang/MachineIndependent/Initialize.cpp",
+ "glslang/MachineIndependent/IntermTraverse.cpp",
+ "glslang/MachineIndependent/Intermediate.cpp",
+ "glslang/MachineIndependent/ParseContextBase.cpp",
+ "glslang/MachineIndependent/ParseHelper.cpp",
+ "glslang/MachineIndependent/PoolAlloc.cpp",
+ "glslang/MachineIndependent/RemoveTree.cpp",
+ "glslang/MachineIndependent/Scan.cpp",
+ "glslang/MachineIndependent/ShaderLang.cpp",
+ "glslang/MachineIndependent/SpirvIntrinsics.cpp",
+ "glslang/MachineIndependent/SymbolTable.cpp",
+ "glslang/MachineIndependent/Versions.cpp",
+ "glslang/MachineIndependent/intermOut.cpp",
+ "glslang/MachineIndependent/limits.cpp",
+ "glslang/MachineIndependent/linkValidate.cpp",
+ "glslang/MachineIndependent/parseConst.cpp",
+ "glslang/MachineIndependent/reflection.cpp",
+ "glslang/MachineIndependent/preprocessor/Pp.cpp",
+ "glslang/MachineIndependent/preprocessor/PpAtom.cpp",
+ "glslang/MachineIndependent/preprocessor/PpContext.cpp",
+ "glslang/MachineIndependent/preprocessor/PpScanner.cpp",
+ "glslang/MachineIndependent/preprocessor/PpTokens.cpp",
+ "glslang/MachineIndependent/propagateNoContraction.cpp",
+
+ // C Interface
+ "glslang/CInterface/glslang_c_interface.cpp",
+
+ // ResourceLimits
+ "glslang/ResourceLimits/ResourceLimits.cpp",
+ "glslang/ResourceLimits/resource_limits_c.cpp",
+
+ // SPIRV
+ "SPIRV/GlslangToSpv.cpp",
+ "SPIRV/InReadableOrder.cpp",
+ "SPIRV/Logger.cpp",
+ "SPIRV/SpvBuilder.cpp",
+ "SPIRV/SpvPostProcess.cpp",
+ "SPIRV/doc.cpp",
+ "SPIRV/disassemble.cpp",
+ "SPIRV/CInterface/spirv_c_interface.cpp",
+ },
+ });
+
+ if (target.result.os.tag != .windows) {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .flags = flags.items,
+ .files = &.{
+ "glslang/OSDependent/Unix/ossource.cpp",
+ },
+ });
+ } else {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .flags = flags.items,
+ .files = &.{
+ "glslang/OSDependent/Windows/ossource.cpp",
+ },
+ });
+ }
+
+ lib.installHeadersDirectory(
+ upstream.path(""),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ return lib;
+}
diff --git a/vendor/libghostty-vt/pkg/glslang/build.zig.zon b/vendor/libghostty-vt/pkg/glslang/build.zig.zon
new file mode 100644
index 00000000..252237e5
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/build.zig.zon
@@ -0,0 +1,16 @@
+.{
+ .name = .glslang,
+ .version = "14.2.0",
+ .fingerprint = 0x274a35558e2e504,
+ .paths = .{""},
+ .dependencies = .{
+ // KhronosGroup/glslang
+ .glslang = .{
+ .url = "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz",
+ .hash = "N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy",
+ .lazy = true,
+ },
+
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/glslang/c.zig b/vendor/libghostty-vt/pkg/glslang/c.zig
new file mode 100644
index 00000000..c0010846
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/c.zig
@@ -0,0 +1,4 @@
+pub const c = @cImport({
+ @cInclude("glslang/Include/glslang_c_interface.h");
+ @cInclude("glslang/Public/resource_limits_c.h");
+});
diff --git a/vendor/libghostty-vt/pkg/glslang/init.zig b/vendor/libghostty-vt/pkg/glslang/init.zig
new file mode 100644
index 00000000..a865e9e7
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/init.zig
@@ -0,0 +1,9 @@
+const c = @import("c.zig").c;
+
+pub fn init() !void {
+ if (c.glslang_initialize_process() == 0) return error.GlslangInitFailed;
+}
+
+pub fn finalize() void {
+ c.glslang_finalize_process();
+}
diff --git a/vendor/libghostty-vt/pkg/glslang/main.zig b/vendor/libghostty-vt/pkg/glslang/main.zig
new file mode 100644
index 00000000..2743650c
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/main.zig
@@ -0,0 +1,15 @@
+const initpkg = @import("init.zig");
+const program = @import("program.zig");
+const shader = @import("shader.zig");
+
+pub const c = @import("c.zig").c;
+pub const testing = @import("test.zig");
+
+pub const init = initpkg.init;
+pub const finalize = initpkg.finalize;
+pub const Program = program.Program;
+pub const Shader = shader.Shader;
+
+test {
+ @import("std").testing.refAllDecls(@This());
+}
diff --git a/vendor/libghostty-vt/pkg/glslang/override/glslang/build_info.h b/vendor/libghostty-vt/pkg/glslang/override/glslang/build_info.h
new file mode 100644
index 00000000..c25117ee
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/override/glslang/build_info.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2020 The Khronos Group Inc.
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+//
+// Neither the name of The Khronos Group Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef GLSLANG_BUILD_INFO
+#define GLSLANG_BUILD_INFO
+
+#define GLSLANG_VERSION_MAJOR 13
+#define GLSLANG_VERSION_MINOR 1
+#define GLSLANG_VERSION_PATCH 1
+#define GLSLANG_VERSION_FLAVOR ""
+
+#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \
+ ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH) > (patch)))))
+
+#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \
+ ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH >= (patch))))))
+
+#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \
+ ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH) < (patch)))))
+
+#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \
+ ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH <= (patch))))))
+
+#endif // GLSLANG_BUILD_INFO
diff --git a/vendor/libghostty-vt/pkg/glslang/program.zig b/vendor/libghostty-vt/pkg/glslang/program.zig
new file mode 100644
index 00000000..4af687cc
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/program.zig
@@ -0,0 +1,60 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const testlib = @import("test.zig");
+const Shader = @import("shader.zig").Shader;
+
+pub const Program = opaque {
+ pub fn create() !*Program {
+ if (c.glslang_program_create()) |ptr| return @ptrCast(ptr);
+ return error.OutOfMemory;
+ }
+
+ pub fn delete(self: *Program) void {
+ c.glslang_program_delete(@ptrCast(self));
+ }
+
+ pub fn addShader(self: *Program, shader: *Shader) void {
+ c.glslang_program_add_shader(@ptrCast(self), @ptrCast(shader));
+ }
+
+ pub fn link(self: *Program, messages: c_int) !void {
+ if (c.glslang_program_link(@ptrCast(self), messages) != 0) return;
+ return error.GlslangFailed;
+ }
+
+ pub fn spirvGenerate(self: *Program, stage: c.glslang_stage_t) void {
+ c.glslang_program_SPIRV_generate(@ptrCast(self), stage);
+ }
+
+ pub fn spirvGetSize(self: *Program) usize {
+ return @intCast(c.glslang_program_SPIRV_get_size(@ptrCast(self)));
+ }
+
+ pub fn spirvGet(self: *Program, buf: []u32) void {
+ c.glslang_program_SPIRV_get(@ptrCast(self), buf.ptr);
+ }
+
+ pub fn spirvGetPtr(self: *Program) ![*]u32 {
+ return @ptrCast(c.glslang_program_SPIRV_get_ptr(@ptrCast(self)));
+ }
+
+ pub fn spirvGetMessages(self: *Program) ![:0]const u8 {
+ const ptr = c.glslang_program_SPIRV_get_messages(@ptrCast(self));
+ return std.mem.sliceTo(ptr, 0);
+ }
+
+ pub fn getInfoLog(self: *Program) ![:0]const u8 {
+ const ptr = c.glslang_program_get_info_log(@ptrCast(self));
+ return std.mem.sliceTo(ptr, 0);
+ }
+
+ pub fn getDebugInfoLog(self: *Program) ![:0]const u8 {
+ const ptr = c.glslang_program_get_info_debug_log(@ptrCast(self));
+ return std.mem.sliceTo(ptr, 0);
+ }
+};
+
+test {
+ var program = try Program.create();
+ defer program.delete();
+}
diff --git a/vendor/libghostty-vt/pkg/glslang/shader.zig b/vendor/libghostty-vt/pkg/glslang/shader.zig
new file mode 100644
index 00000000..36a09f34
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/shader.zig
@@ -0,0 +1,58 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const testlib = @import("test.zig");
+
+pub const Shader = opaque {
+ pub fn create(input: *const c.glslang_input_t) !*Shader {
+ if (c.glslang_shader_create(input)) |ptr| return @ptrCast(ptr);
+ return error.OutOfMemory;
+ }
+
+ pub fn delete(self: *Shader) void {
+ c.glslang_shader_delete(@ptrCast(self));
+ }
+
+ pub fn preprocess(self: *Shader, input: *const c.glslang_input_t) !void {
+ if (c.glslang_shader_preprocess(@ptrCast(self), input) == 0)
+ return error.GlslangFailed;
+ }
+
+ pub fn parse(self: *Shader, input: *const c.glslang_input_t) !void {
+ if (c.glslang_shader_parse(@ptrCast(self), input) == 0)
+ return error.GlslangFailed;
+ }
+
+ pub fn getInfoLog(self: *Shader) ![:0]const u8 {
+ const ptr = c.glslang_shader_get_info_log(@ptrCast(self));
+ return std.mem.sliceTo(ptr, 0);
+ }
+
+ pub fn getDebugInfoLog(self: *Shader) ![:0]const u8 {
+ const ptr = c.glslang_shader_get_info_debug_log(@ptrCast(self));
+ return std.mem.sliceTo(ptr, 0);
+ }
+};
+
+test {
+ const input: c.glslang_input_t = .{
+ .language = c.GLSLANG_SOURCE_GLSL,
+ .stage = c.GLSLANG_STAGE_FRAGMENT,
+ .client = c.GLSLANG_CLIENT_VULKAN,
+ .client_version = c.GLSLANG_TARGET_VULKAN_1_2,
+ .target_language = c.GLSLANG_TARGET_SPV,
+ .target_language_version = c.GLSLANG_TARGET_SPV_1_5,
+ .code = @embedFile("test/simple.frag"),
+ .default_version = 100,
+ .default_profile = c.GLSLANG_NO_PROFILE,
+ .force_default_version_and_profile = 0,
+ .forward_compatible = 0,
+ .messages = c.GLSLANG_MSG_DEFAULT_BIT,
+ .resource = c.glslang_default_resource(),
+ };
+
+ try testlib.ensureInit();
+ const shader = try Shader.create(&input);
+ defer shader.delete();
+ try shader.preprocess(&input);
+ try shader.parse(&input);
+}
diff --git a/vendor/libghostty-vt/pkg/glslang/test.zig b/vendor/libghostty-vt/pkg/glslang/test.zig
new file mode 100644
index 00000000..8cdf98f7
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/test.zig
@@ -0,0 +1,10 @@
+const glslang = @import("main.zig");
+
+var initialized: bool = false;
+
+/// Call this function before any other tests in this package to ensure that
+/// the glslang library is initialized.
+pub fn ensureInit() !void {
+ if (initialized) return;
+ try glslang.init();
+}
diff --git a/vendor/libghostty-vt/pkg/glslang/test/simple.frag b/vendor/libghostty-vt/pkg/glslang/test/simple.frag
new file mode 100644
index 00000000..c1cd903c
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/glslang/test/simple.frag
@@ -0,0 +1,56 @@
+#version 430 core
+
+layout(binding = 0) uniform Globals {
+ uniform vec3 iResolution;
+ uniform float iTime;
+ uniform float iTimeDelta;
+ uniform float iFrameRate;
+ uniform int iFrame;
+ uniform float iChannelTime[4];
+ uniform vec3 iChannelResolution[4];
+ uniform vec4 iMouse;
+ uniform vec4 iDate;
+ uniform float iSampleRate;
+};
+
+layout(binding = 0) uniform sampler2D iChannel0;
+layout(binding = 1) uniform sampler2D iChannel1;
+layout(binding = 2) uniform sampler2D iChannel2;
+layout(binding = 3) uniform sampler2D iChannel3;
+
+layout(location = 0) in vec4 gl_FragCoord;
+layout(location = 0) out vec4 _fragColor;
+
+#define texture2D texture
+
+void mainImage( out vec4 fragColor, in vec2 fragCoord );
+void main() { mainImage (_fragColor, gl_FragCoord.xy); }
+
+#define t iTime
+
+void mainImage( out vec4 fragColor, in vec2 fragCoord )
+{
+ // Normalized pixel coordinates (from 0 to 1)
+ vec2 uv = ( fragCoord - .5*iResolution.xy) / iResolution.y;
+ vec3 col = vec3(0.);
+ float a = atan(uv.y,uv.x);
+ float r = 0.5*length(uv);
+ float counter = 100.;
+ a = 4.*a+20.*r+50.*cos(r)*cos(.1*t)+abs(a*r);
+ float f = 0.02*abs(cos(a))/(r*r);
+
+
+ vec2 v = vec2(0.);
+ for(float i=0.;i2.){
+ counter = i;
+ break;
+ }
+ }
+
+ col=vec3(min(0.9,1.2*exp(-pow(f,0.45)*counter)));
+
+ fragColor = min(0.9,1.2*exp(-pow(f,0.45)*counter) )
+ * ( 0.7 + 0.3* cos(10.*r - 2.*t -vec4(.7,1.4,2.1,0) ) );
+}
diff --git a/vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig b/vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig
new file mode 100644
index 00000000..818b48f4
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig
@@ -0,0 +1,127 @@
+const std = @import("std");
+
+const version = @import("build.zig.zon").version;
+
+const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{
+ .preferred_link_mode = .dynamic,
+ .search_strategy = .mode_first,
+};
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ // Zig API
+ const module = b.addModule("gtk4-layer-shell", .{
+ .root_source_file = b.path("src/main.zig"),
+ .target = target,
+ .optimize = optimize,
+ });
+ // Needs the gtk.h header
+ module.linkSystemLibrary("gtk4", dynamic_link_opts);
+
+ if (b.systemIntegrationOption("gtk4-layer-shell", .{})) {
+ module.linkSystemLibrary("gtk4-layer-shell-0", dynamic_link_opts);
+ } else {
+ _ = try buildLib(b, module, .{
+ .target = target,
+ .optimize = optimize,
+ });
+ }
+}
+
+fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Build.Step.Compile {
+ const lib_version = try std.SemanticVersion.parse(version);
+ const target = options.target;
+ const optimize = options.optimize;
+
+ // Shared library
+ const lib = b.addLibrary(.{
+ .name = "gtk4-layer-shell",
+ .linkage = .dynamic,
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ b.installArtifact(lib);
+
+ // We need to call both lazy dependencies to tell Zig we need both
+ const upstream_ = b.lazyDependency("gtk4_layer_shell", .{});
+ const wayland_protocols_ = b.lazyDependency("wayland_protocols", .{});
+ const upstream = upstream_ orelse return lib;
+ const wayland_protocols = wayland_protocols_ orelse return lib;
+
+ lib.linkLibC();
+ lib.addIncludePath(upstream.path("include"));
+ lib.addIncludePath(upstream.path("src"));
+ module.addIncludePath(upstream.path("include"));
+
+ // GTK
+ lib.linkSystemLibrary2("gtk4", dynamic_link_opts);
+
+ // Wayland headers and source files
+ {
+ const protocols = [_]struct { []const u8, std.Build.LazyPath }{
+ .{
+ "wlr-layer-shell-unstable-v1",
+ upstream.path("protocol/wlr-layer-shell-unstable-v1.xml"),
+ },
+ .{
+ "xdg-shell",
+ wayland_protocols.path("stable/xdg-shell/xdg-shell.xml"),
+ },
+ // Even though we don't use session lock, we still need its headers
+ .{
+ "ext-session-lock-v1",
+ wayland_protocols.path("staging/ext-session-lock/ext-session-lock-v1.xml"),
+ },
+ };
+
+ const wf = b.addWriteFiles();
+ for (protocols) |protocol| {
+ const name, const xml = protocol;
+
+ const header_scanner = b.addSystemCommand(&.{ "wayland-scanner", "client-header" });
+ header_scanner.addFileArg(xml);
+ _ = wf.addCopyFile(
+ header_scanner.addOutputFileArg(name),
+ b.fmt("{s}-client.h", .{name}),
+ );
+
+ const source_scanner = b.addSystemCommand(&.{ "wayland-scanner", "private-code" });
+ source_scanner.addFileArg(xml);
+ const source = source_scanner.addOutputFileArg(b.fmt("{s}.c", .{name}));
+ lib.addCSourceFile(.{ .file = source });
+ }
+ lib.addIncludePath(wf.getDirectory());
+ }
+
+ lib.installHeadersDirectory(
+ upstream.path("include"),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+
+ // Certain files relating to session lock were removed as we don't use them
+ const srcs: []const []const u8 = &.{
+ "gtk4-layer-shell.c",
+ "layer-surface.c",
+ "libwayland-shim.c",
+ "registry.c",
+ "stolen-from-libwayland.c",
+ "stubbed-surface.c",
+ "xdg-surface-server.c",
+ };
+ lib.addCSourceFiles(.{
+ .root = upstream.path("src"),
+ .files = srcs,
+ .flags = &.{
+ b.fmt("-DGTK_LAYER_SHELL_MAJOR={}", .{lib_version.major}),
+ b.fmt("-DGTK_LAYER_SHELL_MINOR={}", .{lib_version.minor}),
+ b.fmt("-DGTK_LAYER_SHELL_MICRO={}", .{lib_version.patch}),
+ },
+ });
+
+ return lib;
+}
diff --git a/vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig.zon b/vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig.zon
new file mode 100644
index 00000000..9329e374
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/gtk4-layer-shell/build.zig.zon
@@ -0,0 +1,18 @@
+.{
+ .name = .gtk4_layer_shell,
+ .version = "1.1.0",
+ .fingerprint = 0x4b96f9483c6feeb1,
+ .paths = .{""},
+ .dependencies = .{
+ .gtk4_layer_shell = .{
+ .url = "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz",
+ .hash = "N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr",
+ .lazy = true,
+ },
+ .wayland_protocols = .{
+ .url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz",
+ .hash = "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S",
+ .lazy = true,
+ },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/gtk4-layer-shell/src/main.zig b/vendor/libghostty-vt/pkg/gtk4-layer-shell/src/main.zig
new file mode 100644
index 00000000..a1531323
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/gtk4-layer-shell/src/main.zig
@@ -0,0 +1,71 @@
+const std = @import("std");
+
+const c = @cImport({
+ @cInclude("gtk4-layer-shell.h");
+});
+const gdk = @import("gdk");
+const gtk = @import("gtk");
+
+pub const ShellLayer = enum(c_uint) {
+ background = c.GTK_LAYER_SHELL_LAYER_BACKGROUND,
+ bottom = c.GTK_LAYER_SHELL_LAYER_BOTTOM,
+ top = c.GTK_LAYER_SHELL_LAYER_TOP,
+ overlay = c.GTK_LAYER_SHELL_LAYER_OVERLAY,
+};
+
+pub const ShellEdge = enum(c_uint) {
+ left = c.GTK_LAYER_SHELL_EDGE_LEFT,
+ right = c.GTK_LAYER_SHELL_EDGE_RIGHT,
+ top = c.GTK_LAYER_SHELL_EDGE_TOP,
+ bottom = c.GTK_LAYER_SHELL_EDGE_BOTTOM,
+};
+
+pub const KeyboardMode = enum(c_uint) {
+ none = c.GTK_LAYER_SHELL_KEYBOARD_MODE_NONE,
+ exclusive = c.GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE,
+ on_demand = c.GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND,
+};
+
+pub fn isSupported() bool {
+ return c.gtk_layer_is_supported() != 0;
+}
+
+pub fn getProtocolVersion() c_uint {
+ return c.gtk_layer_get_protocol_version();
+}
+
+pub fn getLibraryVersion() std.SemanticVersion {
+ return .{
+ .major = c.gtk_layer_get_major_version(),
+ .minor = c.gtk_layer_get_minor_version(),
+ .patch = c.gtk_layer_get_micro_version(),
+ };
+}
+
+pub fn initForWindow(window: *gtk.Window) void {
+ c.gtk_layer_init_for_window(@ptrCast(window));
+}
+
+pub fn setLayer(window: *gtk.Window, layer: ShellLayer) void {
+ c.gtk_layer_set_layer(@ptrCast(window), @intFromEnum(layer));
+}
+
+pub fn setAnchor(window: *gtk.Window, edge: ShellEdge, anchor_to_edge: bool) void {
+ c.gtk_layer_set_anchor(@ptrCast(window), @intFromEnum(edge), @intFromBool(anchor_to_edge));
+}
+
+pub fn setMargin(window: *gtk.Window, edge: ShellEdge, margin_size: c_int) void {
+ c.gtk_layer_set_margin(@ptrCast(window), @intFromEnum(edge), margin_size);
+}
+
+pub fn setKeyboardMode(window: *gtk.Window, mode: KeyboardMode) void {
+ c.gtk_layer_set_keyboard_mode(@ptrCast(window), @intFromEnum(mode));
+}
+
+pub fn setMonitor(window: *gtk.Window, monitor: ?*gdk.Monitor) void {
+ c.gtk_layer_set_monitor(@ptrCast(window), @ptrCast(monitor));
+}
+
+pub fn setNamespace(window: *gtk.Window, name: [:0]const u8) void {
+ c.gtk_layer_set_namespace(@ptrCast(window), name.ptr);
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/blob.zig b/vendor/libghostty-vt/pkg/harfbuzz/blob.zig
new file mode 100644
index 00000000..9472e4c7
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/blob.zig
@@ -0,0 +1,126 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const Error = @import("errors.zig").Error;
+
+/// Data type holding the memory modes available to client programs.
+///
+/// Regarding these various memory-modes:
+///
+/// - In no case shall the HarfBuzz client modify memory that is passed to
+/// HarfBuzz in a blob. If there is any such possibility,
+/// HB_MEMORY_MODE_DUPLICATE should be used such that HarfBuzz makes a
+/// copy immediately,
+///
+/// - Use HB_MEMORY_MODE_READONLY otherwise, unless you really really really
+/// know what you are doing,
+///
+/// - HB_MEMORY_MODE_WRITABLE is appropriate if you really made a copy of
+/// data solely for the purpose of passing to HarfBuzz and doing that
+/// just once (no reuse!),
+///
+/// - If the font is mmap()ed, it's okay to use
+/// HB_MEMORY_READONLY_MAY_MAKE_WRITABLE , however, using that mode
+/// correctly is very tricky. Use HB_MEMORY_MODE_READONLY instead.
+pub const MemoryMode = enum(u2) {
+ /// HarfBuzz immediately makes a copy of the data.
+ duplicate = c.HB_MEMORY_MODE_DUPLICATE,
+
+ /// HarfBuzz client will never modify the data, and HarfBuzz will never
+ /// modify the data.
+ readonly = c.HB_MEMORY_MODE_READONLY,
+
+ /// HarfBuzz client made a copy of the data solely for HarfBuzz, so
+ /// HarfBuzz may modify the data.
+ writable = c.HB_MEMORY_MODE_WRITABLE,
+
+ /// See above
+ readonly_may_make_writable = c.HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE,
+};
+
+/// Blobs wrap a chunk of binary data to handle lifecycle management of data
+/// while it is passed between client and HarfBuzz. Blobs are primarily
+/// used to create font faces, but also to access font face tables, as well as
+/// pass around other binary data.
+pub const Blob = struct {
+ handle: *c.hb_blob_t,
+
+ /// Creates a new "blob" object wrapping data . The mode parameter is used
+ /// to negotiate ownership and lifecycle of data .
+ ///
+ /// Note that this function returns a freshly-allocated empty blob even
+ /// if length is zero. This is in contrast to hb_blob_create(), which
+ /// returns the singleton empty blob (as returned by hb_blob_get_empty())
+ /// if length is zero.
+ pub fn create(data: []const u8, mode: MemoryMode) Error!Blob {
+ const handle = c.hb_blob_create_or_fail(
+ data.ptr,
+ @intCast(data.len),
+ @intFromEnum(mode),
+ null,
+ null,
+ ) orelse return Error.HarfbuzzFailed;
+
+ return Blob{ .handle = handle };
+ }
+
+ /// Decreases the reference count on blob , and if it reaches zero,
+ /// destroys blob , freeing all memory, possibly calling the
+ /// destroy-callback the blob was created for if it has not been
+ /// called already.
+ pub fn destroy(self: *Blob) void {
+ c.hb_blob_destroy(self.handle);
+ }
+
+ /// Attaches a user-data key/data pair to the specified blob.
+ pub fn setUserData(
+ self: Blob,
+ comptime T: type,
+ key: ?*anyopaque,
+ ptr: ?*T,
+ comptime destroycb: ?*const fn (?*T) callconv(.c) void,
+ replace: bool,
+ ) bool {
+ const Callback = struct {
+ pub fn callback(data: ?*anyopaque) callconv(.c) void {
+ @call(.{ .modifier = .always_inline }, destroycb, .{
+ @as(?*T, @ptrCast(@alignCast(data))),
+ });
+ }
+ };
+
+ return c.hb_blob_set_user_data(
+ self.handle,
+ @ptrCast(key),
+ ptr,
+ if (destroycb != null) Callback.callback else null,
+ if (replace) 1 else 0,
+ ) > 0;
+ }
+
+ /// Fetches the user data associated with the specified key, attached to
+ /// the specified font-functions structure.
+ pub fn getUserData(
+ self: Blob,
+ comptime T: type,
+ key: ?*anyopaque,
+ ) ?*T {
+ const opt = c.hb_blob_get_user_data(self.handle, @ptrCast(key));
+ if (opt) |ptr|
+ return @ptrCast(@alignCast(ptr))
+ else
+ return null;
+ }
+};
+
+test {
+ const testing = std.testing;
+
+ const data = "hello";
+ var blob = try Blob.create(data, .readonly);
+ defer blob.destroy();
+
+ var userdata: u8 = 127;
+ var key: u8 = 0;
+ try testing.expect(blob.setUserData(u8, &key, &userdata, null, false));
+ try testing.expect(blob.getUserData(u8, &key).?.* == 127);
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/buffer.zig b/vendor/libghostty-vt/pkg/harfbuzz/buffer.zig
new file mode 100644
index 00000000..b97c1bef
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/buffer.zig
@@ -0,0 +1,373 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const common = @import("common.zig");
+const Error = @import("errors.zig").Error;
+const Direction = common.Direction;
+const Script = common.Script;
+const Language = common.Language;
+
+/// Buffers serve a dual role in HarfBuzz; before shaping, they hold the
+/// input characters that are passed to hb_shape(), and after shaping they
+/// hold the output glyphs.
+pub const Buffer = struct {
+ handle: *c.hb_buffer_t,
+
+ /// Creates a new hb_buffer_t with all properties to defaults.
+ pub fn create() Error!Buffer {
+ const handle = c.hb_buffer_create() orelse return Error.HarfbuzzFailed;
+ return Buffer{ .handle = handle };
+ }
+
+ /// Deallocate the buffer . Decreases the reference count on buffer by one.
+ /// If the result is zero, then buffer and all associated resources are
+ /// freed. See hb_buffer_reference().
+ pub fn destroy(self: *Buffer) void {
+ c.hb_buffer_destroy(self.handle);
+ }
+
+ /// Resets the buffer to its initial status, as if it was just newly
+ /// created with hb_buffer_create().
+ pub fn reset(self: Buffer) void {
+ c.hb_buffer_reset(self.handle);
+ }
+
+ /// Returns the number of items in the buffer.
+ pub fn getLength(self: Buffer) u32 {
+ return c.hb_buffer_get_length(self.handle);
+ }
+
+ /// Sets the type of buffer contents. Buffers are either empty, contain
+ /// characters (before shaping), or contain glyphs (the result of shaping).
+ pub fn setContentType(self: Buffer, ct: ContentType) void {
+ c.hb_buffer_set_content_type(self.handle, @intFromEnum(ct));
+ }
+
+ /// Fetches the type of buffer contents. Buffers are either empty, contain
+ /// characters (before shaping), or contain glyphs (the result of shaping).
+ pub fn getContentType(self: Buffer) ContentType {
+ return @enumFromInt(c.hb_buffer_get_content_type(self.handle));
+ }
+
+ /// Appends a character with the Unicode value of codepoint to buffer,
+ /// and gives it the initial cluster value of cluster . Clusters can be
+ /// any thing the client wants, they are usually used to refer to the
+ /// index of the character in the input text stream and are output in
+ /// hb_glyph_info_t.cluster field.
+ ///
+ /// This function does not check the validity of codepoint, it is up to
+ /// the caller to ensure it is a valid Unicode code point.
+ pub fn add(self: Buffer, cp: u32, cluster: u32) void {
+ c.hb_buffer_add(self.handle, cp, cluster);
+ }
+
+ /// Appends characters from text array to buffer . The item_offset is the
+ /// position of the first character from text that will be appended, and
+ /// item_length is the number of character. When shaping part of a larger
+ /// text (e.g. a run of text from a paragraph), instead of passing just
+ /// the substring corresponding to the run, it is preferable to pass the
+ /// whole paragraph and specify the run start and length as item_offset and
+ /// item_length , respectively, to give HarfBuzz the full context to be
+ /// able, for example, to do cross-run Arabic shaping or properly handle
+ /// combining marks at stat of run.
+ ///
+ /// This function does not check the validity of text , it is up to the
+ /// caller to ensure it contains a valid Unicode code points.
+ pub fn addCodepoints(self: Buffer, text: []const u32) void {
+ c.hb_buffer_add_codepoints(
+ self.handle,
+ text.ptr,
+ @intCast(text.len),
+ 0,
+ @intCast(text.len),
+ );
+ }
+
+ /// See hb_buffer_add_codepoints().
+ ///
+ /// Replaces invalid UTF-32 characters with the buffer replacement code
+ /// point, see hb_buffer_set_replacement_codepoint().
+ pub fn addUTF32(self: Buffer, text: []const u32) void {
+ c.hb_buffer_add_utf32(
+ self.handle,
+ text.ptr,
+ @intCast(text.len),
+ 0,
+ @intCast(text.len),
+ );
+ }
+
+ /// See hb_buffer_add_codepoints().
+ ///
+ /// Replaces invalid UTF-16 characters with the buffer replacement code
+ /// point, see hb_buffer_set_replacement_codepoint().
+ pub fn addUTF16(self: Buffer, text: []const u16) void {
+ c.hb_buffer_add_utf16(
+ self.handle,
+ text.ptr,
+ @intCast(text.len),
+ 0,
+ @intCast(text.len),
+ );
+ }
+
+ /// See hb_buffer_add_codepoints().
+ ///
+ /// Replaces invalid UTF-8 characters with the buffer replacement code
+ /// point, see hb_buffer_set_replacement_codepoint().
+ pub fn addUTF8(self: Buffer, text: []const u8) void {
+ c.hb_buffer_add_utf8(
+ self.handle,
+ text.ptr,
+ @intCast(text.len),
+ 0,
+ @intCast(text.len),
+ );
+ }
+
+ /// Similar to hb_buffer_add_codepoints(), but allows only access to first
+ /// 256 Unicode code points that can fit in 8-bit strings.
+ pub fn addLatin1(self: Buffer, text: []const u8) void {
+ c.hb_buffer_add_latin1(
+ self.handle,
+ text.ptr,
+ @intCast(text.len),
+ 0,
+ @intCast(text.len),
+ );
+ }
+
+ /// Set the text flow direction of the buffer. No shaping can happen
+ /// without setting buffer direction, and it controls the visual direction
+ /// for the output glyphs; for RTL direction the glyphs will be reversed.
+ /// Many layout features depend on the proper setting of the direction,
+ /// for example, reversing RTL text before shaping, then shaping with LTR
+ /// direction is not the same as keeping the text in logical order and
+ /// shaping with RTL direction.
+ pub fn setDirection(self: Buffer, dir: Direction) void {
+ c.hb_buffer_set_direction(self.handle, @intFromEnum(dir));
+ }
+
+ /// See hb_buffer_set_direction()
+ pub fn getDirection(self: Buffer) Direction {
+ return @enumFromInt(c.hb_buffer_get_direction(self.handle));
+ }
+
+ /// Sets the script of buffer to script.
+ ///
+ /// Script is crucial for choosing the proper shaping behaviour for
+ /// scripts that require it (e.g. Arabic) and the which OpenType features
+ /// defined in the font to be applied.
+ ///
+ /// You can pass one of the predefined hb_script_t values, or use
+ /// hb_script_from_string() or hb_script_from_iso15924_tag() to get the
+ /// corresponding script from an ISO 15924 script tag.
+ pub fn setScript(self: Buffer, script: Script) void {
+ c.hb_buffer_set_script(self.handle, @intFromEnum(script));
+ }
+
+ /// See hb_buffer_set_script()
+ pub fn getScript(self: Buffer) Script {
+ return @enumFromInt(c.hb_buffer_get_script(self.handle));
+ }
+
+ /// Sets the language of buffer to language .
+ ///
+ /// Languages are crucial for selecting which OpenType feature to apply to
+ /// the buffer which can result in applying language-specific behaviour.
+ /// Languages are orthogonal to the scripts, and though they are related,
+ /// they are different concepts and should not be confused with each other.
+ ///
+ /// Use hb_language_from_string() to convert from BCP 47 language tags to
+ /// hb_language_t.
+ pub fn setLanguage(self: Buffer, language: Language) void {
+ c.hb_buffer_set_language(self.handle, language.handle);
+ }
+
+ /// See hb_buffer_set_language()
+ pub fn getLanguage(self: Buffer) Language {
+ return Language{ .handle = c.hb_buffer_get_language(self.handle) };
+ }
+
+ /// Returns buffer glyph information array. Returned pointer is valid as
+ /// long as buffer contents are not modified.
+ pub fn getGlyphInfos(self: Buffer) []GlyphInfo {
+ var length: u32 = 0;
+ const ptr: [*c]GlyphInfo = @ptrCast(c.hb_buffer_get_glyph_infos(self.handle, &length));
+ return ptr[0..length];
+ }
+
+ /// Returns buffer glyph position array. Returned pointer is valid as
+ /// long as buffer contents are not modified.
+ ///
+ /// If buffer did not have positions before, the positions will be
+ /// initialized to zeros, unless this function is called from within a
+ /// buffer message callback (see hb_buffer_set_message_func()), in which
+ /// case NULL is returned.
+ pub fn getGlyphPositions(self: Buffer) ?[]GlyphPosition {
+ var length: u32 = 0;
+
+ if (c.hb_buffer_get_glyph_positions(self.handle, &length)) |positions| {
+ const ptr: [*]GlyphPosition = @ptrCast(positions);
+ return ptr[0..length];
+ }
+
+ return null;
+ }
+
+ /// Sets unset buffer segment properties based on buffer Unicode contents.
+ /// If buffer is not empty, it must have content type
+ /// HB_BUFFER_CONTENT_TYPE_UNICODE.
+ ///
+ /// If buffer script is not set (ie. is HB_SCRIPT_INVALID), it will be set
+ /// to the Unicode script of the first character in the buffer that has a
+ /// script other than HB_SCRIPT_COMMON, HB_SCRIPT_INHERITED, and
+ /// HB_SCRIPT_UNKNOWN.
+ ///
+ /// Next, if buffer direction is not set (ie. is HB_DIRECTION_INVALID), it
+ /// will be set to the natural horizontal direction of the buffer script as
+ /// returned by hb_script_get_horizontal_direction(). If
+ /// hb_script_get_horizontal_direction() returns HB_DIRECTION_INVALID,
+ /// then HB_DIRECTION_LTR is used.
+ ///
+ /// Finally, if buffer language is not set (ie. is HB_LANGUAGE_INVALID), it
+ /// will be set to the process's default language as returned by
+ /// hb_language_get_default(). This may change in the future by taking
+ /// buffer script into consideration when choosing a language. Note that
+ /// hb_language_get_default() is NOT threadsafe the first time it is
+ /// called. See documentation for that function for details.
+ pub fn guessSegmentProperties(self: Buffer) void {
+ c.hb_buffer_guess_segment_properties(self.handle);
+ }
+
+ /// Sets the cluster level of a buffer. The `ClusterLevel` dictates one
+ /// aspect of how HarfBuzz will treat non-base characters during shaping.
+ pub fn setClusterLevel(self: Buffer, level: ClusterLevel) void {
+ c.hb_buffer_set_cluster_level(self.handle, @intFromEnum(level));
+ }
+};
+
+/// The type of hb_buffer_t contents.
+pub const ContentType = enum(u2) {
+ /// Initial value for new buffer.
+ invalid = c.HB_BUFFER_CONTENT_TYPE_INVALID,
+
+ /// The buffer contains input characters (before shaping).
+ unicode = c.HB_BUFFER_CONTENT_TYPE_UNICODE,
+
+ /// The buffer contains output glyphs (after shaping).
+ glyphs = c.HB_BUFFER_CONTENT_TYPE_GLYPHS,
+};
+
+/// Data type for holding HarfBuzz's clustering behavior options. The cluster
+/// level dictates one aspect of how HarfBuzz will treat non-base characters
+/// during shaping.
+pub const ClusterLevel = enum(u2) {
+ /// In `monotone_graphemes`, non-base characters are merged into the
+ /// cluster of the base character that precedes them. There is also cluster
+ /// merging every time the clusters will otherwise become non-monotone.
+ /// This is the default cluster level.
+ monotone_graphemes = c.HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES,
+
+ /// In `monotone_characters`, non-base characters are initially assigned
+ /// their own cluster values, which are not merged into preceding base
+ /// clusters. This allows HarfBuzz to perform additional operations like
+ /// reorder sequences of adjacent marks. The output is still monotone, but
+ /// the cluster values are more granular.
+ monotone_characters = c.HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS,
+
+ /// In `characters`, non-base characters are assigned their own cluster
+ /// values, which are not merged into preceding base clusters. Moreover,
+ /// the cluster values are not merged into monotone order. This is the most
+ /// granular cluster level, and it is useful for clients that need to know
+ /// the exact cluster values of each character, but is harder to use for
+ /// clients, since clusters might appear in any order.
+ characters = c.HB_BUFFER_CLUSTER_LEVEL_CHARACTERS,
+
+ /// In `graphemes`, non-base characters are merged into the cluster of the
+ /// base character that precedes them. This is similar to the Unicode
+ /// Grapheme Cluster algorithm, but it is not exactly the same. The output
+ /// is not forced to be monotone. This is useful for clients that want to
+ /// use HarfBuzz as a cheap implementation of the Unicode Grapheme Cluster
+ /// algorithm.
+ graphemes = c.HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES,
+};
+
+/// The hb_glyph_info_t is the structure that holds information about the
+/// glyphs and their relation to input text.
+pub const GlyphInfo = extern struct {
+ /// either a Unicode code point (before shaping) or a glyph index (after shaping).
+ codepoint: u32,
+ _mask: u32,
+
+ /// the index of the character in the original text that corresponds to
+ /// this hb_glyph_info_t, or whatever the client passes to hb_buffer_add().
+ /// More than one hb_glyph_info_t can have the same cluster value, if they
+ /// resulted from the same character (e.g. one to many glyph substitution),
+ /// and when more than one character gets merged in the same glyph (e.g.
+ /// many to one glyph substitution) the hb_glyph_info_t will have the
+ /// smallest cluster value of them. By default some characters are merged
+ /// into the same cluster (e.g. combining marks have the same cluster as
+ /// their bases) even if they are separate glyphs, hb_buffer_set_cluster_level()
+ /// allow selecting more fine-grained cluster handling.
+ cluster: u32,
+ _var1: u32,
+ _var2: u32,
+};
+
+/// The hb_glyph_position_t is the structure that holds the positions of the
+/// glyph in both horizontal and vertical directions. All positions in
+/// hb_glyph_position_t are relative to the current point.
+pub const GlyphPosition = extern struct {
+ /// how much the line advances after drawing this glyph when setting text
+ /// in horizontal direction.
+ x_advance: i32,
+
+ /// how much the line advances after drawing this glyph when setting text
+ /// in vertical direction.
+ y_advance: i32,
+
+ /// how much the glyph moves on the X-axis before drawing it, this should
+ /// not affect how much the line advances.
+ x_offset: i32,
+
+ /// how much the glyph moves on the Y-axis before drawing it, this should
+ /// not affect how much the line advances.
+ y_offset: i32,
+
+ _var: u32,
+};
+
+test "create" {
+ const testing = std.testing;
+
+ var buffer = try Buffer.create();
+ defer buffer.destroy();
+ buffer.reset();
+
+ // Content type
+ buffer.setContentType(.unicode);
+ try testing.expectEqual(ContentType.unicode, buffer.getContentType());
+
+ // Try add functions
+ buffer.add('🥹', 27);
+ var utf32 = [_]u32{ 'A', 'B', 'C' };
+ var utf16 = [_]u16{ 'A', 'B', 'C' };
+ var utf8 = [_]u8{ 'A', 'B', 'C' };
+ buffer.addCodepoints(&utf32);
+ buffer.addUTF32(&utf32);
+ buffer.addUTF16(&utf16);
+ buffer.addUTF8(&utf8);
+ buffer.addLatin1(&utf8);
+
+ // Guess properties first
+ buffer.guessSegmentProperties();
+
+ // Try to set properties
+ buffer.setDirection(.ltr);
+ try testing.expectEqual(Direction.ltr, buffer.getDirection());
+
+ buffer.setScript(.arabic);
+ try testing.expectEqual(Script.arabic, buffer.getScript());
+
+ buffer.setLanguage(Language.fromString("en"));
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/build.zig b/vendor/libghostty-vt/pkg/harfbuzz/build.zig
new file mode 100644
index 00000000..6d8f3be7
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/build.zig
@@ -0,0 +1,185 @@
+const std = @import("std");
+const apple_sdk = @import("apple_sdk");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const coretext_enabled = b.option(bool, "enable-coretext", "Build coretext") orelse false;
+ const freetype_enabled = b.option(bool, "enable-freetype", "Build freetype") orelse true;
+
+ const freetype = b.dependency("freetype", .{
+ .target = target,
+ .optimize = optimize,
+ .@"enable-libpng" = true,
+ });
+ const macos = b.dependency("macos", .{ .target = target, .optimize = optimize });
+
+ const module = harfbuzz: {
+ const module = b.addModule("harfbuzz", .{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ .imports = &.{
+ .{ .name = "freetype", .module = freetype.module("freetype") },
+ .{ .name = "macos", .module = macos.module("macos") },
+ },
+ });
+
+ const options = b.addOptions();
+ options.addOption(bool, "coretext", coretext_enabled);
+ options.addOption(bool, "freetype", freetype_enabled);
+ module.addOptions("build_options", options);
+ break :harfbuzz module;
+ };
+
+ // For dynamic linking, we prefer dynamic linking and to search by
+ // mode first. Mode first will search all paths for a dynamic library
+ // before falling back to static.
+ const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{
+ .preferred_link_mode = .dynamic,
+ .search_strategy = .mode_first,
+ };
+
+ const test_exe = b.addTest(.{
+ .name = "test",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+
+ {
+ var it = module.import_table.iterator();
+ while (it.next()) |entry| test_exe.root_module.addImport(entry.key_ptr.*, entry.value_ptr.*);
+ if (b.systemIntegrationOption("freetype", .{})) {
+ test_exe.linkSystemLibrary2("freetype2", dynamic_link_opts);
+ } else {
+ test_exe.linkLibrary(freetype.artifact("freetype"));
+ }
+ const tests_run = b.addRunArtifact(test_exe);
+ const test_step = b.step("test", "Run tests");
+ test_step.dependOn(&tests_run.step);
+ }
+
+ if (b.systemIntegrationOption("harfbuzz", .{})) {
+ module.linkSystemLibrary("harfbuzz", dynamic_link_opts);
+ test_exe.linkSystemLibrary2("harfbuzz", dynamic_link_opts);
+ } else {
+ const lib = try buildLib(b, module, .{
+ .target = target,
+ .optimize = optimize,
+
+ .coretext_enabled = coretext_enabled,
+ .freetype_enabled = freetype_enabled,
+
+ .dynamic_link_opts = dynamic_link_opts,
+ });
+
+ test_exe.linkLibrary(lib);
+ }
+}
+
+fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Build.Step.Compile {
+ const target = options.target;
+ const optimize = options.optimize;
+
+ const coretext_enabled = options.coretext_enabled;
+ const freetype_enabled = options.freetype_enabled;
+
+ const freetype = b.dependency("freetype", .{
+ .target = target,
+ .optimize = optimize,
+ .@"enable-libpng" = true,
+ });
+
+ const lib = b.addLibrary(.{
+ .name = "harfbuzz",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ // On MSVC, we must not use linkLibCpp because Zig unconditionally
+ // passes -nostdinc++ and then adds its bundled libc++/libc++abi
+ // include paths, which conflict with MSVC's own C++ runtime headers.
+ // The MSVC SDK include directories (added via linkLibC) contain
+ // both C and C++ headers, so linkLibCpp is not needed.
+ if (target.result.abi != .msvc) {
+ lib.linkLibCpp();
+ }
+
+ if (target.result.os.tag.isDarwin()) {
+ try apple_sdk.addPaths(b, lib);
+ }
+
+ const dynamic_link_opts = options.dynamic_link_opts;
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_STDBOOL_H",
+ });
+ if (target.result.os.tag != .windows) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_UNISTD_H",
+ "-DHAVE_SYS_MMAN_H",
+ "-DHAVE_PTHREAD=1",
+ });
+ }
+
+ // Freetype
+ _ = b.systemIntegrationOption("freetype", .{}); // So it shows up in help
+ if (freetype_enabled) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_FREETYPE=1",
+
+ // Let's just assume a new freetype
+ "-DHAVE_FT_GET_VAR_BLEND_COORDINATES=1",
+ "-DHAVE_FT_SET_VAR_BLEND_COORDINATES=1",
+ "-DHAVE_FT_DONE_MM_VAR=1",
+ "-DHAVE_FT_GET_TRANSFORM=1",
+ });
+
+ if (b.systemIntegrationOption("freetype", .{})) {
+ lib.linkSystemLibrary2("freetype2", dynamic_link_opts);
+ module.linkSystemLibrary("freetype2", dynamic_link_opts);
+ } else {
+ lib.linkLibrary(freetype.artifact("freetype"));
+
+ if (freetype.builder.lazyDependency(
+ "freetype",
+ .{},
+ )) |freetype_dep| {
+ module.addIncludePath(freetype_dep.path("include"));
+ }
+ }
+ }
+
+ if (coretext_enabled) {
+ try flags.appendSlice(b.allocator, &.{"-DHAVE_CORETEXT=1"});
+ lib.linkFramework("CoreText");
+ module.linkFramework("CoreText", .{});
+ }
+
+ if (b.lazyDependency("harfbuzz", .{})) |upstream| {
+ lib.addIncludePath(upstream.path("src"));
+ module.addIncludePath(upstream.path("src"));
+ lib.addCSourceFile(.{
+ .file = upstream.path("src/harfbuzz.cc"),
+ .flags = flags.items,
+ });
+ lib.installHeadersDirectory(
+ upstream.path("src"),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ b.installArtifact(lib);
+
+ return lib;
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/build.zig.zon b/vendor/libghostty-vt/pkg/harfbuzz/build.zig.zon
new file mode 100644
index 00000000..b7d155e9
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/build.zig.zon
@@ -0,0 +1,18 @@
+.{
+ .name = .harfbuzz,
+ .version = "11.0.0",
+ .fingerprint = 0xbd60917cd18865d8,
+ .paths = .{""},
+ .dependencies = .{
+ // harfbuzz/harfbuzz
+ .harfbuzz = .{
+ .url = "https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz",
+ .hash = "N-V-__8AAG02ugUcWec-Ndp-i7JTsJ0dgF8nnJRUInkGLG7G",
+ .lazy = true,
+ },
+
+ .freetype = .{ .path = "../freetype" },
+ .macos = .{ .path = "../macos" },
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/c.zig b/vendor/libghostty-vt/pkg/harfbuzz/c.zig
new file mode 100644
index 00000000..49e87dce
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/c.zig
@@ -0,0 +1,8 @@
+const builtin = @import("builtin");
+const build_options = @import("build_options");
+
+pub const c = @cImport({
+ @cInclude("hb.h");
+ if (build_options.freetype) @cInclude("hb-ft.h");
+ if (build_options.coretext) @cInclude("hb-coretext.h");
+});
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/common.zig b/vendor/libghostty-vt/pkg/harfbuzz/common.zig
new file mode 100644
index 00000000..840ff586
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/common.zig
@@ -0,0 +1,247 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+
+/// The direction of a text segment or buffer.
+///
+/// A segment can also be tested for horizontal or vertical orientation
+/// (irrespective of specific direction) with HB_DIRECTION_IS_HORIZONTAL()
+/// or HB_DIRECTION_IS_VERTICAL().
+pub const Direction = enum(u3) {
+ invalid = c.HB_DIRECTION_INVALID,
+ ltr = c.HB_DIRECTION_LTR,
+ rtl = c.HB_DIRECTION_RTL,
+ ttb = c.HB_DIRECTION_TTB,
+ bit = c.HB_DIRECTION_BTT,
+};
+
+/// Data type for scripts. Each hb_script_t's value is an hb_tag_t
+/// corresponding to the four-letter values defined by ISO 15924.
+///
+/// See also the Script (sc) property of the Unicode Character Database.
+pub const Script = enum(u31) {
+ common = c.HB_SCRIPT_COMMON,
+ inherited = c.HB_SCRIPT_INHERITED,
+ unknown = c.HB_SCRIPT_UNKNOWN,
+ arabic = c.HB_SCRIPT_ARABIC,
+ armenian = c.HB_SCRIPT_ARMENIAN,
+ bengali = c.HB_SCRIPT_BENGALI,
+ cyrillic = c.HB_SCRIPT_CYRILLIC,
+ devanagari = c.HB_SCRIPT_DEVANAGARI,
+ georgian = c.HB_SCRIPT_GEORGIAN,
+ greek = c.HB_SCRIPT_GREEK,
+ gujarati = c.HB_SCRIPT_GUJARATI,
+ gurmukhi = c.HB_SCRIPT_GURMUKHI,
+ hangul = c.HB_SCRIPT_HANGUL,
+ han = c.HB_SCRIPT_HAN,
+ hebrew = c.HB_SCRIPT_HEBREW,
+ hiragana = c.HB_SCRIPT_HIRAGANA,
+ kannada = c.HB_SCRIPT_KANNADA,
+ katakana = c.HB_SCRIPT_KATAKANA,
+ lao = c.HB_SCRIPT_LAO,
+ latin = c.HB_SCRIPT_LATIN,
+ malayalam = c.HB_SCRIPT_MALAYALAM,
+ oriya = c.HB_SCRIPT_ORIYA,
+ tamil = c.HB_SCRIPT_TAMIL,
+ telugu = c.HB_SCRIPT_TELUGU,
+ thai = c.HB_SCRIPT_THAI,
+ tibetan = c.HB_SCRIPT_TIBETAN,
+ bopomofo = c.HB_SCRIPT_BOPOMOFO,
+ braille = c.HB_SCRIPT_BRAILLE,
+ canadian_syllabics = c.HB_SCRIPT_CANADIAN_SYLLABICS,
+ cherokee = c.HB_SCRIPT_CHEROKEE,
+ ethiopic = c.HB_SCRIPT_ETHIOPIC,
+ khmer = c.HB_SCRIPT_KHMER,
+ mongolian = c.HB_SCRIPT_MONGOLIAN,
+ myanmar = c.HB_SCRIPT_MYANMAR,
+ ogham = c.HB_SCRIPT_OGHAM,
+ runic = c.HB_SCRIPT_RUNIC,
+ sinhala = c.HB_SCRIPT_SINHALA,
+ syriac = c.HB_SCRIPT_SYRIAC,
+ thaana = c.HB_SCRIPT_THAANA,
+ yi = c.HB_SCRIPT_YI,
+ deseret = c.HB_SCRIPT_DESERET,
+ gothic = c.HB_SCRIPT_GOTHIC,
+ old_italic = c.HB_SCRIPT_OLD_ITALIC,
+ buhid = c.HB_SCRIPT_BUHID,
+ hanunoo = c.HB_SCRIPT_HANUNOO,
+ tagalog = c.HB_SCRIPT_TAGALOG,
+ tagbanwa = c.HB_SCRIPT_TAGBANWA,
+ cypriot = c.HB_SCRIPT_CYPRIOT,
+ limbu = c.HB_SCRIPT_LIMBU,
+ linear_b = c.HB_SCRIPT_LINEAR_B,
+ osmanya = c.HB_SCRIPT_OSMANYA,
+ shavian = c.HB_SCRIPT_SHAVIAN,
+ tai_le = c.HB_SCRIPT_TAI_LE,
+ ugaritic = c.HB_SCRIPT_UGARITIC,
+ buginese = c.HB_SCRIPT_BUGINESE,
+ coptic = c.HB_SCRIPT_COPTIC,
+ glagolitic = c.HB_SCRIPT_GLAGOLITIC,
+ kharoshthi = c.HB_SCRIPT_KHAROSHTHI,
+ new_tai_lue = c.HB_SCRIPT_NEW_TAI_LUE,
+ old_persian = c.HB_SCRIPT_OLD_PERSIAN,
+ syloti_nagri = c.HB_SCRIPT_SYLOTI_NAGRI,
+ tifinagh = c.HB_SCRIPT_TIFINAGH,
+ balinese = c.HB_SCRIPT_BALINESE,
+ cuneiform = c.HB_SCRIPT_CUNEIFORM,
+ nko = c.HB_SCRIPT_NKO,
+ phags_pa = c.HB_SCRIPT_PHAGS_PA,
+ phoenician = c.HB_SCRIPT_PHOENICIAN,
+ carian = c.HB_SCRIPT_CARIAN,
+ cham = c.HB_SCRIPT_CHAM,
+ kayah_li = c.HB_SCRIPT_KAYAH_LI,
+ lepcha = c.HB_SCRIPT_LEPCHA,
+ lycian = c.HB_SCRIPT_LYCIAN,
+ lydian = c.HB_SCRIPT_LYDIAN,
+ ol_chiki = c.HB_SCRIPT_OL_CHIKI,
+ rejang = c.HB_SCRIPT_REJANG,
+ saurashtra = c.HB_SCRIPT_SAURASHTRA,
+ sundanese = c.HB_SCRIPT_SUNDANESE,
+ vai = c.HB_SCRIPT_VAI,
+ avestan = c.HB_SCRIPT_AVESTAN,
+ bamum = c.HB_SCRIPT_BAMUM,
+ egyptian_hieroglyphs = c.HB_SCRIPT_EGYPTIAN_HIEROGLYPHS,
+ imperial_aramaic = c.HB_SCRIPT_IMPERIAL_ARAMAIC,
+ inscriptional_pahlavi = c.HB_SCRIPT_INSCRIPTIONAL_PAHLAVI,
+ inscriptional_parthian = c.HB_SCRIPT_INSCRIPTIONAL_PARTHIAN,
+ javanese = c.HB_SCRIPT_JAVANESE,
+ kaithi = c.HB_SCRIPT_KAITHI,
+ lisu = c.HB_SCRIPT_LISU,
+ meetei_mayek = c.HB_SCRIPT_MEETEI_MAYEK,
+ old_south_arabian = c.HB_SCRIPT_OLD_SOUTH_ARABIAN,
+ old_turkic = c.HB_SCRIPT_OLD_TURKIC,
+ samaritan = c.HB_SCRIPT_SAMARITAN,
+ tai_tham = c.HB_SCRIPT_TAI_THAM,
+ tai_viet = c.HB_SCRIPT_TAI_VIET,
+ batak = c.HB_SCRIPT_BATAK,
+ brahmi = c.HB_SCRIPT_BRAHMI,
+ mandaic = c.HB_SCRIPT_MANDAIC,
+ chakma = c.HB_SCRIPT_CHAKMA,
+ meroitic_cursive = c.HB_SCRIPT_MEROITIC_CURSIVE,
+ meroitic_hieroglyphs = c.HB_SCRIPT_MEROITIC_HIEROGLYPHS,
+ miao = c.HB_SCRIPT_MIAO,
+ sharada = c.HB_SCRIPT_SHARADA,
+ sora_sompeng = c.HB_SCRIPT_SORA_SOMPENG,
+ takri = c.HB_SCRIPT_TAKRI,
+ bassa_vah = c.HB_SCRIPT_BASSA_VAH,
+ caucasian_albanian = c.HB_SCRIPT_CAUCASIAN_ALBANIAN,
+ duployan = c.HB_SCRIPT_DUPLOYAN,
+ elbasan = c.HB_SCRIPT_ELBASAN,
+ grantha = c.HB_SCRIPT_GRANTHA,
+ khojki = c.HB_SCRIPT_KHOJKI,
+ khudawadi = c.HB_SCRIPT_KHUDAWADI,
+ linear_a = c.HB_SCRIPT_LINEAR_A,
+ mahajani = c.HB_SCRIPT_MAHAJANI,
+ manichaean = c.HB_SCRIPT_MANICHAEAN,
+ mende_kikakui = c.HB_SCRIPT_MENDE_KIKAKUI,
+ modi = c.HB_SCRIPT_MODI,
+ mro = c.HB_SCRIPT_MRO,
+ nabataean = c.HB_SCRIPT_NABATAEAN,
+ old_north_arabian = c.HB_SCRIPT_OLD_NORTH_ARABIAN,
+ old_permic = c.HB_SCRIPT_OLD_PERMIC,
+ pahawh_hmong = c.HB_SCRIPT_PAHAWH_HMONG,
+ palmyrene = c.HB_SCRIPT_PALMYRENE,
+ pau_cin_hau = c.HB_SCRIPT_PAU_CIN_HAU,
+ psalter_pahlavi = c.HB_SCRIPT_PSALTER_PAHLAVI,
+ siddham = c.HB_SCRIPT_SIDDHAM,
+ tirhuta = c.HB_SCRIPT_TIRHUTA,
+ warang_citi = c.HB_SCRIPT_WARANG_CITI,
+ ahom = c.HB_SCRIPT_AHOM,
+ anatolian_hieroglyphs = c.HB_SCRIPT_ANATOLIAN_HIEROGLYPHS,
+ hatran = c.HB_SCRIPT_HATRAN,
+ multani = c.HB_SCRIPT_MULTANI,
+ old_hungarian = c.HB_SCRIPT_OLD_HUNGARIAN,
+ signwriting = c.HB_SCRIPT_SIGNWRITING,
+ adlam = c.HB_SCRIPT_ADLAM,
+ bhaiksuki = c.HB_SCRIPT_BHAIKSUKI,
+ marchen = c.HB_SCRIPT_MARCHEN,
+ osage = c.HB_SCRIPT_OSAGE,
+ tangut = c.HB_SCRIPT_TANGUT,
+ newa = c.HB_SCRIPT_NEWA,
+ masaram_gondi = c.HB_SCRIPT_MASARAM_GONDI,
+ nushu = c.HB_SCRIPT_NUSHU,
+ soyombo = c.HB_SCRIPT_SOYOMBO,
+ zanabazar_square = c.HB_SCRIPT_ZANABAZAR_SQUARE,
+ dogra = c.HB_SCRIPT_DOGRA,
+ gunjala_gondi = c.HB_SCRIPT_GUNJALA_GONDI,
+ hanifi_rohingya = c.HB_SCRIPT_HANIFI_ROHINGYA,
+ makasar = c.HB_SCRIPT_MAKASAR,
+ medefaidrin = c.HB_SCRIPT_MEDEFAIDRIN,
+ old_sogdian = c.HB_SCRIPT_OLD_SOGDIAN,
+ sogdian = c.HB_SCRIPT_SOGDIAN,
+ elymaic = c.HB_SCRIPT_ELYMAIC,
+ nandinagari = c.HB_SCRIPT_NANDINAGARI,
+ nyiakeng_puachue_hmong = c.HB_SCRIPT_NYIAKENG_PUACHUE_HMONG,
+ wancho = c.HB_SCRIPT_WANCHO,
+ chorasmian = c.HB_SCRIPT_CHORASMIAN,
+ dives_akuru = c.HB_SCRIPT_DIVES_AKURU,
+ khitan_small_script = c.HB_SCRIPT_KHITAN_SMALL_SCRIPT,
+ yezidi = c.HB_SCRIPT_YEZIDI,
+ cypro_minoan = c.HB_SCRIPT_CYPRO_MINOAN,
+ old_uyghur = c.HB_SCRIPT_OLD_UYGHUR,
+ tangsa = c.HB_SCRIPT_TANGSA,
+ toto = c.HB_SCRIPT_TOTO,
+ vithkuqi = c.HB_SCRIPT_VITHKUQI,
+ math = c.HB_SCRIPT_MATH,
+ invalid = c.HB_SCRIPT_INVALID,
+};
+
+/// Data type for languages. Each hb_language_t corresponds to a BCP 47
+/// language tag.
+pub const Language = struct {
+ handle: c.hb_language_t,
+
+ /// Converts str representing a BCP 47 language tag to the corresponding
+ /// hb_language_t.
+ pub fn fromString(str: []const u8) Language {
+ return .{
+ .handle = c.hb_language_from_string(str.ptr, @intCast(str.len)),
+ };
+ }
+
+ /// Converts an hb_language_t to a string.
+ pub fn toString(self: Language) [:0]const u8 {
+ return std.mem.span(@as(
+ [*:0]const u8,
+ @ptrCast(c.hb_language_to_string(self.handle)),
+ ));
+ }
+
+ /// Fetch the default language from current locale.
+ pub fn getDefault() Language {
+ return .{ .handle = c.hb_language_get_default() };
+ }
+};
+
+/// The hb_feature_t is the structure that holds information about requested
+/// feature application. The feature will be applied with the given value to
+/// all glyphs which are in clusters between start (inclusive) and end
+/// (exclusive). Setting start to HB_FEATURE_GLOBAL_START and end to
+/// HB_FEATURE_GLOBAL_END specifies that the feature always applies to the
+/// entire buffer.
+pub const Feature = extern struct {
+ tag: c.hb_tag_t,
+ value: u32,
+ start: c_uint,
+ end: c_uint,
+
+ pub fn fromString(str: []const u8) ?Feature {
+ var f: c.hb_feature_t = undefined;
+ return if (c.hb_feature_from_string(
+ str.ptr,
+ @intCast(str.len),
+ &f,
+ ) > 0)
+ @bitCast(f)
+ else
+ null;
+ }
+
+ pub fn toString(self: *Feature, buf: []u8) void {
+ c.hb_feature_to_string(self, buf.ptr, @intCast(buf.len));
+ }
+};
+
+test "feature from string" {
+ const testing = std.testing;
+ try testing.expect(Feature.fromString("dlig") != null);
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/coretext.zig b/vendor/libghostty-vt/pkg/harfbuzz/coretext.zig
new file mode 100644
index 00000000..73042624
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/coretext.zig
@@ -0,0 +1,30 @@
+const macos = @import("macos");
+const std = @import("std");
+const c = @import("c.zig").c;
+const Face = @import("face.zig").Face;
+const Font = @import("font.zig").Font;
+const Error = @import("errors.zig").Error;
+
+// Use custom extern functions so that the proper CoreText structs are used
+// without a ptrcast.
+extern fn hb_coretext_font_create(ct_face: *macos.text.Font) ?*c.hb_font_t;
+
+/// Creates an hb_font_t font object from the specified CTFontRef.
+pub fn createFont(face: *macos.text.Font) Error!Font {
+ const handle = hb_coretext_font_create(face) orelse return Error.HarfbuzzFailed;
+ return Font{ .handle = handle };
+}
+
+test {
+ if (!@hasDecl(c, "hb_coretext_font_create")) return error.SkipZigTest;
+
+ const name = try macos.foundation.String.createWithBytes("Monaco", .utf8, false);
+ defer name.release();
+ const desc = try macos.text.FontDescriptor.createWithNameAndSize(name, 12);
+ defer desc.release();
+ const font = try macos.text.Font.createWithFontDescriptor(desc, 12);
+ defer font.release();
+
+ var hb_font = try createFont(font);
+ defer hb_font.destroy();
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/errors.zig b/vendor/libghostty-vt/pkg/harfbuzz/errors.zig
new file mode 100644
index 00000000..44a4d055
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/errors.zig
@@ -0,0 +1,5 @@
+pub const Error = error{
+ /// Not very descriptive but harfbuzz doesn't actually have error
+ /// codes so the best we can do!
+ HarfbuzzFailed,
+};
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/face.zig b/vendor/libghostty-vt/pkg/harfbuzz/face.zig
new file mode 100644
index 00000000..5ffad5d3
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/face.zig
@@ -0,0 +1,17 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+
+/// A font face is an object that represents a single face from within a font family.
+///
+/// More precisely, a font face represents a single face in a binary font file.
+/// Font faces are typically built from a binary blob and a face index.
+/// Font faces are used to create fonts.
+pub const Face = struct {
+ handle: *c.hb_face_t,
+
+ /// Decreases the reference count on a face object. When the reference
+ /// count reaches zero, the face is destroyed, freeing all memory.
+ pub fn destroy(self: *Face) void {
+ c.hb_face_destroy(self.handle);
+ }
+};
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/font.zig b/vendor/libghostty-vt/pkg/harfbuzz/font.zig
new file mode 100644
index 00000000..13544fb9
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/font.zig
@@ -0,0 +1,28 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const Face = @import("face.zig").Face;
+const Error = @import("errors.zig").Error;
+
+pub const Font = struct {
+ handle: *c.hb_font_t,
+
+ /// Constructs a new font object from the specified face.
+ pub fn create(face: Face) Error!Font {
+ const handle = c.hb_font_create(face.handle) orelse return Error.HarfbuzzFailed;
+ return Font{ .handle = handle };
+ }
+
+ /// Decreases the reference count on the given font object. When the
+ /// reference count reaches zero, the font is destroyed, freeing all memory.
+ pub fn destroy(self: *Font) void {
+ c.hb_font_destroy(self.handle);
+ }
+
+ pub fn setScale(self: *Font, x: u32, y: u32) void {
+ c.hb_font_set_scale(
+ self.handle,
+ @intCast(x),
+ @intCast(y),
+ );
+ }
+};
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/freetype.zig b/vendor/libghostty-vt/pkg/harfbuzz/freetype.zig
new file mode 100644
index 00000000..d90d3f83
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/freetype.zig
@@ -0,0 +1,78 @@
+const freetype = @import("freetype");
+const std = @import("std");
+const c = @import("c.zig").c;
+const Face = @import("face.zig").Face;
+const Font = @import("font.zig").Font;
+const Error = @import("errors.zig").Error;
+
+// Use custom extern functions so that the proper freetype structs are used
+// without a ptrcast. These are only needed when interacting with freetype
+// C structs.
+extern fn hb_ft_face_create_referenced(ft_face: freetype.c.FT_Face) ?*c.hb_face_t;
+extern fn hb_ft_font_create_referenced(ft_face: freetype.c.FT_Face) ?*c.hb_font_t;
+extern fn hb_ft_font_get_face(font: ?*c.hb_font_t) freetype.c.FT_Face;
+
+/// Creates an hb_face_t face object from the specified FT_Face.
+///
+/// This is the preferred variant of the hb_ft_face_create* function
+/// family, because it calls FT_Reference_Face() on ft_face , ensuring
+/// that ft_face remains alive as long as the resulting hb_face_t face
+/// object remains alive. Also calls FT_Done_Face() when the hb_face_t
+/// face object is destroyed.
+///
+/// Use this version unless you know you have good reasons not to.
+pub fn createFace(face: freetype.c.FT_Face) Error!Face {
+ const handle = hb_ft_face_create_referenced(face) orelse return Error.HarfbuzzFailed;
+ return Face{ .handle = handle };
+}
+
+/// Creates an hb_font_t font object from the specified FT_Face.
+pub fn createFont(face: freetype.c.FT_Face) Error!Font {
+ const handle = hb_ft_font_create_referenced(face) orelse return Error.HarfbuzzFailed;
+ return Font{ .handle = handle };
+}
+
+/// Configures the font-functions structure of the specified hb_font_t font
+/// object to use FreeType font functions.
+///
+/// In particular, you can use this function to configure an existing
+/// hb_face_t face object for use with FreeType font functions even if that
+/// hb_face_t face object was initially created with hb_face_create(), and
+/// therefore was not initially configured to use FreeType font functions.
+///
+/// An hb_face_t face object created with hb_ft_face_create() is preconfigured
+/// for FreeType font functions and does not require this function to be used.
+pub fn setFontFuncs(font: Font) void {
+ c.hb_ft_font_set_funcs(font.handle);
+}
+
+test {
+ if (!@hasDecl(c, "hb_ft_font_create_referenced")) return error.SkipZigTest;
+
+ const testing = std.testing;
+ const testFont = freetype.testing.font_regular;
+ const ftc = freetype.c;
+ const ftok = ftc.FT_Err_Ok;
+
+ var ft_lib: ftc.FT_Library = undefined;
+ if (ftc.FT_Init_FreeType(&ft_lib) != ftok)
+ return error.FreeTypeInitFailed;
+ defer _ = ftc.FT_Done_FreeType(ft_lib);
+
+ var ft_face: ftc.FT_Face = undefined;
+ try testing.expect(ftc.FT_New_Memory_Face(
+ ft_lib,
+ testFont,
+ @intCast(testFont.len),
+ 0,
+ &ft_face,
+ ) == ftok);
+ defer _ = ftc.FT_Done_Face(ft_face);
+
+ var face = try createFace(ft_face);
+ defer face.destroy();
+
+ var font = try createFont(ft_face);
+ defer font.destroy();
+ setFontFuncs(font);
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/main.zig b/vendor/libghostty-vt/pkg/harfbuzz/main.zig
new file mode 100644
index 00000000..08a4f9c2
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/main.zig
@@ -0,0 +1,31 @@
+const blob = @import("blob.zig");
+const buffer = @import("buffer.zig");
+const common = @import("common.zig");
+const errors = @import("errors.zig");
+const face = @import("face.zig");
+const font = @import("font.zig");
+const shapepkg = @import("shape.zig");
+const versionpkg = @import("version.zig");
+
+pub const c = @import("c.zig").c;
+pub const freetype = @import("freetype.zig");
+pub const coretext = @import("coretext.zig");
+pub const MemoryMode = blob.MemoryMode;
+pub const Blob = blob.Blob;
+pub const Buffer = buffer.Buffer;
+pub const GlyphPosition = buffer.GlyphPosition;
+pub const Direction = common.Direction;
+pub const Script = common.Script;
+pub const Language = common.Language;
+pub const Feature = common.Feature;
+pub const Face = face.Face;
+pub const Font = font.Font;
+pub const shape = shapepkg.shape;
+pub const Version = versionpkg.Version;
+pub const version = versionpkg.version;
+pub const versionAtLeast = versionpkg.versionAtLeast;
+pub const versionString = versionpkg.versionString;
+
+test {
+ @import("std").testing.refAllDecls(@This());
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/shape.zig b/vendor/libghostty-vt/pkg/harfbuzz/shape.zig
new file mode 100644
index 00000000..b49020c3
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/shape.zig
@@ -0,0 +1,27 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+const Font = @import("font.zig").Font;
+const Buffer = @import("buffer.zig").Buffer;
+const Feature = @import("common.zig").Feature;
+
+/// Shapes buffer using font turning its Unicode characters content to
+/// positioned glyphs. If features is not NULL, it will be used to control
+/// the features applied during shaping. If two features have the same tag
+/// but overlapping ranges the value of the feature with the higher index
+/// takes precedence.
+pub fn shape(font: Font, buf: Buffer, features: ?[]const Feature) void {
+ const hb_feats: [*c]const c.hb_feature_t = feats: {
+ if (features) |fs| {
+ if (fs.len > 0) break :feats @ptrCast(fs.ptr);
+ }
+
+ break :feats null;
+ };
+
+ c.hb_shape(
+ font.handle,
+ buf.handle,
+ hb_feats,
+ if (features) |f| @intCast(f.len) else 0,
+ );
+}
diff --git a/vendor/libghostty-vt/pkg/harfbuzz/version.zig b/vendor/libghostty-vt/pkg/harfbuzz/version.zig
new file mode 100644
index 00000000..dbe25b52
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/harfbuzz/version.zig
@@ -0,0 +1,47 @@
+const std = @import("std");
+const c = @import("c.zig").c;
+
+pub const Version = struct {
+ major: u32,
+ minor: u32,
+ micro: u32,
+};
+
+/// Returns library version as three integer components.
+pub fn version() Version {
+ var major: c_uint = 0;
+ var minor: c_uint = 0;
+ var micro: c_uint = 0;
+ c.hb_version(&major, &minor, µ);
+ return .{ .major = major, .minor = minor, .micro = micro };
+}
+
+/// Tests the library version against a minimum value, as three integer components.
+pub fn versionAtLeast(vsn: Version) bool {
+ return c.hb_version_atleast(
+ vsn.major,
+ vsn.minor,
+ vsn.micro,
+ ) > 0;
+}
+
+/// Returns library version as a string with three components.
+pub fn versionString() [:0]const u8 {
+ const res = c.hb_version_string();
+ return std.mem.sliceTo(res, 0);
+}
+
+test {
+ const testing = std.testing;
+
+ // Should be able to get the version
+ const vsn = version();
+ try testing.expect(vsn.major > 0);
+
+ // Should be at least version 1
+ try testing.expect(versionAtLeast(.{
+ .major = 1,
+ .minor = 0,
+ .micro = 0,
+ }));
+}
diff --git a/vendor/libghostty-vt/pkg/highway/bridge.cpp b/vendor/libghostty-vt/pkg/highway/bridge.cpp
new file mode 100644
index 00000000..1e86c493
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/highway/bridge.cpp
@@ -0,0 +1,9 @@
+#include
+#include
+
+extern "C" {
+
+int64_t hwy_supported_targets() {
+ return HWY_SUPPORTED_TARGETS;
+}
+}
diff --git a/vendor/libghostty-vt/pkg/highway/build.zig b/vendor/libghostty-vt/pkg/highway/build.zig
new file mode 100644
index 00000000..49656b93
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/highway/build.zig
@@ -0,0 +1,141 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const upstream_ = b.lazyDependency("highway", .{});
+
+ const module = b.addModule("highway", .{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ });
+
+ const lib = b.addLibrary(.{
+ .name = "highway",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ // On MSVC, we must not use linkLibCpp because Zig unconditionally
+ // passes -nostdinc++ and then adds its bundled libc++/libc++abi
+ // include paths, which conflict with MSVC's own C++ runtime headers.
+ // The MSVC SDK include directories (added via linkLibC) contain
+ // both C and C++ headers, so linkLibCpp is not needed.
+ if (target.result.abi != .msvc) {
+ lib.linkLibCpp();
+ }
+ if (upstream_) |upstream| {
+ lib.addIncludePath(upstream.path(""));
+ module.addIncludePath(upstream.path(""));
+ }
+
+ if (target.result.os.tag.isDarwin()) {
+ const apple_sdk = @import("apple_sdk");
+ try apple_sdk.addPaths(b, lib);
+ }
+
+ if (target.result.abi.isAndroid()) {
+ const android_ndk = @import("android_ndk");
+ try android_ndk.addPaths(b, lib);
+ }
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ // Avoid changing binaries based on the current time and date.
+ "-Wno-builtin-macro-redefined",
+ "-D__DATE__=\"redacted\"",
+ "-D__TIMESTAMP__=\"redacted\"",
+ "-D__TIME__=\"redacted\"",
+
+ // Optimizations
+ "-fmerge-all-constants",
+
+ // Warnings
+ "-Wall",
+ "-Wextra",
+
+ // These are not included in Wall nor Wextra:
+ "-Wconversion",
+ "-Wsign-conversion",
+ "-Wvla",
+ "-Wnon-virtual-dtor",
+
+ "-Wfloat-overflow-conversion",
+ "-Wfloat-zero-conversion",
+ "-Wfor-loop-analysis",
+ "-Wgnu-redeclared-enum",
+ "-Winfinite-recursion",
+ "-Wself-assign",
+ "-Wstring-conversion",
+ "-Wtautological-overlap-compare",
+ "-Wthread-safety-analysis",
+ "-Wundefined-func-template",
+
+ "-fno-cxx-exceptions",
+ "-fno-slp-vectorize",
+ "-fno-vectorize",
+
+ // Fixes linker issues for release builds missing ubsanitizer symbols
+ "-fno-sanitize=undefined",
+ "-fno-sanitize-trap=undefined",
+ });
+
+ if (target.result.os.tag == .freebsd or target.result.abi == .musl) {
+ try flags.append(b.allocator, "-fPIC");
+ }
+
+ if (target.result.os.tag != .windows) {
+ try flags.appendSlice(b.allocator, &.{
+ "-fmath-errno",
+ "-fno-exceptions",
+ });
+ }
+
+ lib.addCSourceFiles(.{ .flags = flags.items, .files = &.{"bridge.cpp"} });
+ if (upstream_) |upstream| {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .flags = flags.items,
+ .files = &.{
+ "hwy/abort.cc",
+ "hwy/aligned_allocator.cc",
+ "hwy/nanobenchmark.cc",
+ "hwy/per_target.cc",
+ "hwy/print.cc",
+ "hwy/targets.cc",
+ "hwy/timer.cc",
+ },
+ });
+ lib.installHeadersDirectory(
+ upstream.path("hwy"),
+ "hwy",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ b.installArtifact(lib);
+
+ {
+ const test_exe = b.addTest(.{
+ .name = "test",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ test_exe.linkLibrary(lib);
+
+ var it = module.import_table.iterator();
+ while (it.next()) |entry| test_exe.root_module.addImport(entry.key_ptr.*, entry.value_ptr.*);
+ const tests_run = b.addRunArtifact(test_exe);
+ const test_step = b.step("test", "Run tests");
+ test_step.dependOn(&tests_run.step);
+ }
+}
diff --git a/vendor/libghostty-vt/pkg/highway/build.zig.zon b/vendor/libghostty-vt/pkg/highway/build.zig.zon
new file mode 100644
index 00000000..4870d1db
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/highway/build.zig.zon
@@ -0,0 +1,17 @@
+.{
+ .name = .highway,
+ .version = "1.2.0",
+ .fingerprint = 0xdbcf1a7425023274,
+ .paths = .{""},
+ .dependencies = .{
+ // google/highway
+ .highway = .{
+ .url = "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz",
+ .hash = "N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE",
+ .lazy = true,
+ },
+
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ .android_ndk = .{ .path = "../android-ndk" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/highway/main.zig b/vendor/libghostty-vt/pkg/highway/main.zig
new file mode 100644
index 00000000..95ba6cda
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/highway/main.zig
@@ -0,0 +1,57 @@
+extern "c" fn hwy_supported_targets() i64;
+
+pub const Targets = packed struct(i64) {
+ // x86_64
+ _reserved: u4 = 0,
+ avx3_spr: bool = false,
+ _reserved_5: u1 = 0,
+ avx3_zen4: bool = false,
+ avx3_dl: bool = false,
+ avx3: bool = false,
+ avx2: bool = false,
+ _reserved_10: u1 = 0,
+ sse4: bool = false,
+ ssse3: bool = false,
+ _reserved_13: u1 = 0, // SSE3 reserved
+ sse2: bool = false,
+ _reserved_15_23: u9 = 0,
+
+ // aarch64
+ sve2_128: bool = false,
+ sve_256: bool = false,
+ sve2: bool = false,
+ sve: bool = false,
+ neon: bool = false,
+ neon_without_aes: bool = false,
+ _reserved_30_36: u6 = 0,
+
+ // risc-v
+ rvv: bool = false,
+ _reserved_38_46: u9 = 0,
+
+ // IBM Power
+ ppc10: bool = false,
+ ppc9: bool = false,
+ ppc8: bool = false,
+ z15: bool = false,
+ z14: bool = false,
+ _reserved_52_57: u6 = 0,
+
+ // WebAssembly
+ wasm_emu256: bool = false,
+ wasm: bool = false,
+ _reserved_60_61: u2 = 0,
+
+ // Emulation
+ emu128: bool = false,
+ scalar: bool = false,
+ _reserved_63: u1 = 0,
+};
+
+pub fn supported_targets() Targets {
+ return @bitCast(hwy_supported_targets());
+}
+
+test {
+ _ = supported_targets();
+}
diff --git a/vendor/libghostty-vt/pkg/libintl/build.zig b/vendor/libghostty-vt/pkg/libintl/build.zig
new file mode 100644
index 00000000..32221e5a
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libintl/build.zig
@@ -0,0 +1,104 @@
+//! Provides libintl for macOS.
+//!
+//! IMPORTANT: This is only for macOS. We could support other platforms
+//! if/when we need to but generally Linux provides libintl in libc.
+//! Windows we'll have to figure out when we get there.
+//!
+//! Since this is only for macOS, there's a lot of hardcoded stuff
+//! here that assumes macOS. For example, I generated the config.h
+//! on my own machine (a Mac) and then copied it here. This isn't
+//! ideal since we should do the same detection that gettext's configure
+//! script does, but its quite a bit of work to do that.
+//!
+//! UPGRADING: If you need to upgrade gettext, then the only thing to
+//! really watch out for is the xlocale.h include we added manually
+//! at the end of config.h. The comment there notes why. When we upgrade
+//! we should audit our config.h and make sure we add that back (if we
+//! have to).
+
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_CONFIG_H",
+ "-DLOCALEDIR=\"\"",
+ });
+
+ {
+ const lib = b.addLibrary(.{
+ .name = "intl",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ lib.addIncludePath(b.path(""));
+
+ if (target.result.os.tag.isDarwin()) {
+ const apple_sdk = @import("apple_sdk");
+ try apple_sdk.addPaths(b, lib);
+ }
+
+ if (b.lazyDependency("gettext", .{})) |upstream| {
+ lib.addIncludePath(upstream.path("gettext-runtime/intl"));
+ lib.addIncludePath(upstream.path("gettext-runtime/intl/gnulib-lib"));
+ lib.addCSourceFiles(.{
+ .root = upstream.path("gettext-runtime/intl"),
+ .files = srcs,
+ .flags = flags.items,
+ });
+ }
+
+ lib.installHeader(b.path("libintl.h"), "libintl.h");
+ b.installArtifact(lib);
+ }
+}
+
+const srcs: []const []const u8 = &.{
+ "bindtextdom.c",
+ "dcgettext.c",
+ "dcigettext.c",
+ "dcngettext.c",
+ "dgettext.c",
+ "dngettext.c",
+ "explodename.c",
+ "finddomain.c",
+ "gettext.c",
+ "hash-string.c",
+ "intl-compat.c",
+ "l10nflist.c",
+ "langprefs.c",
+ "loadmsgcat.c",
+ "localealias.c",
+ "log.c",
+ "ngettext.c",
+ "plural-exp.c",
+ "plural.c",
+ "setlocale.c",
+ "textdomain.c",
+ "version.c",
+ "compat.c",
+
+ // There's probably a better way to detect that we need these, but
+ // these are hardcoded for now for macOS.
+ "gnulib-lib/getlocalename_l-unsafe.c",
+ "gnulib-lib/localename.c",
+ "gnulib-lib/localename-environ.c",
+ "gnulib-lib/localename-unsafe.c",
+ "gnulib-lib/setlocale-lock.c",
+ "gnulib-lib/setlocale_null.c",
+ "gnulib-lib/setlocale_null-unlocked.c",
+
+ // Not needed for macOS, but we might need them for other platforms.
+ // If we expand this to support other platforms, we should uncomment
+ // these.
+ // "osdep.c",
+ // "printf.c",
+};
diff --git a/vendor/libghostty-vt/pkg/libintl/build.zig.zon b/vendor/libghostty-vt/pkg/libintl/build.zig.zon
new file mode 100644
index 00000000..a32e2009
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libintl/build.zig.zon
@@ -0,0 +1,15 @@
+.{
+ .name = .libintl,
+ .version = "0.24.0",
+ .fingerprint = 0x16434c723ba7278a,
+ .paths = .{""},
+ .dependencies = .{
+ .gettext = .{
+ .url = "https://deps.files.ghostty.org/gettext-0.24.tar.gz",
+ .hash = "N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-",
+ .lazy = true,
+ },
+
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/libintl/config.h b/vendor/libghostty-vt/pkg/libintl/config.h
new file mode 100644
index 00000000..93d4e024
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libintl/config.h
@@ -0,0 +1,2370 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Witness that has been included. */
+#define _GL_CONFIG_H_INCLUDED 1
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Define if no multithread safety and no multithreading is desired. */
+/* #undef AVOID_ANY_THREADS */
+
+/* Define to the number of bits in type 'ptrdiff_t'. */
+/* #undef BITSIZEOF_PTRDIFF_T */
+
+/* Define to the number of bits in type 'sig_atomic_t'. */
+/* #undef BITSIZEOF_SIG_ATOMIC_T */
+
+/* Define to the number of bits in type 'size_t'. */
+/* #undef BITSIZEOF_SIZE_T */
+
+/* Define to the number of bits in type 'wchar_t'. */
+/* #undef BITSIZEOF_WCHAR_T */
+
+/* Define to the number of bits in type 'wint_t'. */
+/* #undef BITSIZEOF_WINT_T */
+
+/* Define if you wish *printf() functions that have a safe handling of
+ non-IEEE-754 'long double' values. */
+#define CHECK_PRINTF_SAFE 1
+
+/* Define to 1 if using 'alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define as the bit index in the word where to find bit 0 of the exponent of
+ 'double'. */
+#define DBL_EXPBIT0_BIT 20
+
+/* Define as the word index where to find the exponent of 'double'. */
+#define DBL_EXPBIT0_WORD 1
+
+/* Define as the bit index in the word where to find the sign of 'double'. */
+/* #undef DBL_SIGNBIT_BIT */
+
+/* Define as the word index where to find the sign of 'double'. */
+/* #undef DBL_SIGNBIT_WORD */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#define ENABLE_NLS 1
+
+/* Define to nothing if C supports flexible array members, and to 1 if it does
+ not. That way, with a declaration like 'struct s { int n; short
+ d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
+ compilers. Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate
+ the size in bytes of such a struct containing an N-element array. */
+#define FLEXIBLE_ARRAY_MEMBER /**/
+
+/* Define as the bit index in the word where to find bit 0 of the exponent of
+ 'float'. */
+#define FLT_EXPBIT0_BIT 23
+
+/* Define as the word index where to find the exponent of 'float'. */
+#define FLT_EXPBIT0_WORD 0
+
+/* Define as the bit index in the word where to find the sign of 'float'. */
+/* #undef FLT_SIGNBIT_BIT */
+
+/* Define as the word index where to find the sign of 'float'. */
+/* #undef FLT_SIGNBIT_WORD */
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module fscanf shall be considered present. */
+#define GNULIB_FSCANF 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module lock shall be considered present. */
+#define GNULIB_LOCK 1
+
+/* Define to 1 if printf and friends should be labeled with attribute
+ "__gnu_printf__" instead of "__printf__" */
+/* #undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU */
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module scanf shall be considered present. */
+#define GNULIB_SCANF 1
+
+/* Define to 1 when the gnulib module fgetc should be tested. */
+#define GNULIB_TEST_FGETC 1
+
+/* Define to 1 when the gnulib module fgets should be tested. */
+#define GNULIB_TEST_FGETS 1
+
+/* Define to 1 when the gnulib module fprintf should be tested. */
+#define GNULIB_TEST_FPRINTF 1
+
+/* Define to 1 when the gnulib module fputc should be tested. */
+#define GNULIB_TEST_FPUTC 1
+
+/* Define to 1 when the gnulib module fputs should be tested. */
+#define GNULIB_TEST_FPUTS 1
+
+/* Define to 1 when the gnulib module fread should be tested. */
+#define GNULIB_TEST_FREAD 1
+
+/* Define to 1 when the gnulib module free-posix should be tested. */
+#define GNULIB_TEST_FREE_POSIX 1
+
+/* Define to 1 when the gnulib module frexp should be tested. */
+#define GNULIB_TEST_FREXP 1
+
+/* Define to 1 when the gnulib module frexpl should be tested. */
+#define GNULIB_TEST_FREXPL 1
+
+/* Define to 1 when the gnulib module fscanf should be tested. */
+#define GNULIB_TEST_FSCANF 1
+
+/* Define to 1 when the gnulib module fwrite should be tested. */
+#define GNULIB_TEST_FWRITE 1
+
+/* Define to 1 when the gnulib module getc should be tested. */
+#define GNULIB_TEST_GETC 1
+
+/* Define to 1 when the gnulib module getchar should be tested. */
+#define GNULIB_TEST_GETCHAR 1
+
+/* Define to 1 when the gnulib module getcwd should be tested. */
+#define GNULIB_TEST_GETCWD 1
+
+/* Define to 1 when the gnulib module getlocalename_l-unsafe should be tested.
+ */
+#define GNULIB_TEST_GETLOCALENAME_L_UNSAFE 1
+
+/* Define to 1 when the gnulib module localename-environ should be tested. */
+#define GNULIB_TEST_LOCALENAME_ENVIRON 1
+
+/* Define to 1 when the gnulib module localename-unsafe should be tested. */
+#define GNULIB_TEST_LOCALENAME_UNSAFE 1
+
+/* Define to 1 when the gnulib module mbrtowc should be tested. */
+#define GNULIB_TEST_MBRTOWC 1
+
+/* Define to 1 when the gnulib module mbsinit should be tested. */
+#define GNULIB_TEST_MBSINIT 1
+
+/* Define to 1 when the gnulib module mbszero should be tested. */
+#define GNULIB_TEST_MBSZERO 1
+
+/* Define to 1 when the gnulib module memchr should be tested. */
+#define GNULIB_TEST_MEMCHR 1
+
+/* Define to 1 when the gnulib module printf should be tested. */
+#define GNULIB_TEST_PRINTF 1
+
+/* Define to 1 when the gnulib module pthread-once should be tested. */
+#define GNULIB_TEST_PTHREAD_ONCE 1
+
+/* Define to 1 when the gnulib module putc should be tested. */
+#define GNULIB_TEST_PUTC 1
+
+/* Define to 1 when the gnulib module putchar should be tested. */
+#define GNULIB_TEST_PUTCHAR 1
+
+/* Define to 1 when the gnulib module puts should be tested. */
+#define GNULIB_TEST_PUTS 1
+
+/* Define to 1 when the gnulib module scanf should be tested. */
+#define GNULIB_TEST_SCANF 1
+
+/* Define to 1 when the gnulib module setlocale_null should be tested. */
+#define GNULIB_TEST_SETLOCALE_NULL 1
+
+/* Define to 1 when the gnulib module signbit should be tested. */
+#define GNULIB_TEST_SIGNBIT 1
+
+/* Define to 1 when the gnulib module tsearch should be tested. */
+#define GNULIB_TEST_TSEARCH 1
+
+/* Define to 1 when the gnulib module vfprintf should be tested. */
+#define GNULIB_TEST_VFPRINTF 1
+
+/* Define to 1 when the gnulib module vprintf should be tested. */
+#define GNULIB_TEST_VPRINTF 1
+
+/* Define to 1 when the gnulib module wgetcwd should be tested. */
+#define GNULIB_TEST_WGETCWD 1
+
+/* Define to 1 when the gnulib module wmemcpy should be tested. */
+#define GNULIB_TEST_WMEMCPY 1
+
+/* Define to 1 when the gnulib module wmemset should be tested. */
+#define GNULIB_TEST_WMEMSET 1
+
+/* Define if the __locale_t type contains the name of the LC_MESSAGES
+ category. */
+/* #undef HAVE_AIX72_LOCALES */
+
+/* Define to 1 if you have 'alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if works. */
+#define HAVE_ALLOCA_H 1
+
+/* Define to 1 if you have the 'asprintf' function. */
+#define HAVE_ASPRINTF 1
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_BP_SYM_H */
+
+/* Define to 1 if the compiler understands __builtin_expect. */
+#define HAVE_BUILTIN_EXPECT 1
+
+/* Define to 1 if you have the Mac OS X function
+ CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
+#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+#define HAVE_CFPREFERENCESCOPYAPPVALUE 1
+
+/* Define if the copysignf function is declared in and available in
+ libc. */
+/* #undef HAVE_COPYSIGNF_IN_LIBC */
+
+/* Define if the copysignl function is declared in and available in
+ libc. */
+/* #undef HAVE_COPYSIGNL_IN_LIBC */
+
+/* Define if the copysign function is declared in and available in
+ libc. */
+/* #undef HAVE_COPYSIGN_IN_LIBC */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_CRTDEFS_H */
+
+/* Define to 1 if bool, true and false work as per C2023. */
+/* #undef HAVE_C_BOOL */
+
+/* Define to 1 if the static_assert keyword works. */
+/* #undef HAVE_C_STATIC_ASSERT */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the declaration of 'alarm', and to 0 if you don't.
+ */
+#define HAVE_DECL_ALARM 1
+
+/* Define to 1 if you have the declaration of 'copysign', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_COPYSIGN */
+
+/* Define to 1 if you have the declaration of 'copysignf', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_COPYSIGNF */
+
+/* Define to 1 if you have the declaration of 'copysignl', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_COPYSIGNL */
+
+/* Define to 1 if you have the declaration of 'ecvt', and to 0 if you don't.
+ */
+#define HAVE_DECL_ECVT 1
+
+/* Define to 1 if you have the declaration of 'execvpe', and to 0 if you
+ don't. */
+#define HAVE_DECL_EXECVPE 0
+
+/* Define to 1 if you have the declaration of 'fcloseall', and to 0 if you
+ don't. */
+#define HAVE_DECL_FCLOSEALL 0
+
+/* Define to 1 if you have the declaration of 'fcvt', and to 0 if you don't.
+ */
+#define HAVE_DECL_FCVT 1
+
+/* Define to 1 if you have the declaration of 'feof_unlocked', and to 0 if you
+ don't. */
+#define HAVE_DECL_FEOF_UNLOCKED 1
+
+/* Define to 1 if you have the declaration of 'fgets_unlocked', and to 0 if
+ you don't. */
+#define HAVE_DECL_FGETS_UNLOCKED 0
+
+/* Define to 1 if you have the declaration of 'gcvt', and to 0 if you don't.
+ */
+#define HAVE_DECL_GCVT 1
+
+/* Define to 1 if you have the declaration of 'getw', and to 0 if you don't.
+ */
+#define HAVE_DECL_GETW 1
+
+/* Define to 1 if you have the declaration of 'mbrtowc', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_MBRTOWC */
+
+/* Define to 1 if you have the declaration of 'mbsinit', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_MBSINIT */
+
+/* Define to 1 if you have the declaration of 'putw', and to 0 if you don't.
+ */
+#define HAVE_DECL_PUTW 1
+
+/* Define to 1 if you have the declaration of 'wcsdup', and to 0 if you don't.
+ */
+#define HAVE_DECL_WCSDUP 1
+
+/* Define to 1 if you have the declaration of 'wcsnlen', and to 0 if you
+ don't. */
+#define HAVE_DECL_WCSNLEN 1
+
+/* Define to 1 if you have the declaration of '_snprintf', and to 0 if you
+ don't. */
+#define HAVE_DECL__SNPRINTF 0
+
+/* Define to 1 if you have the declaration of '_snwprintf', and to 0 if you
+ don't. */
+#define HAVE_DECL__SNWPRINTF 0
+
+/* Define to 1 if you have the header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `duplocale' function. */
+#define HAVE_DUPLOCALE 1
+
+/* Define if the locale_t type contains insufficient information, as on
+ OpenBSD. */
+/* #undef HAVE_FAKE_LOCALES */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_FEATURES_H */
+
+/* Define to 1 if you have the `freelocale' function. */
+#define HAVE_FREELOCALE 1
+
+/* Define if the 'free' function is guaranteed to preserve errno. */
+/* #undef HAVE_FREE_POSIX */
+
+/* Define if the frexpl function is available in libc. */
+#define HAVE_FREXPL_IN_LIBC 1
+
+/* Define if the frexp function is available in libc. */
+#define HAVE_FREXP_IN_LIBC 1
+
+/* Define to 1 if you have the 'getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the 'getegid' function. */
+#define HAVE_GETEGID 1
+
+/* Define to 1 if you have the 'geteuid' function. */
+#define HAVE_GETEUID 1
+
+/* Define to 1 if you have the 'getgid' function. */
+#define HAVE_GETGID 1
+
+/* Define to 1 if you have the 'getlocalename_l' function. */
+/* #undef HAVE_GETLOCALENAME_L */
+
+/* Define to 1 if you have the 'getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* Define to 1 if you have the 'getuid' function. */
+#define HAVE_GETUID 1
+
+/* Define if the uselocale function exists, may be safely called, and returns
+ sufficient information. */
+#define HAVE_GOOD_USELOCALE 1
+
+/* Define if you have the iconv() function and it works. */
+/* #undef HAVE_ICONV */
+
+/* Define if you have the 'intmax_t' type in or . */
+#define HAVE_INTMAX_T 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if exists, doesn't clash with , and
+ declares uintmax_t. */
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+
+/* Define if the isnan(double) function is available in libc. */
+#define HAVE_ISNAND_IN_LIBC 1
+
+/* Define if the isnan(float) function is available in libc. */
+#define HAVE_ISNANF_IN_LIBC 1
+
+/* Define if the isnan(long double) function is available in libc. */
+#define HAVE_ISNANL_IN_LIBC 1
+
+/* Define if you have and nl_langinfo(CODESET). */
+#define HAVE_LANGINFO_CODESET 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_LANGINFO_H 1
+
+/* Define if your file defines LC_MESSAGES. */
+#define HAVE_LC_MESSAGES 1
+
+/* Define if the ldexpl function is available in libc. */
+#define HAVE_LDEXPL_IN_LIBC 1
+
+/* Define if the ldexp function is available in libc. */
+#define HAVE_LDEXP_IN_LIBC 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if the system has the type 'long long int'. */
+#define HAVE_LONG_LONG_INT 1
+
+/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
+ config.h and . */
+#define HAVE_MAP_ANONYMOUS 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_MATH_H 1
+
+/* Define to 1 if you have the 'mbrtowc' function. */
+#define HAVE_MBRTOWC 1
+
+/* Define to 1 if you have the 'mbsinit' function. */
+#define HAVE_MBSINIT 1
+
+/* Define to 1 if declares mbstate_t. */
+#define HAVE_MBSTATE_T 1
+
+/* Define to 1 if you have the 'mempcpy' function. */
+/* #undef HAVE_MEMPCPY */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_MINIX_CONFIG_H */
+
+/* Define to 1 if you have a working 'mmap' system call. */
+#define HAVE_MMAP 1
+
+/* Define to 1 if you have the 'mprotect' function. */
+#define HAVE_MPROTECT 1
+
+/* Define to 1 if you have the 'munmap' function. */
+#define HAVE_MUNMAP 1
+
+/* Define if the locale_t type does not contain the name of each locale
+ category. */
+/* #undef HAVE_NAMELESS_LOCALES */
+
+/* Define to 1 if you have the 'newlocale' function. */
+#define HAVE_NEWLOCALE 1
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#define HAVE_NL_LANGINFO 1
+
+/* Define if your printf() function supports format strings with positions. */
+#define HAVE_POSIX_PRINTF 1
+
+/* Define if you have the header and the POSIX threads API. */
+#define HAVE_PTHREAD_API 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_PTHREAD_H 1
+
+/* Define if the defines PTHREAD_MUTEX_RECURSIVE. */
+#define HAVE_PTHREAD_MUTEX_RECURSIVE 1
+
+/* Define if the POSIX multithreading library has read/write locks. */
+#define HAVE_PTHREAD_RWLOCK 1
+
+/* Define if the 'pthread_rwlock_rdlock' function prefers a writer to a
+ reader. */
+#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1
+
+/* Define to 1 if the system has the type 'pthread_spinlock_t'. */
+/* #undef HAVE_PTHREAD_SPINLOCK_T */
+
+/* Define to 1 if the system has the type 'pthread_t'. */
+#define HAVE_PTHREAD_T 1
+
+/* Define to 1 if 'long double' and 'double' have the same representation. */
+#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SCHED_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SEARCH_H 1
+
+/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
+/* #undef HAVE_SIGNED_SIG_ATOMIC_T */
+
+/* Define to 1 if 'wchar_t' is a signed integer type. */
+/* #undef HAVE_SIGNED_WCHAR_T */
+
+/* Define to 1 if 'wint_t' is a signed integer type. */
+/* #undef HAVE_SIGNED_WINT_T */
+
+/* Define to 1 if you have the 'snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define if the return value of the snprintf function is the number of of
+ bytes (excluding the terminating NUL) that would have been produced if the
+ buffer had been large enough. */
+#define HAVE_SNPRINTF_RETVAL_C99 1
+
+/* Define if the string produced by the snprintf function is always NUL
+ terminated. */
+#define HAVE_SNPRINTF_TRUNCATION_C99 1
+
+/* Define if the locale_t type is as on Solaris 11.4. */
+/* #undef HAVE_SOLARIS114_LOCALES */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDINT_H 1
+
+/* Define if exists, doesn't clash with , and declares
+ uintmax_t. */
+#define HAVE_STDINT_H_WITH_UINTMAX 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the 'stpcpy' function. */
+#define HAVE_STPCPY 1
+
+/* Define to 1 if you have the 'strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the 'strnlen' function. */
+#define HAVE_STRNLEN 1
+
+/* Define to 1 if you have the 'swprintf' function. */
+#define HAVE_SWPRINTF 1
+
+/* Define to 1 if you have the 'symlink' function. */
+#define HAVE_SYMLINK 1
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_SYS_BITYPES_H */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_SYS_INTTYPES_H */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_SYS_SINGLE_THREADED_H */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `thrd_create' function. */
+/* #undef HAVE_THRD_CREATE */
+
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_THREADS_H */
+
+/* Define to 1 if you have the `tsearch' function. */
+#define HAVE_TSEARCH 1
+
+/* Define to 1 if you have the `twalk' function. */
+#define HAVE_TWALK 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if the system has the type 'unsigned long long int'. */
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+
+/* Define to 1 if you have the 'uselocale' function. */
+#define HAVE_USELOCALE 1
+
+/* Define to 1 if you have the 'vasnprintf' function. */
+/* #undef HAVE_VASNPRINTF */
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+ declarations. */
+#define HAVE_VISIBILITY 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define to 1 if you have the 'wcrtomb' function. */
+#define HAVE_WCRTOMB 1
+
+/* Define to 1 if you have the 'wcslen' function. */
+#define HAVE_WCSLEN 1
+
+/* Define to 1 if you have the 'wcsnlen' function. */
+#define HAVE_WCSNLEN 1
+
+/* Define to 1 if the compiler and linker support weak declarations of
+ symbols. */
+/* #undef HAVE_WEAK_SYMBOLS */
+
+/* Define to 1 if defines the _locale_t type. */
+/* #undef HAVE_WINDOWS_LOCALE_T */
+
+/* Define if you have the 'wint_t' type. */
+#define HAVE_WINT_T 1
+
+/* Define to 1 if O_NOATIME works. */
+#define HAVE_WORKING_O_NOATIME 1
+
+/* Define to 1 if O_NOFOLLOW works. */
+#define HAVE_WORKING_O_NOFOLLOW 1
+
+/* Define if the swprintf function works correctly when it produces output
+ that contains null wide characters. */
+/* #undef HAVE_WORKING_SWPRINTF */
+
+/* Define if the uselocale function exists and may safely be called. */
+#define HAVE_WORKING_USELOCALE 1
+
+/* Define to 1 if you have the 'wprintf' function. */
+#define HAVE_WPRINTF 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_XLOCALE_H 1
+
+/* Define to 1 if you have the '__fsetlocking' function. */
+/* #undef HAVE___FSETLOCKING */
+
+/* Define to 1 if ctype.h defines __header_inline. */
+#define HAVE___HEADER_INLINE 1
+
+/* Please see the Gnulib manual for how to use these macros.
+
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ .
+
+ Suppress extern inline with Sun C in standards-conformance mode, as it
+ mishandles inline functions that call each other. E.g., for 'inline void f
+ (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+ 'reference to static identifier "f" in extern inline function'.
+ This bug was observed with Oracle Developer Studio 12.6
+ (Sun C 5.15 SunOS_sparc 2017/05/30).
+
+ Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+ on configurations that mistakenly use 'static inline' to implement
+ functions or macros in standard C headers like . For example,
+ if isdigit is mistakenly implemented via a static inline function,
+ a program containing an extern inline function that calls isdigit
+ may not work since the C standard prohibits extern inline functions
+ from calling static functions (ISO C 99 section 6.7.4.(3).
+ This bug is known to occur on:
+
+ OS X 10.8 and earlier; see:
+ https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
+
+ DragonFly; see
+ http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
+
+ FreeBSD; see:
+ https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
+
+ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+ for clang but remains for g++; see .
+ Assume DragonFly and FreeBSD will be similar.
+
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. It defines a macro
+ __GNUC_STDC_INLINE__ to indicate this situation or a macro
+ __GNUC_GNU_INLINE__ to indicate the opposite situation.
+ GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+ semantics but warns, unless -fgnu89-inline is used:
+ warning: C99 inline functions are not supported; using GNU89
+ warning: to disable this warning use -fgnu89-inline or the gnu_inline
+ function attribute It defines a macro __GNUC_GNU_INLINE__ to indicate this
+ situation.
+ */
+#if (((defined __APPLE__ && defined __MACH__) || defined __DragonFly__ || \
+ defined __FreeBSD__) && \
+ (defined HAVE___HEADER_INLINE \
+ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ && \
+ !defined __clang__) \
+ : ((!defined _DONT_USE_CTYPE_INLINE_ && \
+ (defined __GNUC__ || defined __cplusplus)) || \
+ (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE && \
+ defined __GNUC__ && !defined __cplusplus))))
+#define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ && \
+ !defined __PCC__) \
+ : (199901L <= __STDC_VERSION__ && !defined __HP_cc && \
+ !defined __PGI && !(defined __SUNPRO_C && __STDC__))) && \
+ !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+#define _GL_INLINE inline
+#define _GL_EXTERN_INLINE extern inline
+#define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ && \
+ !defined __PCC__ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+#if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
+#define _GL_INLINE extern inline __attribute__((__gnu_inline__))
+#else
+#define _GL_INLINE extern inline
+#endif
+#define _GL_EXTERN_INLINE extern
+#define _GL_EXTERN_INLINE_IN_USE
+#else
+#define _GL_INLINE _GL_UNUSED static
+#define _GL_EXTERN_INLINE _GL_UNUSED static
+#endif
+
+/* In GCC 4.6 (inclusive) to 5.1 (exclusive),
+ suppress bogus "no previous prototype for 'FOO'"
+ and "no previous declaration for 'FOO'" diagnostics,
+ when FOO is an inline function in the header; see
+ and
+ . */
+#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
+#if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+#define _GL_INLINE_HEADER_CONST_PRAGMA
+#else
+#define _GL_INLINE_HEADER_CONST_PRAGMA \
+ _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+#endif
+#define _GL_INLINE_HEADER_BEGIN \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+ _Pragma("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+ _GL_INLINE_HEADER_CONST_PRAGMA
+#define _GL_INLINE_HEADER_END _Pragma("GCC diagnostic pop")
+#else
+#define _GL_INLINE_HEADER_BEGIN
+#define _GL_INLINE_HEADER_END
+#endif
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST
+
+/* Define as the bit index in the word where to find bit 0 of the exponent of
+ 'long double'. */
+#define LDBL_EXPBIT0_BIT 20
+
+/* Define as the word index where to find the exponent of 'long double'. */
+#define LDBL_EXPBIT0_WORD 1
+
+/* Define as the bit index in the word where to find the sign of 'long
+ double'. */
+/* #undef LDBL_SIGNBIT_BIT */
+
+/* Define as the word index where to find the sign of 'long double'. */
+/* #undef LDBL_SIGNBIT_WORD */
+
+/* Define if localename.c overrides newlocale(), duplocale(), freelocale(). */
+/* #undef LOCALENAME_ENHANCE_LOCALE_FUNCS */
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
+/* #undef MAP_ANONYMOUS */
+
+/* Define if the mbrtowc function does not return (size_t) -2 for empty input.
+ */
+/* #undef MBRTOWC_EMPTY_INPUT_BUG */
+
+/* Define if the mbrtowc function may signal encoding errors in the C locale.
+ */
+/* #undef MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ */
+
+/* Define if the mbrtowc function has the NULL pwc argument bug. */
+/* #undef MBRTOWC_NULL_ARG1_BUG */
+
+/* Define if the mbrtowc function has the NULL string argument bug. */
+/* #undef MBRTOWC_NULL_ARG2_BUG */
+
+/* Define if the mbrtowc function does not return 0 for a NUL character. */
+/* #undef MBRTOWC_NUL_RETVAL_BUG */
+
+/* Define if the mbrtowc function returns a wrong return value. */
+/* #undef MBRTOWC_RETVAL_BUG */
+
+/* Define if the mbrtowc function stores a wide character when reporting
+ incomplete input. */
+/* #undef MBRTOWC_STORES_INCOMPLETE_BUG */
+
+/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+#define __USE_MINGW_ANSI_STDIO 1
+#endif
+
+/* Define to 1 on musl libc. */
+/* #undef MUSL_LIBC */
+
+/* Define if the vasnprintf implementation needs special code for the 'a' and
+ 'A' directives. */
+#define NEED_PRINTF_DIRECTIVE_A 1
+
+/* Define if the vasnprintf implementation needs special code for the 'b'
+ directive. */
+#define NEED_PRINTF_DIRECTIVE_B 1
+
+/* Define if the vasnprintf implementation needs special code for the 'F'
+ directive. */
+/* #undef NEED_PRINTF_DIRECTIVE_F */
+
+/* Define if the vasnprintf implementation needs special code for the 'lc'
+ directive. */
+/* #undef NEED_PRINTF_DIRECTIVE_LC */
+
+/* Define if the vasnprintf implementation needs special code for the 'ls'
+ directive. */
+/* #undef NEED_PRINTF_DIRECTIVE_LS */
+
+/* Define if the vasnprintf implementation needs special code for 'double'
+ arguments. */
+#define NEED_PRINTF_DOUBLE 1
+
+/* Define if the vasnprintf implementation needs special code for surviving
+ out-of-memory conditions. */
+#define NEED_PRINTF_ENOMEM 1
+
+/* Define if the vasnprintf implementation needs special code for the # flag
+ with a zero precision and a zero value in the 'x' and 'X' directives. */
+/* #undef NEED_PRINTF_FLAG_ALT_PRECISION_ZERO */
+
+/* Define if the vasnprintf implementation needs special code for the ' flag.
+ */
+/* #undef NEED_PRINTF_FLAG_GROUPING */
+
+/* Define if the vasnprintf implementation needs special code for the '-'
+ flag. */
+/* #undef NEED_PRINTF_FLAG_LEFTADJUST */
+
+/* Define if the vasnprintf implementation needs special code for the 0 flag.
+ */
+/* #undef NEED_PRINTF_FLAG_ZERO */
+
+/* Define if the vasnprintf implementation needs special code for infinite
+ 'double' arguments. */
+/* #undef NEED_PRINTF_INFINITE_DOUBLE */
+
+/* Define if the vasnprintf implementation needs special code for infinite
+ 'long double' arguments. */
+/* #undef NEED_PRINTF_INFINITE_LONG_DOUBLE */
+
+/* Define if the vasnprintf implementation needs special code for 'long
+ double' arguments. */
+#define NEED_PRINTF_LONG_DOUBLE 1
+
+/* Define if the vasnprintf implementation needs special code for supporting
+ large precisions without arbitrary bounds. */
+/* #undef NEED_PRINTF_UNBOUNDED_PRECISION */
+
+/* Define if the vasnwprintf implementation needs special code for the 'c'
+ directive. */
+#define NEED_WPRINTF_DIRECTIVE_C 1
+
+/* Define if the vasnwprintf implementation needs special code for the 'a'
+ directive with 'long double' arguments. */
+/* #undef NEED_WPRINTF_DIRECTIVE_LA */
+
+/* Define if the vasnwprintf implementation needs special code for the 'lc'
+ directive. */
+#define NEED_WPRINTF_DIRECTIVE_LC 1
+
+/* Name of package */
+#define PACKAGE "libintl"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-gettext@gnu.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libintl"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libintl 0.24"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libintl"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.24"
+
+/* Define if the pthread_in_use() detection is hard. */
+/* #undef PTHREAD_IN_USE_DETECTION_HARD */
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'ptrdiff_t'. */
+/* #undef PTRDIFF_T_SUFFIX */
+
+/* Define if vasnprintf exists but is overridden by gnulib. */
+/* #undef REPLACE_VASNPRINTF */
+
+/* Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe. */
+#define SETLOCALE_NULL_ALL_MTSAFE 0
+
+/* Define to 1 if setlocale (category, NULL) is multithread-safe. */
+#define SETLOCALE_NULL_ONE_MTSAFE 1
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'sig_atomic_t'. */
+/* #undef SIG_ATOMIC_T_SUFFIX */
+
+/* Define as the maximum value of type 'size_t', if the system doesn't define
+ it. */
+#ifndef SIZE_MAX
+/* # undef SIZE_MAX */
+#endif
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'size_t'. */
+/* #undef SIZE_T_SUFFIX */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if all of the C89 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
+#define STDC_HEADERS 1
+
+/* Define if the combination of the ISO C and POSIX multithreading APIs can be
+ used. */
+/* #undef USE_ISOC_AND_POSIX_THREADS */
+
+/* Define if the ISO C multithreading library can be used. */
+/* #undef USE_ISOC_THREADS */
+
+/* Define to enable the declarations of ISO C 23 Annex K types and functions. */
+#if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__)
+#undef /**/ __STDC_WANT_LIB_EXT1__
+#define __STDC_WANT_LIB_EXT1__ 1
+#endif
+
+/* Define if the POSIX multithreading library can be used. */
+#define USE_POSIX_THREADS 1
+
+/* Define if references to the POSIX multithreading library are satisfied by
+ libc. */
+/* #undef USE_POSIX_THREADS_FROM_LIBC */
+
+/* Define if references to the POSIX multithreading library should be made
+ weak. */
+/* #undef USE_POSIX_THREADS_WEAK */
+
+/* Enable extensions on AIX, Interix, z/OS. */
+#ifndef _ALL_SOURCE
+#define _ALL_SOURCE 1
+#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+#define _DARWIN_C_SOURCE 1
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+#define __EXTENSIONS__ 1
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+#define _HPUX_ALT_XOPEN_SOCKET_API 1
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+/* # undef _MINIX */
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
+#ifndef _NETBSD_SOURCE
+#define _NETBSD_SOURCE 1
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+#define _OPENBSD_SOURCE 1
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+/* # undef _POSIX_SOURCE */
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+/* # undef _POSIX_1_SOURCE */
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+#define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+#define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+#define __STDC_WANT_IEC_60559_DFP_EXT__ 1
+#endif
+/* Enable extensions specified by C23 Annex F. */
+#ifndef __STDC_WANT_IEC_60559_EXT__
+#define __STDC_WANT_IEC_60559_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
+#endif
+/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+#define __STDC_WANT_LIB_EXT2__ 1
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+#define __STDC_WANT_MATH_SPEC_FUNCS__ 1
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+#define _TANDEM_SOURCE 1
+#endif
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
+#ifndef _XOPEN_SOURCE
+/* # undef _XOPEN_SOURCE */
+#endif
+
+/* Define if the native Windows multithreading API can be used. */
+/* #undef USE_WINDOWS_THREADS */
+
+/* Version number of package */
+#define VERSION "0.24"
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wchar_t'. */
+/* #undef WCHAR_T_SUFFIX */
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wint_t'. */
+/* #undef WINT_T_SUFFIX */
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+#if defined __BIG_ENDIAN__
+#define WORDS_BIGENDIAN 1
+#endif
+#else
+#ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+#endif
+#endif
+
+/* True if the compiler says it groks GNU C version MAJOR.MINOR.
+ Except that
+ - clang groks GNU C 4.2, even on Windows, where it does not define
+ __GNUC__.
+ - The OpenMandriva-modified clang compiler pretends that it groks
+ GNU C version 13.1, but it doesn't: It does not support
+ __attribute__ ((__malloc__ (f, i))), nor does it support
+ __attribute__ ((__warning__ (message))) on a function redeclaration.
+ - Users can make clang lie as well, through the -fgnuc-version option. */
+#if defined __GNUC__ && defined __GNUC_MINOR__ && !defined __clang__
+#define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#elif defined __clang__
+/* clang really only groks GNU C 4.2. */
+#define _GL_GNUC_PREREQ(major, minor) ((major) < 4 + ((minor) <= 2))
+#else
+#define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+
+/* Define to enable the declarations of ISO C 11 types and functions. */
+/* #undef _ISOC11_SOURCE */
+
+/* Define to 1 on Solaris. */
+/* #undef _LCONV_C99 */
+
+/* Define so that AIX headers are more compatible with GNU/Linux. */
+#define _LINUX_SOURCE_COMPAT 1
+
+/* The _Noreturn keyword of C11. */
+#ifndef _Noreturn
+#if (defined __cplusplus && \
+ ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) || \
+ (defined _MSC_VER && 1900 <= _MSC_VER)) && \
+ 0)
+/* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
+#define _Noreturn [[noreturn]]
+#elif (defined __clang__ && __clang_major__ < 16 && \
+ defined _GL_WORK_AROUND_LLVM_BUG_59792)
+/* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
+ that rare LLVM bug, though you may get many false-alarm warnings. */
+#define _Noreturn
+#elif ((!defined __cplusplus || defined __clang__) && \
+ (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) || \
+ (!defined __STRICT_ANSI__ && \
+ (_GL_GNUC_PREREQ(4, 7) || \
+ (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+/* _Noreturn works as-is. */
+#elif _GL_GNUC_PREREQ(2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
+#define _Noreturn __attribute__((__noreturn__))
+#elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+#define _Noreturn __declspec(noreturn)
+#else
+#define _Noreturn
+#endif
+#endif
+
+/* For standard stat data types on VMS. */
+#define _USE_STD_STAT 1
+
+/* Define to 1 if the system predates C++11. */
+/* #undef __STDC_CONSTANT_MACROS */
+
+/* Define to 1 if the system predates C++11. */
+/* #undef __STDC_LIMIT_MACROS */
+
+/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+ signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+ invoked from such signal handlers. Such functions have some restrictions:
+ * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+ or should be listed as async-signal-safe in POSIX
+
+ section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
+ particular, are NOT async-signal-safe.
+ * All memory locations (variables and struct fields) that these functions
+ access must be marked 'volatile'. This holds for both read and write
+ accesses. Otherwise the compiler might optimize away stores to and
+ reads from such locations that occur in the program, depending on its
+ data flow analysis. For example, when the program contains a loop
+ that is intended to inspect a variable set from within a signal handler
+ while (!signal_occurred)
+ ;
+ the compiler is allowed to transform this into an endless loop if the
+ variable 'signal_occurred' is not declared 'volatile'.
+ Additionally, recall that:
+ * A signal handler should not modify errno (except if it is a handler
+ for a fatal signal and ends by raising the same signal again, thus
+ provoking the termination of the process). If it invokes a function
+ that may clobber errno, it needs to save and restore the value of
+ errno. */
+#define _GL_ASYNC_SAFE
+
+/* Attributes. */
+/* Define _GL_HAS_ATTRIBUTE only once, because on FreeBSD, with gcc < 5, if
+ gets included once again after , __has_attribute(x)
+ expands to 0 always, and redefining _GL_HAS_ATTRIBUTE would turn off all
+ attributes. */
+#ifndef _GL_HAS_ATTRIBUTE
+#if (defined __has_attribute && \
+ (!defined __clang_minor__ || \
+ (defined __apple_build_version__ ? 7000000 <= __apple_build_version__ \
+ : 5 <= __clang_major__)))
+#define _GL_HAS_ATTRIBUTE(attr) __has_attribute(__##attr##__)
+#else
+#define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+#define _GL_ATTR_alloc_size _GL_GNUC_PREREQ(4, 3)
+#define _GL_ATTR_always_inline _GL_GNUC_PREREQ(3, 2)
+#define _GL_ATTR_artificial _GL_GNUC_PREREQ(4, 3)
+#define _GL_ATTR_cold _GL_GNUC_PREREQ(4, 3)
+#define _GL_ATTR_const _GL_GNUC_PREREQ(2, 95)
+#define _GL_ATTR_deprecated _GL_GNUC_PREREQ(3, 1)
+#define _GL_ATTR_diagnose_if 0
+#define _GL_ATTR_error _GL_GNUC_PREREQ(4, 3)
+#define _GL_ATTR_externally_visible _GL_GNUC_PREREQ(4, 1)
+#define _GL_ATTR_fallthrough _GL_GNUC_PREREQ(7, 0)
+#define _GL_ATTR_format _GL_GNUC_PREREQ(2, 7)
+#define _GL_ATTR_leaf _GL_GNUC_PREREQ(4, 6)
+#define _GL_ATTR_malloc _GL_GNUC_PREREQ(3, 0)
+#ifdef _ICC
+#define _GL_ATTR_may_alias 0
+#else
+#define _GL_ATTR_may_alias _GL_GNUC_PREREQ(3, 3)
+#endif
+#define _GL_ATTR_noinline _GL_GNUC_PREREQ(3, 1)
+#define _GL_ATTR_nonnull _GL_GNUC_PREREQ(3, 3)
+#define _GL_ATTR_nonstring _GL_GNUC_PREREQ(8, 0)
+#define _GL_ATTR_nothrow _GL_GNUC_PREREQ(3, 3)
+#define _GL_ATTR_packed _GL_GNUC_PREREQ(2, 7)
+#define _GL_ATTR_pure _GL_GNUC_PREREQ(2, 96)
+#define _GL_ATTR_reproducible 0 /* not yet supported, as of GCC 14 */
+#define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ(4, 9)
+#define _GL_ATTR_sentinel _GL_GNUC_PREREQ(4, 0)
+#define _GL_ATTR_unsequenced 0 /* not yet supported, as of GCC 14 */
+#define _GL_ATTR_unused _GL_GNUC_PREREQ(2, 7)
+#define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ(3, 4)
+#endif
+#endif
+
+/* Use __has_c_attribute if available. However, do not use with
+ pre-C23 GCC, which can issue false positives if -Wpedantic. */
+#if (defined __has_c_attribute && \
+ !(_GL_GNUC_PREREQ(4, 6) && \
+ (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710))
+#define _GL_HAVE___HAS_C_ATTRIBUTE 1
+#else
+#define _GL_HAVE___HAS_C_ATTRIBUTE 0
+#endif
+
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in function declarations. There are two problems here.
+ (Last tested with gcc/g++ 14 and clang/clang++ 18.)
+
+ 1) We want that the _GL_ATTRIBUTE_* can be cumulated on the same declaration
+ in any order.
+ =========================== foo.c = foo.cc ===========================
+ __attribute__ ((__deprecated__)) [[__nodiscard__]] int bar1 (int);
+ [[__nodiscard__]] __attribute__ ((__deprecated__)) int bar2 (int);
+ ======================================================================
+ This gives a syntax error
+ - in C mode with gcc
+ , and
+ - in C++ mode with clang++ version < 16, and
+ - in C++ mode, inside extern "C" {}, still in newer clang++ versions
+ .
+ */
+/* Define if, in a function declaration, the attributes in bracket syntax
+ [[...]] must come before the attributes in __attribute__((...)) syntax.
+ If this is defined, it is best to avoid the bracket syntax, so that the
+ various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any
+ order. */
+#ifdef __cplusplus
+#if defined __clang__
+#define _GL_BRACKET_BEFORE_ATTRIBUTE 1
+#endif
+#else
+#if defined __GNUC__ && !defined __clang__
+#define _GL_BRACKET_BEFORE_ATTRIBUTE 1
+#endif
+#endif
+/*
+ 2) We want that the _GL_ATTRIBUTE_* can be placed in a declaration
+ - without 'extern', in C as well as in C++,
+ - with 'extern', in C,
+ - with 'extern "C"', in C++
+ in the same position. That is, we don't want to be forced to use a
+ macro which arranges for the attribute to come before 'extern' in
+ one case and after 'extern' in the other case, because such a macro
+ would make the source code of .h files pretty ugly.
+ =========================== foo.c = foo.cc ===========================
+ #ifdef __cplusplus
+ # define CC "C"
+ #else
+ # define CC
+ #endif
+
+ #define ND [[__nodiscard__]]
+ #define WUR __attribute__((__warn_unused_result__))
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ // gcc clang g++ clang++
+
+ ND int foo (int);
+ int ND foo (int); // warn error warn error
+ int foo ND (int);
+ int foo (int) ND; // warn error warn error
+
+ WUR int foo (int);
+ int WUR foo (int);
+ int fo1 WUR (int); // error error error error
+ int foo (int) WUR;
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+ // gcc clang g++ clang++
+
+ ND extern CC int foo (int); // error error
+ extern CC ND int foo (int); // error error
+ extern CC int ND foo (int); // warn error warn error
+ extern CC int foo ND (int);
+ extern CC int foo (int) ND; // warn error warn error
+
+ WUR extern CC int foo (int); // warn
+ extern CC WUR int foo (int);
+ extern CC int WUR foo (int);
+ extern CC int foo WUR (int); // error error error error
+ extern CC int foo (int) WUR;
+
+ ND EXTERN_C_FUNC int foo (int); // error error
+ EXTERN_C_FUNC ND int foo (int);
+ EXTERN_C_FUNC int ND foo (int); // warn error warn error
+ EXTERN_C_FUNC int foo ND (int);
+ EXTERN_C_FUNC int foo (int) ND; // warn error warn error
+
+ WUR EXTERN_C_FUNC int foo (int); // warn
+ EXTERN_C_FUNC WUR int foo (int);
+ EXTERN_C_FUNC int WUR foo (int);
+ EXTERN_C_FUNC int fo2 WUR (int); // error error error error
+ EXTERN_C_FUNC int foo (int) WUR;
+ ======================================================================
+ So, if we insist on using the 'extern' keyword ('extern CC' idiom):
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
+ in both C and C++, there is one available position:
+ - between the function name and the parameter list.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
+ in both C and C++, there are several available positions:
+ - before the return type,
+ - between return type and function name,
+ - at the end of the declaration.
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
+ __attribute__((...)) syntax in C++, there is no available position:
+ it would need to come before 'extern' in C but after 'extern "C"'
+ in C++.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
+ to bracket syntax [[...]] in C++, there is one available position:
+ - before the return type.
+ Whereas, if we use the 'EXTERN_C_FUNC' idiom, which conditionally
+ omits the 'extern' keyword:
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]]
+ in both C and C++, there are two available positions:
+ - before the return type,
+ - between the function name and the parameter list.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax
+ in both C and C++, there are several available positions:
+ - before the return type,
+ - between return type and function name,
+ - at the end of the declaration.
+ * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to
+ __attribute__((...)) syntax in C++, there is one available position:
+ - before the return type.
+ * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and
+ to bracket syntax [[...]] in C++, there is one available position:
+ - before the return type.
+ The best choice is therefore to use the 'EXTERN_C_FUNC' idiom and
+ put the attributes before the return type. This works regardless
+ to what the _GL_ATTRIBUTE_* macros expand.
+ */
+
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in static/inline function definitions.
+
+ There are similar constraints as for function declarations. However, here,
+ we cannot omit the storage-class specifier. Therefore, the following rule
+ applies:
+ * The macros
+ _GL_ATTRIBUTE_CONST
+ _GL_ATTRIBUTE_DEPRECATED
+ _GL_ATTRIBUTE_MAYBE_UNUSED
+ _GL_ATTRIBUTE_NODISCARD
+ _GL_ATTRIBUTE_PURE
+ _GL_ATTRIBUTE_REPRODUCIBLE
+ _GL_ATTRIBUTE_UNSEQUENCED
+ which may expand to bracket syntax [[...]], must come first, before the
+ storage-class specifier.
+ * Other _GL_ATTRIBUTE_* macros, that expand to __attribute__((...)) syntax,
+ are better placed between the storage-class specifier and the return
+ type.
+ */
+
+/* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...))
+ syntax, in variable declarations.
+
+ At which position can they be placed?
+ (Last tested with gcc/g++ 14 and clang/clang++ 18.)
+
+ =========================== foo.c = foo.cc ===========================
+ #ifdef __cplusplus
+ # define CC "C"
+ #else
+ # define CC
+ #endif
+
+ #define BD [[__deprecated__]]
+ #define AD __attribute__ ((__deprecated__))
+
+ // gcc clang g++ clang++
+
+ BD extern CC int var; // error error
+ extern CC BD int var; // error error
+ extern CC int BD var; // warn error warn error
+ extern CC int var BD;
+
+ AD extern CC int var; // warn
+ extern CC AD int var;
+ extern CC int AD var;
+ extern CC int var AD;
+
+ BD extern CC int z[]; // error error
+ extern CC BD int z[]; // error error
+ extern CC int BD z[]; // warn error warn error
+ extern CC int z1 BD [];
+ extern CC int z[] BD; // warn error error
+
+ AD extern CC int z[]; // warn
+ extern CC AD int z[];
+ extern CC int AD z[];
+ extern CC int z2 AD []; // error error error error
+ extern CC int z[] AD;
+ ======================================================================
+
+ * For non-array variables, the only good position is after the variable name,
+ that is, at the end of the declaration.
+ * For array variables, you will need to distinguish C and C++:
+ - In C, before the 'extern' keyword.
+ - In C++, between the 'extern "C"' and the variable's type.
+ */
+
+/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
+ is the size of the returned memory block.
+ _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
+ by the Nth argument of the function is the size of the returned memory block.
+ */
+/* Applies to: functions, pointer to functions, function types. */
+#ifndef _GL_ATTRIBUTE_ALLOC_SIZE
+#if _GL_HAS_ATTRIBUTE(alloc_size)
+#define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
+#else
+#define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
+ function and report an error if it cannot do so. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
+#if _GL_HAS_ATTRIBUTE(always_inline)
+#define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__((__always_inline__))
+#else
+#define _GL_ATTRIBUTE_ALWAYS_INLINE
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
+ in stack traces when debugging. The compiler should omit the function from
+ stack traces. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_ARTIFICIAL
+#if _GL_HAS_ATTRIBUTE(artificial)
+#define _GL_ATTRIBUTE_ARTIFICIAL __attribute__((__artificial__))
+#else
+#define _GL_ATTRIBUTE_ARTIFICIAL
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */
+/* Applies to: functions. */
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+ .
+ Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
+#ifndef _GL_ATTRIBUTE_COLD
+#if _GL_HAS_ATTRIBUTE(cold) && !defined __MINGW32__
+#ifndef __SUNPRO_C
+#define _GL_ATTRIBUTE_COLD __attribute__((__cold__))
+#else
+#define _GL_ATTRIBUTE_COLD __attribute__((cold))
+#endif
+#else
+#define _GL_ATTRIBUTE_COLD
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_CONST declares:
+ It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used.
+ This attribute is safe for a function that neither depends on
+ nor affects state, and always returns exactly once -
+ e.g., does not raise an exception, call longjmp, or loop forever.
+ (This attribute is stricter than _GL_ATTRIBUTE_PURE because the
+ function cannot observe state. It is stricter than
+ _GL_ATTRIBUTE_UNSEQUENCED because the function must return exactly
+ once and cannot depend on state addressed by its arguments.) */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_CONST
+#if _GL_HAS_ATTRIBUTE(const)
+#define _GL_ATTRIBUTE_CONST __attribute__((__const__))
+#else
+#define _GL_ATTRIBUTE_CONST _GL_ATTRIBUTE_UNSEQUENCED
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F.
+ _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+#if _GL_GNUC_PREREQ(11, 0)
+#define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__((__malloc__(f, i)))
+#else
+#define _GL_ATTRIBUTE_DEALLOC(f, i)
+#endif
+#endif
+/* If gnulib's or has already defined this macro, continue
+ to use this earlier definition, since may not have been included
+ yet. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+#if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug */
+#define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC((void (*)(void*))free, 1)
+#else
+#define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC(free, 1)
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
+ The compiler may warn if the entity is used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: namespace, class, template specialization. */
+#ifndef _GL_ATTRIBUTE_DEPRECATED
+#ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+#if _GL_HAVE___HAS_C_ATTRIBUTE
+#if __has_c_attribute(__deprecated__)
+#define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+#endif
+#endif
+#endif
+#if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE(deprecated)
+#define _GL_ATTRIBUTE_DEPRECATED __attribute__((__deprecated__))
+#endif
+#ifndef _GL_ATTRIBUTE_DEPRECATED
+#define _GL_ATTRIBUTE_DEPRECATED
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and
+ the function call is not optimized away.
+ _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and
+ the function call is not optimized away. */
+/* Applies to: functions. */
+#if !(defined _GL_ATTRIBUTE_ERROR && defined _GL_ATTRIBUTE_WARNING)
+#if _GL_HAS_ATTRIBUTE(error)
+#define _GL_ATTRIBUTE_ERROR(msg) __attribute__((__error__(msg)))
+#define _GL_ATTRIBUTE_WARNING(msg) __attribute__((__warning__(msg)))
+#elif _GL_HAS_ATTRIBUTE(diagnose_if)
+#define _GL_ATTRIBUTE_ERROR(msg) \
+ __attribute__((__diagnose_if__(1, msg, "error")))
+#define _GL_ATTRIBUTE_WARNING(msg) \
+ __attribute__((__diagnose_if__(1, msg, "warning")))
+#else
+#define _GL_ATTRIBUTE_ERROR(msg)
+#define _GL_ATTRIBUTE_WARNING(msg)
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain
+ visible to debuggers etc., even with '-fwhole-program'. */
+/* Applies to: functions, variables. */
+#ifndef _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#if _GL_HAS_ATTRIBUTE(externally_visible)
+#define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__((externally_visible))
+#else
+#define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if
+ the control flow falls through to the immediately following 'case' or
+ 'default' label. The compiler should not warn in this case. */
+/* Applies to: Empty statement (;), inside a 'switch' statement. */
+/* Always expands to something. */
+#ifndef _GL_ATTRIBUTE_FALLTHROUGH
+#if _GL_HAVE___HAS_C_ATTRIBUTE
+#if __has_c_attribute(__fallthrough__)
+#define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+#endif
+#endif
+#if !defined _GL_ATTRIBUTE_FALLTHROUGH && _GL_HAS_ATTRIBUTE(fallthrough)
+#define _GL_ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
+#endif
+#ifndef _GL_ATTRIBUTE_FALLTHROUGH
+#define _GL_ATTRIBUTE_FALLTHROUGH ((void)0)
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
+ declares that the STRING-INDEXth function argument is a format string of
+ style ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_FORMAT
+#if _GL_HAS_ATTRIBUTE(format)
+#define _GL_ATTRIBUTE_FORMAT(spec) __attribute__((__format__ spec))
+#else
+#define _GL_ATTRIBUTE_FORMAT(spec)
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other
+ compilation unit, it executes code from that unit only by return or by
+ exception handling. This declaration lets the compiler optimize that unit
+ more aggressively. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_LEAF
+#if _GL_HAS_ATTRIBUTE(leaf)
+#define _GL_ATTRIBUTE_LEAF __attribute__((__leaf__))
+#else
+#define _GL_ATTRIBUTE_LEAF
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+#if _GL_HAS_ATTRIBUTE(malloc)
+#define _GL_ATTRIBUTE_MALLOC __attribute__((__malloc__))
+#else
+#define _GL_ATTRIBUTE_MALLOC
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the
+ same storage as pointers to other types. Thus this declaration disables
+ strict aliasing optimization. */
+/* Applies to: types. */
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
+#ifndef _GL_ATTRIBUTE_MAY_ALIAS
+#if _GL_HAS_ATTRIBUTE(may_alias) && !defined __SUNPRO_C
+#define _GL_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
+#else
+#define _GL_ATTRIBUTE_MAY_ALIAS
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
+ the entity is not used. The compiler should not warn if the entity is not
+ used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: class. */
+/* In C++ and C23, this is spelled [[__maybe_unused__]].
+ GCC's syntax is __attribute__ ((__unused__)).
+ clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode,
+ __has_c_attribute (__maybe_unused__) yields true but the use of
+ [[__maybe_unused__]] nevertheless produces a warning. */
+#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+#ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+#if defined __clang__ && defined __cplusplus
+#if !defined __apple_build_version__ && __clang_major__ >= 10
+#define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#endif
+#elif _GL_HAVE___HAS_C_ATTRIBUTE
+#if __has_c_attribute(__maybe_unused__)
+#define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#endif
+#endif
+#endif
+#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+#define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
+#endif
+#endif
+/* Alternative spelling of this macro, for convenience and for
+ compatibility with glibc/include/libc-symbols.h. */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+/* Earlier spellings of this macro. */
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not
+ discard the return value. The compiler may warn if the caller does not use
+ the return value, unless the caller uses something like ignore_value. */
+/* Applies to: function, enumeration, class. */
+#ifndef _GL_ATTRIBUTE_NODISCARD
+#ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+#if defined __clang__ && defined __cplusplus
+/* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces
+ a warning.
+ The 1000 below means a yet unknown threshold. When clang++ version X
+ starts supporting [[__nodiscard__]] without warning about it, you can
+ replace the 1000 with X. */
+#if __clang_major__ >= 1000
+#define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#endif
+#elif _GL_HAVE___HAS_C_ATTRIBUTE
+#if __has_c_attribute(__nodiscard__)
+#define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#endif
+#endif
+#endif
+#if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE(warn_unused_result)
+#define _GL_ATTRIBUTE_NODISCARD __attribute__((__warn_unused_result__))
+#endif
+#ifndef _GL_ATTRIBUTE_NODISCARD
+#define _GL_ATTRIBUTE_NODISCARD
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the
+ function. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NOINLINE
+#if _GL_HAS_ATTRIBUTE(noinline)
+#define _GL_ATTRIBUTE_NOINLINE __attribute__((__noinline__))
+#else
+#define _GL_ATTRIBUTE_NOINLINE
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
+ must not be NULL.
+ _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be
+ null. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NONNULL
+#if _GL_HAS_ATTRIBUTE(nonnull)
+#define _GL_ATTRIBUTE_NONNULL(args) __attribute__((__nonnull__ args))
+#else
+#define _GL_ATTRIBUTE_NONNULL(args)
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
+ not meant to be NUL-terminated. */
+/* Applies to: struct/union members and variables that are arrays of element
+ type '[[un]signed] char'. */
+#ifndef _GL_ATTRIBUTE_NONSTRING
+#if _GL_HAS_ATTRIBUTE(nonstring)
+#define _GL_ATTRIBUTE_NONSTRING __attribute__((__nonstring__))
+#else
+#define _GL_ATTRIBUTE_NONSTRING
+#endif
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
+
+/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
+ */
+/* Applies to: functions. */
+/* After a function's parameter list, this attribute must come first, before
+ other attributes. */
+#ifndef _GL_ATTRIBUTE_NOTHROW
+#if defined __cplusplus
+#if _GL_GNUC_PREREQ(2, 8) || __clang_major__ >= 4
+#if __cplusplus >= 201103L
+#define _GL_ATTRIBUTE_NOTHROW noexcept(true)
+#else
+#define _GL_ATTRIBUTE_NOTHROW throw()
+#endif
+#else
+#define _GL_ATTRIBUTE_NOTHROW
+#endif
+#else
+#if _GL_HAS_ATTRIBUTE(nothrow)
+#define _GL_ATTRIBUTE_NOTHROW __attribute__((__nothrow__))
+#else
+#define _GL_ATTRIBUTE_NOTHROW
+#endif
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_PACKED declares:
+ For struct members: The member has the smallest possible alignment.
+ For struct, union, class: All members have the smallest possible alignment,
+ minimizing the memory required. */
+/* Applies to: struct members, struct, union,
+ in C++ also: class. */
+#ifndef _GL_ATTRIBUTE_PACKED
+/* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__)) despite
+ __has_attribute OK. */
+#if _GL_HAS_ATTRIBUTE(packed) && !defined __SUNPRO_C
+#define _GL_ATTRIBUTE_PACKED __attribute__((__packed__))
+#else
+#define _GL_ATTRIBUTE_PACKED
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_PURE declares:
+ It is OK for a compiler to move calls to the function and to omit
+ calls to the function if another call has the same arguments or the
+ result is not used, and if observable state is the same.
+ This attribute is safe for a function that does not affect observable state
+ and always returns exactly once.
+ (This attribute is looser than _GL_ATTRIBUTE_CONST because the function
+ can depend on observable state. It is stricter than
+ _GL_ATTRIBUTE_REPRODUCIBLE because the function must return exactly
+ once and cannot affect state addressed by its arguments.) */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_PURE
+#if _GL_HAS_ATTRIBUTE(pure)
+#define _GL_ATTRIBUTE_PURE __attribute__((__pure__))
+#else
+#define _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_REPRODUCIBLE
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_REPRODUCIBLE declares:
+ It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same and is updated in time for
+ the rest of the program.
+ This attribute is safe for a function that is effectless and idempotent; see
+ ISO C 23 § 6.7.12.7 for a definition of these terms.
+ (This attribute is looser than _GL_ATTRIBUTE_UNSEQUENCED because
+ the function need not be stateless and idempotent. It is looser
+ than _GL_ATTRIBUTE_PURE because the function need not return
+ exactly once and can affect state addressed by its arguments.)
+ See also and
+ .
+ ATTENTION! Efforts are underway to change the meaning of this attribute.
+ See . */
+/* Applies to: functions, pointer to functions, function types. */
+#ifndef _GL_ATTRIBUTE_REPRODUCIBLE
+/* This may be revisited when gcc and clang support [[reproducible]] or possibly
+ __attribute__ ((__reproducible__)). */
+#ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+#if _GL_HAS_ATTRIBUTE(reproducible)
+#define _GL_ATTRIBUTE_REPRODUCIBLE [[reproducible]]
+#endif
+#endif
+#ifndef _GL_ATTRIBUTE_REPRODUCIBLE
+#define _GL_ATTRIBUTE_REPRODUCIBLE
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is
+ a non-NULL pointer. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_RETURNS_NONNULL
+#if _GL_HAS_ATTRIBUTE(returns_nonnull)
+#define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__((__returns_nonnull__))
+#else
+#define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a
+ trailing NULL argument.
+ _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
+ _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_SENTINEL
+#if _GL_HAS_ATTRIBUTE(sentinel)
+#define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__((__sentinel__ pos))
+#else
+#define _GL_ATTRIBUTE_SENTINEL(pos)
+#endif
+#endif
+
+/* _GL_ATTRIBUTE_UNSEQUENCED declares:
+ It is OK for a compiler to move calls to the function and to omit duplicate
+ calls to the function with the same arguments, so long as the state
+ addressed by its arguments is the same.
+ This attribute is safe for a function that is effectless, idempotent,
+ stateless, and independent; see ISO C 23 § 6.7.12.7 for a definition of
+ these terms.
+ (This attribute is stricter than _GL_ATTRIBUTE_REPRODUCIBLE because
+ the function must be stateless and independent. It is looser than
+ _GL_ATTRIBUTE_CONST because the function need not return exactly
+ once and can depend on state addressed by its arguments.)
+ See also and
+ .
+ ATTENTION! Efforts are underway to change the meaning of this attribute.
+ See . */
+/* Applies to: functions, pointer to functions, function types. */
+#ifndef _GL_ATTRIBUTE_UNSEQUENCED
+/* This may be revisited when gcc and clang support [[unsequenced]] or possibly
+ __attribute__ ((__unsequenced__)). */
+#ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+#if _GL_HAS_ATTRIBUTE(unsequenced)
+#define _GL_ATTRIBUTE_UNSEQUENCED [[unsequenced]]
+#endif
+#endif
+#ifndef _GL_ATTRIBUTE_UNSEQUENCED
+#define _GL_ATTRIBUTE_UNSEQUENCED
+#endif
+#endif
+
+/* A helper macro. Don't use it directly. */
+#ifndef _GL_ATTRIBUTE_UNUSED
+#if _GL_HAS_ATTRIBUTE(unused)
+#define _GL_ATTRIBUTE_UNUSED __attribute__((__unused__))
+#else
+#define _GL_ATTRIBUTE_UNUSED
+#endif
+#endif
+
+/* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the
+ immediately preceding label is not used. The compiler should not warn
+ if the label is not used. */
+/* Applies to: label (both in C and C++). */
+/* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
+ syntax. But clang does. */
+#ifndef _GL_UNUSED_LABEL
+#if !(defined __cplusplus && !_GL_GNUC_PREREQ(4, 5)) || defined __clang__
+#define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
+#else
+#define _GL_UNUSED_LABEL
+#endif
+#endif
+
+/* The following attributes enable detection of multithread-safety problems
+ and resource leaks at compile-time, by clang ≥ 15, when the warning option
+ -Wthread-safety is enabled. For usage, see
+ . */
+#ifndef _GL_ATTRIBUTE_CAPABILITY_TYPE
+#if __clang_major__ >= 15
+#define _GL_ATTRIBUTE_CAPABILITY_TYPE(concept) \
+ __attribute__((__capability__(concept)))
+#else
+#define _GL_ATTRIBUTE_CAPABILITY_TYPE(concept)
+#endif
+#endif
+#ifndef _GL_ATTRIBUTE_ACQUIRE_CAPABILITY
+#if __clang_major__ >= 15
+#define _GL_ATTRIBUTE_ACQUIRE_CAPABILITY(resource) \
+ __attribute__((__acquire_capability__(resource)))
+#else
+#define _GL_ATTRIBUTE_ACQUIRE_CAPABILITY(resource)
+#endif
+#endif
+#ifndef _GL_ATTRIBUTE_RELEASE_CAPABILITY
+#if __clang_major__ >= 15
+#define _GL_ATTRIBUTE_RELEASE_CAPABILITY(resource) \
+ __attribute__((__release_capability__(resource)))
+#else
+#define _GL_ATTRIBUTE_RELEASE_CAPABILITY(resource)
+#endif
+#endif
+
+/* In C++, there is the concept of "language linkage", that encompasses
+ name mangling and function calling conventions.
+ The following macros start and end a block of "C" linkage. */
+#ifdef __cplusplus
+#define _GL_BEGIN_C_LINKAGE extern "C" {
+#define _GL_END_C_LINKAGE }
+#else
+#define _GL_BEGIN_C_LINKAGE
+#define _GL_END_C_LINKAGE
+#endif
+
+/* Hidden symbol. */
+/* #undef frexp */
+
+/* Hidden symbol. */
+/* #undef frexpl */
+
+/* Define to '__inline__' or '__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to long or long long if and don't define. */
+/* #undef intmax_t */
+
+/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+ the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+ earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+ __APPLE__ && __MACH__ test for Mac OS X.
+ __APPLE_CC__ tests for the Apple compiler and its version.
+ __STDC_VERSION__ tests for the C99 mode. */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && \
+ !defined __cplusplus && __STDC_VERSION__ >= 199901L && \
+ !defined __GNUC_STDC_INLINE__
+#define __GNUC_STDC_INLINE__ 1
+#endif
+
+/* Hidden symbol. */
+/* #undef mbrtowc */
+
+/* Hidden symbol. */
+/* #undef mbsinit */
+
+/* Define to a type if does not define. */
+/* #undef mbstate_t */
+
+/* Hidden symbol. */
+/* #undef memchr */
+
+/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
+ n1 and n2 are expressions without side effects, that evaluate to real
+ numbers (excluding NaN).
+ It returns
+ 1 if n1 > n2
+ 0 if n1 == n2
+ -1 if n1 < n2
+ The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
+ jump with nearly all GCC versions up to GCC 10.
+ This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
+ GCC versions up to GCC 9.
+ The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
+ avoids conditional jumps in all GCC versions >= 3.4. */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+
+/* Define to 'int' if does not define. */
+/* #undef mode_t */
+
+/* Define as a signed integer type capable of holding a process identifier. */
+/* #undef pid_t */
+
+/* Define as the type of the result of subtracting two pointers, if the system
+ doesn't define it. */
+/* #undef ptrdiff_t */
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported only directly. */
+#define restrict __restrict__
+/* Work around a bug in older versions of Sun C++, which did not
+ #define __restrict__ or support _Restrict or __restrict__
+ even though the corresponding Sun C compiler ended up with
+ "#define restrict _Restrict" or "#define restrict __restrict__"
+ in the previous line. This workaround can be removed once
+ we assume Oracle Developer Studio 12.5 (2016) or later. */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
+#define _Restrict
+#define __restrict__
+#endif
+
+/* Hidden symbol. */
+/* #undef rpl_fgetc */
+
+/* Hidden symbol. */
+/* #undef rpl_fgets */
+
+/* Hidden symbol. */
+/* #undef rpl_fprintf */
+
+/* Hidden symbol. */
+/* #undef rpl_fputc */
+
+/* Hidden symbol. */
+/* #undef rpl_fputs */
+
+/* Hidden symbol. */
+/* #undef rpl_fread */
+
+/* Hidden symbol. */
+/* #undef rpl_frexp */
+
+/* Hidden symbol. */
+/* #undef rpl_frexpl */
+
+/* Hidden symbol. */
+/* #undef rpl_fscanf */
+
+/* Hidden symbol. */
+/* #undef rpl_fwrite */
+
+/* Hidden symbol. */
+/* #undef rpl_mbrtowc */
+
+/* Hidden symbol. */
+/* #undef rpl_mbsinit */
+
+/* Hidden symbol. */
+/* #undef rpl_memchr */
+
+/* Hidden symbol. */
+/* #undef rpl_tdelete */
+
+/* Hidden symbol. */
+/* #undef rpl_tfind */
+
+/* Hidden symbol. */
+/* #undef rpl_tsearch */
+
+/* Hidden symbol. */
+/* #undef rpl_twalk */
+
+/* Hidden symbol. */
+/* #undef rpl_vfprintf */
+
+/* Define as 'unsigned int' if doesn't define. */
+/* #undef size_t */
+
+/* Define as a signed type of the same size as size_t. */
+/* #undef ssize_t */
+
+/* Hidden symbol. */
+/* #undef tdelete */
+
+/* Hidden symbol. */
+/* #undef tfind */
+
+/* Hidden symbol. */
+/* #undef tsearch */
+
+/* Hidden symbol. */
+/* #undef twalk */
+
+#define __libc_lock_t gl_lock_t
+#define __libc_lock_define gl_lock_define
+#define __libc_lock_define_initialized gl_lock_define_initialized
+#define __libc_lock_init gl_lock_init
+#define __libc_lock_lock gl_lock_lock
+#define __libc_lock_unlock gl_lock_unlock
+#define __libc_lock_recursive_t gl_recursive_lock_t
+#define __libc_lock_define_recursive gl_recursive_lock_define
+#define __libc_lock_define_initialized_recursive \
+ gl_recursive_lock_define_initialized
+#define __libc_lock_init_recursive gl_recursive_lock_init
+#define __libc_lock_lock_recursive gl_recursive_lock_lock
+#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
+
+#define asnprintf _libintl_asnprintf
+#define rpl_asnprintf _libintl_asnprintf
+/* Symbols defined by main intl code. The prefix '_nl_' is used by glibc.
+ For hiding the symbols on AIX and Solaris 10 with compilers that don't
+ support the __visibility__ attribute, map them to prefix '_libintl_'. */
+#define _nl_explode_name _libintl_explode_name
+#define _nl_find_domain _libintl_find_domain
+#define _nl_find_msg _libintl_find_msg
+#define _nl_language_preferences_default _libintl_language_preferences_default
+#define _nl_load_domain _libintl_load_domain
+#define _nl_log_untranslated _libintl_log_untranslated
+#define _nl_make_l10nflist _libintl_make_l10nflist
+#define _nl_normalize_codeset _libintl_normalize_codeset
+#define _nl_state_lock _libintl_state_lock
+/* Symbols defined by gnulib module 'float'. */
+#define gl_LDBL_MAX _libintl_LDBL_MAX
+/* Symbols defined by gnulib module 'free-posix'. */
+#define rpl_free _libintl_free
+/* Symbols defined by gnulib module 'hard-locale'. */
+#define hard_locale _libintl_hard_locale
+/* Symbols defined by gnulib module 'isnand-nolibm'. */
+#define rpl_isnand _libintl_isnand
+/* Symbols defined by gnulib module 'isnanf-nolibm'. */
+#define rpl_isnanf _libintl_isnanf
+/* Symbols defined by gnulib module 'isnanl-nolibm'. */
+#define rpl_isnanl _libintl_isnanl
+/* Symbols defined by gnulib module 'localename'. */
+#define gl_locale_name_thread _libintl_locale_name_thread
+#define gl_locale_name_posix _libintl_locale_name_posix
+#define gl_locale_name _libintl_locale_name
+/* Symbols defined by gnulib module 'localename-unsafe'. */
+#define gl_locale_name_canonicalize _libintl_locale_name_canonicalize
+#define gl_locale_name_from_win32_LANGID _libintl_locale_name_from_win32_LANGID
+#define gl_locale_name_from_win32_LCID _libintl_locale_name_from_win32_LCID
+#define gl_locale_name_thread_unsafe _libintl_locale_name_thread_unsafe
+#define gl_locale_name_posix_unsafe _libintl_locale_name_posix_unsafe
+#define gl_locale_name_environ _libintl_locale_name_environ
+#define gl_locale_name_default _libintl_locale_name_default
+#define gl_locale_name_unsafe _libintl_locale_name_unsafe
+#define rpl_newlocale _libintl_newlocale
+#define rpl_duplocale _libintl_duplocale
+#define rpl_freelocale _libintl_freelocale
+/* Symbols defined by gnulib module 'lock'. */
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+#define glthread_lock_init _libintl_lock_init
+#define glthread_lock_lock _libintl_lock_lock
+#define glthread_lock_unlock _libintl_lock_unlock
+#define glthread_lock_destroy _libintl_lock_destroy
+#define glthread_rwlock_init _libintl_rwlock_init
+#define glthread_rwlock_rdlock _libintl_rwlock_rdlock
+#define glthread_rwlock_wrlock _libintl_rwlock_wrlock
+#define glthread_rwlock_unlock _libintl_rwlock_unlock
+#define glthread_rwlock_destroy _libintl_rwlock_destroy
+#define glthread_recursive_lock_init _libintl_recursive_lock_init
+#define glthread_recursive_lock_lock _libintl_recursive_lock_lock
+#define glthread_recursive_lock_unlock _libintl_recursive_lock_unlock
+#define glthread_recursive_lock_destroy _libintl_recursive_lock_destroy
+#endif
+#define glthread_rwlock_init_for_glibc _libintl_rwlock_init_for_glibc
+#define glthread_rwlock_init_multithreaded _libintl_rwlock_init_multithreaded
+#define glthread_rwlock_rdlock_multithreaded \
+ _libintl_rwlock_rdlock_multithreaded
+#define glthread_rwlock_wrlock_multithreaded \
+ _libintl_rwlock_wrlock_multithreaded
+#define glthread_rwlock_unlock_multithreaded \
+ _libintl_rwlock_unlock_multithreaded
+#define glthread_rwlock_destroy_multithreaded \
+ _libintl_rwlock_destroy_multithreaded
+#define glthread_recursive_lock_init_multithreaded \
+ _libintl_recursive_lock_init_multithreaded
+#define glthread_recursive_lock_lock_multithreaded \
+ _libintl_recursive_lock_lock_multithreaded
+#define glthread_recursive_lock_unlock_multithreaded \
+ _libintl_recursive_lock_unlock_multithreaded
+#define glthread_recursive_lock_destroy_multithreaded \
+ _libintl_recursive_lock_destroy_multithreaded
+#define glthread_once_singlethreaded _libintl_once_singlethreaded
+#define glthread_once_multithreaded _libintl_once_multithreaded
+/* Symbols defined by gnulib module 'mbszero'. */
+#define mbszero _libintl_mbszero
+/* Symbols defined by gnulib module 'printf-frexp'. */
+#define printf_frexp _libintl_printf_frexp
+/* Symbols defined by gnulib module 'printf-frexpl'. */
+#define printf_frexpl _libintl_printf_frexpl
+/* Symbols defined by gnulib module 'setlocale-null'. */
+#define setlocale_null _libintl_setlocale_null
+#define setlocale_null_r _libintl_setlocale_null_r
+/* Symbols defined by gnulib module 'setlocale-null-unlocked'. */
+#define setlocale_null_unlocked _libintl_setlocale_null_unlocked
+#define setlocale_null_r_unlocked _libintl_setlocale_null_r_unlocked
+/* Symbols defined by gnulib module 'signbit'. */
+#define gl_signbitf _libintl_signbitf
+#define gl_signbitd _libintl_signbitd
+#define gl_signbitl _libintl_signbitl
+/* Symbols defined by gnulib module 'threadlib'. */
+#define glthread_in_use _libintl_glthread_in_use
+/* Symbols defined by gnulib module 'vasnprintf'. */
+#define printf_fetchargs _libintl_printf_fetchargs
+#define printf_parse _libintl_printf_parse
+#define vasnprintf _libintl_vasnprintf
+#define rpl_vasnprintf _libintl_vasnprintf
+/* Symbols defined by gnulib module 'vasnwprintf'. */
+#define asnwprintf _libintl_asnwprintf
+#define wprintf_parse _libintl_wprintf_parse
+#define vasnwprintf _libintl_vasnwprintf
+/* Symbols defined by gnulib module 'windows-mutex'. */
+#define glwthread_mutex_init _libintl_glwthread_mutex_init
+#define glwthread_mutex_lock _libintl_glwthread_mutex_lock
+#define glwthread_mutex_trylock _libintl_glwthread_mutex_trylock
+#define glwthread_mutex_unlock _libintl_glwthread_mutex_unlock
+#define glwthread_mutex_destroy _libintl_glwthread_mutex_destroy
+/* Symbols defined by gnulib module 'windows-once'. */
+#define glwthread_once _libintl_glwthread_once
+/* Symbols defined by gnulib module 'windows-recmutex'. */
+#define glwthread_recmutex_init _libintl_glwthread_recmutex_init
+#define glwthread_recmutex_lock _libintl_glwthread_recmutex_lock
+#define glwthread_recmutex_trylock _libintl_glwthread_recmutex_trylock
+#define glwthread_recmutex_unlock _libintl_glwthread_recmutex_unlock
+#define glwthread_recmutex_destroy _libintl_glwthread_recmutex_destroy
+/* Symbols defined by gnulib module 'windows-rwlock'. */
+#define glwthread_rwlock_init _libintl_glwthread_rwlock_init
+#define glwthread_rwlock_rdlock _libintl_glwthread_rwlock_rdlock
+#define glwthread_rwlock_wrlock _libintl_glwthread_rwlock_wrlock
+#define glwthread_rwlock_tryrdlock _libintl_glwthread_rwlock_tryrdlock
+#define glwthread_rwlock_trywrlock _libintl_glwthread_rwlock_trywrlock
+#define glwthread_rwlock_unlock _libintl_glwthread_rwlock_unlock
+#define glwthread_rwlock_destroy _libintl_glwthread_rwlock_destroy
+/* Symbols defined by gnulib module 'xsize'. */
+#define xmax _libintl_xmax
+#define xsum _libintl_xsum
+#define xsum3 _libintl_xsum3
+#define xsum4 _libintl_xsum4
+
+#if !(defined __cplusplus \
+ ? 1 \
+ : (defined __clang__ \
+ ? __STDC_VERSION__ >= 202000L && __clang_major__ >= 15 \
+ : (defined __GNUC__ \
+ ? __STDC_VERSION__ >= 202000L && __GNUC__ >= 13 \
+ : defined HAVE_C_BOOL)))
+#if !defined __cplusplus && !defined __bool_true_false_are_defined
+#if HAVE_STDBOOL_H
+#include
+#else
+#if defined __SUNPRO_C
+#error \
+ " is not usable with this configuration. To make it usable, add -D_STDC_C99= to $CC."
+#else
+#error \
+ " does not exist on this platform. Use gnulib module 'stdbool-c99' instead of gnulib module 'stdbool'."
+#endif
+#endif
+#endif
+#if !true
+#define true (!false)
+#endif
+#endif
+
+#if (!(defined __clang__ \
+ ? (defined __cplusplus \
+ ? __cplusplus >= 201703L \
+ : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16 && \
+ !defined __sun) \
+ : (defined __GNUC__ \
+ ? (defined __cplusplus \
+ ? __cplusplus >= 201103L && __GNUG__ >= 6 \
+ : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13 && \
+ !defined __sun) \
+ : defined HAVE_C_STATIC_ASSERT)) && \
+ !defined assert && \
+ (!defined __cplusplus || \
+ (__cpp_static_assert < 201411 && __GNUG__ < 6 && __clang_major__ < 6)))
+#include
+#undef /**/ assert
+#ifdef __sgi
+#undef /**/ __ASSERT_H__
+#endif
+/* Solaris 11.4 defines static_assert as a macro with 2 arguments.
+ We need it also to be invocable with a single argument.
+ Haiku 2022 does not define static_assert at all. */
+#if (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus
+#undef /**/ static_assert
+#define static_assert _Static_assert
+#endif
+#endif
+
+/* Tweak gnulib code according to the needs of this library. */
+#define IN_LIBINTL 1
+
+/* On Windows, variables that may be in a DLL must be marked specially.
+ The symbols marked with DLL_VARIABLE should be exported if and only if the
+ object file gets included in a DLL. Libtool, on Windows platforms, defines
+ the C macro DLL_EXPORT (together with PIC) when compiling for a shared
+ library (called DLL under Windows) and does not define it when compiling
+ an object file meant to be linked statically into some executable. */
+#if (defined _MSC_VER && defined DLL_EXPORT) && !defined IN_RELOCWRAPPER
+#define DLL_VARIABLE __declspec(dllimport)
+#else
+#define DLL_VARIABLE
+#endif
+
+/* Extra OS/2 (emx+gcc) defines. */
+#if defined __EMX__ && !defined __KLIBC__
+#include "os2compat.h"
+#endif
+
+/* ADDED FOR GHOSTTY. This is needed to ensure that all gnulib-lib
+ * source files have the locale_t type and all the LC_ constants.
+ * It looks like some files do this and some don't so we just put it
+ * here to ensure we always have it. This surely can't be the best or
+ * correct way to do this but it works.
+ *
+ * When upgrading gettext we just need to be careful about this. This
+ * is noted in the build.zig as well.
+ */
+#if HAVE_GOOD_USELOCALE
+/* Mac OS X 10.5 defines the locale_t type in . */
+#if defined __APPLE__ && defined __MACH__
+#include
+#endif
+#endif
diff --git a/vendor/libghostty-vt/pkg/libintl/libgnuintl.h b/vendor/libghostty-vt/pkg/libintl/libgnuintl.h
new file mode 100644
index 00000000..c972210f
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libintl/libgnuintl.h
@@ -0,0 +1 @@
+#include "libintl.h"
diff --git a/vendor/libghostty-vt/pkg/libintl/libintl.h b/vendor/libghostty-vt/pkg/libintl/libintl.h
new file mode 100644
index 00000000..f4930181
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libintl/libintl.h
@@ -0,0 +1,1168 @@
+/* Message catalogs for internationalization.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see . */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H 1
+
+#include
+#if (defined __APPLE__ && defined __MACH__) && 1
+#include
+#endif
+
+/* The LC_MESSAGES locale category is the category used by the functions
+ gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
+ On systems that don't define it, use an arbitrary value instead.
+ On Solaris, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
+ then includes (i.e. this file!) and then only defines
+ LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
+ in this case. */
+#if !defined LC_MESSAGES && \
+ !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
+#define LC_MESSAGES 1729
+#endif
+
+/* We define an additional symbol to signal that we use the GNU
+ implementation of gettext. */
+#define __USE_GNU_GETTEXT 1
+
+/* Provide information about the supported file formats. Returns the
+ maximum minor revision number supported for a given major revision. */
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
+ ((major) == 0 || (major) == 1 ? 1 : -1)
+
+/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
+ precedence over _conio_gettext. */
+#ifdef __DJGPP__
+#undef gettext
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Version number: (major<<16) + (minor<<8) + subminor */
+#define LIBINTL_VERSION 0x001800
+extern int libintl_version;
+
+/* We redirect the functions to those prefixed with "libintl_". This is
+ necessary, because some systems define gettext/textdomain/... in the C
+ library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
+ If we used the unprefixed names, there would be cases where the
+ definition in the C library would override the one in the libintl.so
+ shared library. Recall that on ELF systems, the symbols are looked
+ up in the following order:
+ 1. in the executable,
+ 2. in the shared libraries specified on the link command line, in order,
+ 3. in the dependencies of the shared libraries specified on the link
+ command line,
+ 4. in the dlopen()ed shared libraries, in the order in which they were
+ dlopen()ed.
+ The definition in the C library would override the one in libintl.so if
+ either
+ * -lc is given on the link command line and -lintl isn't, or
+ * -lc is given on the link command line before -lintl, or
+ * libintl.so is a dependency of a dlopen()ed shared library but not
+ linked to the executable at link time.
+ Since Solaris gettext() behaves differently than GNU gettext(), this
+ would be unacceptable.
+
+ For the redirection, three mechanisms are available:
+ * _INTL_REDIRECT_ASM uses a function declaration with 'asm', that
+ specifies a different symbol at the linker level than at the C level.
+ * _INTL_REDIRECT_INLINE uses an inline function definition. In C,
+ we use 'static inline' to force the override. In C++, it is better
+ to use 'inline' without 'static'. But since the override is only
+ effective if the inlining happens, we need to use
+ __attribute__ ((__always_inline__)), which is supported in g++ >= 3.1
+ and clang. MSVC has a similar keyword __forceinline (see
+ ),
+ but it has an effect only when optimizing is enabled, and there is no
+ preprocessor macro that tells us whether optimizing is enabled.
+ * _INTL_REDIRECT_MACROS uses C macros.
+ The drawbacks are:
+ * _INTL_REDIRECT_ASM and _INTL_REDIRECT_INLINE don't work when the
+ function has an inline function definition in a system header file;
+ this mostly affects mingw and MSVC. In these cases,
+ _INTL_REDIRECT_MACROS is the only mechanism that works.
+ * _INTL_REDIRECT_MACROS can interfere with symbols used in structs and
+ classes (especially in C++, but also in C). For example, Qt has a class
+ with an 'asprintf' member, and our '#define asprintf libintl_asprintf'
+ triggers a compilation error.
+ * _INTL_REDIRECT_INLINE in C mode has the effect that each function's
+ address, such as &gettext, is different in each compilation unit.
+ */
+
+/* _INTL_FORCE_INLINE ensures inlining of a function, even when not
+ optimizing. */
+/* Applies to: functions. */
+/* Supported by g++ >= 3.1 and clang. Actually needed for g++ < 4.0. */
+#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 1) > 3) || \
+ defined __clang__
+#define _INTL_HAS_FORCE_INLINE
+#define _INTL_FORCE_INLINE __attribute__((__always_inline__))
+#else
+#define _INTL_FORCE_INLINE
+#endif
+
+/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
+ If he doesn't, we choose the method. */
+#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
+#if defined __GNUC__ && __GNUC__ >= 2 && \
+ !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && \
+ !(__GNUC__ == 2 && defined _AIX) && \
+ (defined __STDC__ || defined __cplusplus)
+#define _INTL_REDIRECT_ASM
+#else
+#if defined __cplusplus && defined _INTL_HAS_FORCE_INLINE
+#define _INTL_REDIRECT_INLINE
+#else
+#define _INTL_REDIRECT_MACROS
+#endif
+#endif
+#endif
+/* Auxiliary macros. */
+#ifdef _INTL_REDIRECT_ASM
+#define _INTL_ASM(cname) __asm__(_INTL_ASMNAME(__USER_LABEL_PREFIX__, #cname))
+#define _INTL_ASMNAME(prefix, cnamestring) _INTL_STRINGIFY(prefix) cnamestring
+#define _INTL_STRINGIFY(prefix) #prefix
+#else
+#define _INTL_ASM(cname)
+#endif
+
+/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
+ its n-th argument literally. This enables GCC to warn for example about
+ printf (gettext ("foo %y")). */
+#if ((defined __GNUC__ && __GNUC__ >= 3) || defined __clang__) && \
+ !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && \
+ !(defined __clang__ && __clang__ && __clang_major__ >= 3) && \
+ defined __cplusplus)
+#define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__((__format_arg__(n)))
+#else
+#define _INTL_MAY_RETURN_STRING_ARG(n)
+#endif
+
+/* _INTL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
+ declares that the STRING-INDEXth function argument is a format string of
+ style ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 7) > 2) || \
+ defined __clang__
+#define _INTL_ATTRIBUTE_FORMAT(spec) __attribute__((__format__ spec))
+#else
+#define _INTL_ATTRIBUTE_FORMAT(spec)
+#endif
+
+/* _INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD
+ An __attribute__ __format__ specifier for a function that takes a format
+ string and arguments, where the format string directives are the ones
+ standardized by ISO C99 and POSIX. */
+/* __gnu_printf__ is supported in GCC >= 4.4. */
+#if defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 4) > 4
+#define _INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
+#else
+#define _INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
+#endif
+
+/* _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD
+ indicates to GCC that the function takes a format string and arguments,
+ where the format string directives are the ones standardized by ISO C99
+ and POSIX. */
+#define _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, \
+ first_argument) \
+ _INTL_ATTRIBUTE_FORMAT((_INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD, \
+ formatstring_parameter, first_argument))
+
+/* _INTL_ARG_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
+ must not be NULL. */
+/* Applies to: functions. */
+#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || \
+ defined __clang__
+#define _INTL_ARG_NONNULL(params) __attribute__((__nonnull__ params))
+#else
+#define _INTL_ARG_NONNULL(params)
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_gettext(const char* __msgid)
+ _INTL_MAY_RETURN_STRING_ARG(1);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_MAY_RETURN_STRING_ARG(1) char* gettext(const char* __msgid) {
+ return libintl_gettext(__msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define gettext libintl_gettext
+#endif
+extern char* gettext(const char* __msgid) _INTL_ASM(libintl_gettext)
+ _INTL_MAY_RETURN_STRING_ARG(1);
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ LC_MESSAGES locale. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_dgettext(const char* __domainname, const char* __msgid)
+ _INTL_MAY_RETURN_STRING_ARG(2);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_MAY_RETURN_STRING_ARG(2) char* dgettext(const char* __domainname,
+ const char* __msgid) {
+ return libintl_dgettext(__domainname, __msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define dgettext libintl_dgettext
+#endif
+extern char* dgettext(const char* __domainname, const char* __msgid)
+ _INTL_ASM(libintl_dgettext) _INTL_MAY_RETURN_STRING_ARG(2);
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_dcgettext(const char* __domainname,
+ const char* __msgid,
+ int __category) _INTL_MAY_RETURN_STRING_ARG(2);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_MAY_RETURN_STRING_ARG(2) char* dcgettext(const char* __domainname,
+ const char* __msgid,
+ int __category) {
+ return libintl_dcgettext(__domainname, __msgid, __category);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define dcgettext libintl_dcgettext
+#endif
+extern char* dcgettext(const char* __domainname,
+ const char* __msgid,
+ int __category) _INTL_ASM(libintl_dcgettext)
+ _INTL_MAY_RETURN_STRING_ARG(2);
+#endif
+
+/* Similar to 'gettext' but select the plural form corresponding to the
+ number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_ngettext(const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n)
+ _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_MAY_RETURN_STRING_ARG(1)
+ _INTL_MAY_RETURN_STRING_ARG(2) char* ngettext(const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n) {
+ return libintl_ngettext(__msgid1, __msgid2, __n);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define ngettext libintl_ngettext
+#endif
+extern char* ngettext(const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n) _INTL_ASM(libintl_ngettext)
+ _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2);
+#endif
+
+/* Similar to 'dgettext' but select the plural form corresponding to the
+ number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_dngettext(const char* __domainname,
+ const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n)
+ _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_MAY_RETURN_STRING_ARG(2)
+ _INTL_MAY_RETURN_STRING_ARG(3) char* dngettext(const char* __domainname,
+ const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n) {
+ return libintl_dngettext(__domainname, __msgid1, __msgid2, __n);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define dngettext libintl_dngettext
+#endif
+extern char* dngettext(const char* __domainname,
+ const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n) _INTL_ASM(libintl_dngettext)
+ _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
+#endif
+
+/* Similar to 'dcgettext' but select the plural form corresponding to the
+ number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_dcngettext(const char* __domainname,
+ const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n,
+ int __category) _INTL_MAY_RETURN_STRING_ARG(2)
+ _INTL_MAY_RETURN_STRING_ARG(3);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(
+ 3) char* dcngettext(const char* __domainname,
+ const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n,
+ int __category) {
+ return libintl_dcngettext(__domainname, __msgid1, __msgid2, __n, __category);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define dcngettext libintl_dcngettext
+#endif
+extern char* dcngettext(const char* __domainname,
+ const char* __msgid1,
+ const char* __msgid2,
+ unsigned long int __n,
+ int __category) _INTL_ASM(libintl_dcngettext)
+ _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
+#endif
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_textdomain(const char* __domainname);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE char*
+ textdomain(const char* __domainname) {
+ return libintl_textdomain(__domainname);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define textdomain libintl_textdomain
+#endif
+extern char* textdomain(const char* __domainname) _INTL_ASM(libintl_textdomain);
+#endif
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_bindtextdomain(const char* __domainname,
+ const char* __dirname);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE char*
+ bindtextdomain(const char* __domainname, const char* __dirname) {
+ return libintl_bindtextdomain(__domainname, __dirname);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define bindtextdomain libintl_bindtextdomain
+#endif
+extern char* bindtextdomain(const char* __domainname, const char* __dirname)
+ _INTL_ASM(libintl_bindtextdomain);
+#endif
+
+#if defined _WIN32 && !defined __CYGWIN__
+/* Specify that the DOMAINNAME message catalog will be found
+ in WDIRNAME rather than in the system locale data base. */
+#ifdef _INTL_REDIRECT_INLINE
+extern wchar_t* libintl_wbindtextdomain(const char* __domainname,
+ const wchar_t* __wdirname);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE wchar_t*
+ wbindtextdomain(const char* __domainname, const wchar_t* __wdirname) {
+ return libintl_wbindtextdomain(__domainname, __wdirname);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define wbindtextdomain libintl_wbindtextdomain
+#endif
+extern wchar_t* wbindtextdomain(const char* __domainname,
+ const wchar_t* __wdirname)
+ _INTL_ASM(libintl_wbindtextdomain);
+#endif
+#endif
+
+/* Specify the character encoding in which the messages from the
+ DOMAINNAME message catalog will be returned. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_bind_textdomain_codeset(const char* __domainname,
+ const char* __codeset);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE char*
+ bind_textdomain_codeset(const char* __domainname, const char* __codeset) {
+ return libintl_bind_textdomain_codeset(__domainname, __codeset);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+#define bind_textdomain_codeset libintl_bind_textdomain_codeset
+#endif
+extern char* bind_textdomain_codeset(const char* __domainname,
+ const char* __codeset)
+ _INTL_ASM(libintl_bind_textdomain_codeset);
+#endif
+
+/* Support for format strings with positions in *printf(), following the
+ POSIX/XSI specification.
+ Note: These replacements for the *printf() functions are visible only
+ in source files that #include or #include "gettext.h".
+ Packages that use *printf() in source files that don't refer to _()
+ or gettext() but for which the format string could be the return value
+ of _() or gettext() need to add this #include. Oh well. */
+
+/* Note: In C++ mode, it is not sufficient to redefine a symbol at the
+ preprocessor macro level, such as
+ #define sprintf libintl_sprintf
+ Some programs may reference std::sprintf after including .
+ Therefore we must make sure that std::libintl_sprintf is defined and
+ identical to ::libintl_sprintf.
+ The user can define _INTL_CXX_NO_CLOBBER_STD_NAMESPACE to avoid this.
+ In such cases, they will not benefit from the overrides when using
+ the 'std' namespace, and they will need to do the references to the
+ 'std' namespace *before* including or "gettext.h". */
+
+#if !1
+
+#include
+#include
+
+/* Get va_list. */
+#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
+#include
+#else
+#include
+#endif
+
+#if !((defined fprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_fprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !(defined __MINGW32__ || defined _MSC_VER)
+extern int libintl_vfprintf(FILE*, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 3)
+ _INTL_ARG_NONNULL((1, 2)) int fprintf(FILE* __stream,
+ const char* __format,
+ ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vfprintf(__stream, __format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_FPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || defined _MSC_VER
+#undef fprintf
+#define fprintf libintl_fprintf
+#endif
+extern int fprintf(FILE*, const char*, ...) _INTL_ASM(libintl_fprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 3) _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || \
+ defined _MSC_VER) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_fprintf;
+}
+#endif
+#endif
+#endif
+#if !((defined vfprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_vfprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !(defined __MINGW32__ || defined _MSC_VER)
+extern int libintl_vfprintf(FILE*, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0)
+ _INTL_ARG_NONNULL((1, 2)) int vfprintf(FILE* __stream,
+ const char* __format,
+ va_list __args) {
+ return libintl_vfprintf(__stream, __format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VFPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || defined _MSC_VER
+#undef vfprintf
+#define vfprintf libintl_vfprintf
+#endif
+extern int vfprintf(FILE*, const char*, va_list) _INTL_ASM(libintl_vfprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || \
+ defined _MSC_VER) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vfprintf;
+}
+#endif
+#endif
+#endif
+
+#if !((defined printf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_printf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !(defined __MINGW32__ || defined _MSC_VER)
+extern int libintl_vprintf(const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(1, 0) _INTL_ARG_NONNULL((1));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(1, 2)
+ _INTL_ARG_NONNULL((1)) int printf(const char* __format, ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vprintf(__format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_PRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || defined _MSC_VER
+#undef printf
+#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || \
+ defined __MINGW32__
+/* Don't break __attribute__((format(printf,M,N))).
+ This redefinition is only possible because the libc in NetBSD, Cygwin,
+ mingw does not have a function __printf__.
+ Alternatively, we could have done this redirection only when compiling with
+ __GNUC__, together with a symbol redirection:
+ extern int printf (const char *, ...)
+ __asm__ (#__USER_LABEL_PREFIX__ "libintl_printf");
+ But doing it now would introduce a binary incompatibility with already
+ distributed versions of libintl on these systems. */
+#define libintl_printf __printf__
+#endif
+#define printf libintl_printf
+#endif
+extern int printf(const char*, ...) _INTL_ASM(libintl_printf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(1, 2) _INTL_ARG_NONNULL((1));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || \
+ defined _MSC_VER) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_printf;
+}
+#endif
+#endif
+#endif
+#if !((defined vprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_vprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !(defined __MINGW32__ || defined _MSC_VER)
+extern int libintl_vprintf(const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(1, 0) _INTL_ARG_NONNULL((1));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(1, 0)
+ _INTL_ARG_NONNULL((1)) int vprintf(const char* __format,
+ va_list __args) {
+ return libintl_vprintf(__format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || defined _MSC_VER
+#undef vprintf
+#define vprintf libintl_vprintf
+#endif
+extern int vprintf(const char*, va_list) _INTL_ASM(libintl_vprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(1, 0) _INTL_ARG_NONNULL((1));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || \
+ defined _MSC_VER) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vprintf;
+}
+#endif
+#endif
+#endif
+
+#if !((defined sprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_sprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !(defined __MINGW32__ || defined _MSC_VER)
+extern int libintl_vsprintf(char*, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 3)
+ _INTL_ARG_NONNULL((1, 2)) int sprintf(char* __result,
+ const char* __format,
+ ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vsprintf(__result, __format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_SPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || defined _MSC_VER
+#undef sprintf
+#define sprintf libintl_sprintf
+#endif
+extern int sprintf(char*, const char*, ...) _INTL_ASM(libintl_sprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 3) _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || \
+ defined _MSC_VER) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_sprintf;
+}
+#endif
+#endif
+#endif
+#if !((defined vsprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_vsprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !(defined __MINGW32__ || defined _MSC_VER)
+extern int libintl_vsprintf(char*, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0)
+ _INTL_ARG_NONNULL((1, 2)) int vsprintf(char* __result,
+ const char* __format,
+ va_list __args) {
+ return libintl_vsprintf(__result, __format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VSPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || defined _MSC_VER
+#undef vsprintf
+#define vsprintf libintl_vsprintf
+#endif
+extern int vsprintf(char*, const char*, va_list) _INTL_ASM(libintl_vsprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__ || \
+ defined _MSC_VER) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vsprintf;
+}
+#endif
+#endif
+#endif
+
+#if 1
+
+#if !((defined snprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_snprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vsnprintf(char*, size_t, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(3, 0) _INTL_ARG_NONNULL((3));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(3, 4)
+ _INTL_ARG_NONNULL((3)) int snprintf(char* __result,
+ size_t __maxlen,
+ const char* __format,
+ ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vsnprintf(__result, __maxlen, __format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_SNPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef snprintf
+#define snprintf libintl_snprintf
+#endif
+extern int snprintf(char*, size_t, const char*, ...) _INTL_ASM(libintl_snprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(3, 4) _INTL_ARG_NONNULL((3));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_snprintf;
+}
+#endif
+#endif
+#endif
+#if !((defined vsnprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_vsnprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vsnprintf(char*, size_t, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(3, 0) _INTL_ARG_NONNULL((3));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(3, 0)
+ _INTL_ARG_NONNULL((3)) int vsnprintf(char* __result,
+ size_t __maxlen,
+ const char* __format,
+ va_list __args) {
+ return libintl_vsnprintf(__result, __maxlen, __format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VSNPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef vsnprintf
+#define vsnprintf libintl_vsnprintf
+#endif
+extern int vsnprintf(char*, size_t, const char*, va_list)
+ _INTL_ASM(libintl_vsnprintf) _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(3, 0)
+ _INTL_ARG_NONNULL((3));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vsnprintf;
+}
+#endif
+#endif
+#endif
+
+#endif
+
+#if 1
+
+#if !((defined asprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_asprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vasprintf(char**, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 3)
+ _INTL_ARG_NONNULL((1, 2)) int asprintf(char** __result,
+ const char* __format,
+ ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vasprintf(__result, __format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_ASPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef asprintf
+#define asprintf libintl_asprintf
+#endif
+extern int asprintf(char**, const char*, ...) _INTL_ASM(libintl_asprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 3) _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_asprintf;
+}
+#endif
+#endif
+#endif
+#if !((defined vasprintf && defined _GL_STDIO_H) || \
+ defined GNULIB_overrides_vasprintf) /* don't override gnulib */
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vasprintf(char**, const char*, va_list)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0)
+ _INTL_ARG_NONNULL((1, 2)) int vasprintf(char** __result,
+ const char* __format,
+ va_list __args) {
+ return libintl_vasprintf(__result, __format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VASPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef vasprintf
+#define vasprintf libintl_vasprintf
+#endif
+extern int vasprintf(char**, const char*, va_list) _INTL_ASM(libintl_vasprintf)
+ _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(2, 0) _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vasprintf;
+}
+#endif
+#endif
+#endif
+
+#endif
+
+#if 1
+
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vfwprintf(FILE*, const wchar_t*, va_list)
+ _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ARG_NONNULL((1, 2)) int fwprintf(FILE* __stream,
+ const wchar_t* __format,
+ ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vfwprintf(__stream, __format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_FWPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef fwprintf
+#define fwprintf libintl_fwprintf
+#endif
+extern int fwprintf(FILE*, const wchar_t*, ...) _INTL_ASM(libintl_fwprintf)
+ _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_fwprintf;
+}
+#endif
+#endif
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vfwprintf(FILE*, const wchar_t*, va_list)
+ _INTL_ARG_NONNULL((1, 2));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ARG_NONNULL((1, 2)) int vfwprintf(FILE* __stream,
+ const wchar_t* __format,
+ va_list __args) {
+ return libintl_vfwprintf(__stream, __format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VFWPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef vfwprintf
+#define vfwprintf libintl_vfwprintf
+#endif
+extern int vfwprintf(FILE*, const wchar_t*, va_list)
+ _INTL_ASM(libintl_vfwprintf) _INTL_ARG_NONNULL((1, 2));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vfwprintf;
+}
+#endif
+#endif
+
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vwprintf(const wchar_t*, va_list) _INTL_ARG_NONNULL((1));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ARG_NONNULL((1)) int wprintf(const wchar_t* __format, ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vwprintf(__format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_WPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef wprintf
+#define wprintf libintl_wprintf
+#endif
+extern int wprintf(const wchar_t*, ...) _INTL_ASM(libintl_wprintf)
+ _INTL_ARG_NONNULL((1));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_wprintf;
+}
+#endif
+#endif
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vwprintf(const wchar_t*, va_list) _INTL_ARG_NONNULL((1));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ARG_NONNULL((1)) int vwprintf(const wchar_t* __format,
+ va_list __args) {
+ return libintl_vwprintf(__format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VWPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef vwprintf
+#define vwprintf libintl_vwprintf
+#endif
+extern int vwprintf(const wchar_t*, va_list) _INTL_ASM(libintl_vwprintf)
+ _INTL_ARG_NONNULL((1));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vwprintf;
+}
+#endif
+#endif
+
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vswprintf(wchar_t*, size_t, const wchar_t*, va_list)
+ _INTL_ARG_NONNULL((1, 3));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ARG_NONNULL((1, 3)) int swprintf(wchar_t* __result,
+ size_t __maxlen,
+ const wchar_t* __format,
+ ...) {
+ va_list __args;
+ int __ret;
+ va_start(__args, __format);
+ __ret = libintl_vswprintf(__result, __maxlen, __format, __args);
+ va_end(__args);
+ return __ret;
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_SWPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef swprintf
+#define swprintf libintl_swprintf
+#endif
+extern int swprintf(wchar_t*, size_t, const wchar_t*, ...)
+ _INTL_ASM(libintl_swprintf) _INTL_ARG_NONNULL((1, 3));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_swprintf;
+}
+#endif
+#endif
+#if defined _INTL_REDIRECT_INLINE && !defined __MINGW32__
+extern int libintl_vswprintf(wchar_t*, size_t, const wchar_t*, va_list)
+ _INTL_ARG_NONNULL((1, 3));
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE
+ _INTL_ARG_NONNULL((1, 3)) int vswprintf(wchar_t* __result,
+ size_t __maxlen,
+ const wchar_t* __format,
+ va_list __args) {
+ return libintl_vswprintf(__result, __maxlen, __format, __args);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_VSWPRINTF
+#if defined _INTL_REDIRECT_MACROS || defined __MINGW32__
+#undef vswprintf
+#define vswprintf libintl_vswprintf
+#endif
+extern int vswprintf(wchar_t*, size_t, const wchar_t*, va_list)
+ _INTL_ASM(libintl_vswprintf) _INTL_ARG_NONNULL((1, 3));
+#if (defined _INTL_REDIRECT_MACROS || defined __MINGW32__) && \
+ defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_vswprintf;
+}
+#endif
+#endif
+
+#endif
+
+#endif
+
+/* Support for retrieving the name of a locale_t object. */
+#if 0
+
+#ifndef GNULIB_defined_newlocale /* don't override gnulib */
+#ifdef _INTL_REDIRECT_INLINE
+extern locale_t libintl_newlocale(int, const char*, locale_t);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE locale_t
+ newlocale(int __category_mask, const char* __name, locale_t __base) {
+ return libintl_newlocale(__category_mask, __name, __base);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_NEWLOCALE
+#ifdef _INTL_REDIRECT_MACROS
+#undef newlocale
+#define newlocale libintl_newlocale
+#endif
+extern locale_t newlocale(int, const char*, locale_t)
+ _INTL_ASM(libintl_newlocale);
+#if defined _INTL_REDIRECT_MACROS && defined __cplusplus && \
+ !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_newlocale;
+}
+#endif
+#endif
+#endif
+
+#ifndef GNULIB_defined_duplocale /* don't override gnulib */
+#ifdef _INTL_REDIRECT_INLINE
+extern locale_t libintl_duplocale(locale_t);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE locale_t
+ duplocale(locale_t __locale) {
+ return libintl_duplocale(__locale);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_DUPLOCALE
+#ifdef _INTL_REDIRECT_MACROS
+#undef duplocale
+#define duplocale libintl_duplocale
+#endif
+extern locale_t duplocale(locale_t) _INTL_ASM(libintl_duplocale);
+#if defined _INTL_REDIRECT_MACROS && defined __cplusplus && \
+ !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_duplocale;
+}
+#endif
+#endif
+#endif
+
+#ifndef GNULIB_defined_freelocale /* don't override gnulib */
+#ifdef _INTL_REDIRECT_INLINE
+extern void libintl_freelocale(locale_t);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE void
+ freelocale(locale_t __locale) {
+ libintl_freelocale(__locale);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_FREELOCALE
+#ifdef _INTL_REDIRECT_MACROS
+#undef freelocale
+#define freelocale libintl_freelocale
+#endif
+extern void freelocale(locale_t) _INTL_ASM(libintl_freelocale);
+#if defined _INTL_REDIRECT_MACROS && defined __cplusplus && \
+ !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_freelocale;
+}
+#endif
+#endif
+#endif
+
+#endif
+
+/* Support for the locale chosen by the user. */
+#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || \
+ defined __CYGWIN__
+
+#ifndef GNULIB_defined_setlocale /* don't override gnulib */
+#ifdef _INTL_REDIRECT_INLINE
+extern char* libintl_setlocale(int, const char*);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE char*
+ setlocale(int __category, const char* __locale) {
+ return libintl_setlocale(__category, __locale);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_SETLOCALE
+#ifdef _INTL_REDIRECT_MACROS
+#undef setlocale
+#define setlocale libintl_setlocale
+#endif
+extern char* setlocale(int, const char*) _INTL_ASM(libintl_setlocale);
+#if defined _INTL_REDIRECT_MACROS && defined __cplusplus && \
+ !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_setlocale;
+}
+#endif
+#endif
+#endif
+
+#if 1
+
+/* Declare newlocale() only if the system headers define the 'locale_t' type. */
+#if !(defined __CYGWIN__ && !defined LC_ALL_MASK)
+#ifdef _INTL_REDIRECT_INLINE
+extern locale_t libintl_newlocale(int, const char*, locale_t);
+#ifndef __cplusplus
+static
+#endif
+ inline _INTL_FORCE_INLINE locale_t
+ newlocale(int __category_mask, const char* __name, locale_t __base) {
+ return libintl_newlocale(__category_mask, __name, __base);
+}
+#elif !defined _INTL_NO_DEFINE_MACRO_NEWLOCALE
+#ifdef _INTL_REDIRECT_MACROS
+#undef newlocale
+#define newlocale libintl_newlocale
+#endif
+extern locale_t newlocale(int, const char*, locale_t)
+ _INTL_ASM(libintl_newlocale);
+#if defined _INTL_REDIRECT_MACROS && defined __cplusplus && \
+ !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE
+namespace std {
+using ::libintl_newlocale;
+}
+#endif
+#endif
+#endif
+
+#endif
+
+#endif
+
+/* Support for relocatable packages. */
+
+/* Sets the original and the current installation prefix of the package.
+ Relocation simply replaces a pathname starting with the original prefix
+ by the corresponding pathname with the current prefix instead. Both
+ prefixes should be directory names without trailing slash (i.e. use ""
+ instead of "/"). */
+#define libintl_set_relocation_prefix libintl_set_relocation_prefix
+extern void libintl_set_relocation_prefix(const char* orig_prefix,
+ const char* curr_prefix);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libintl.h */
diff --git a/vendor/libghostty-vt/pkg/libpng/build.zig b/vendor/libghostty-vt/pkg/libpng/build.zig
new file mode 100644
index 00000000..dbedac63
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libpng/build.zig
@@ -0,0 +1,91 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const lib = b.addLibrary(.{
+ .name = "png",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+ if (target.result.os.tag == .linux) {
+ lib.linkSystemLibrary("m");
+ }
+ if (target.result.os.tag.isDarwin()) {
+ const apple_sdk = @import("apple_sdk");
+ try apple_sdk.addPaths(b, lib);
+ }
+
+ // For dynamic linking, we prefer dynamic linking and to search by
+ // mode first. Mode first will search all paths for a dynamic library
+ // before falling back to static.
+ const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{
+ .preferred_link_mode = .dynamic,
+ .search_strategy = .mode_first,
+ };
+
+ if (b.systemIntegrationOption("zlib", .{})) {
+ lib.linkSystemLibrary2("zlib", dynamic_link_opts);
+ } else {
+ if (b.lazyDependency(
+ "zlib",
+ .{ .target = target, .optimize = optimize },
+ )) |zlib_dep| {
+ lib.linkLibrary(zlib_dep.artifact("z"));
+ lib.addIncludePath(b.path(""));
+ }
+
+ if (b.lazyDependency("libpng", .{})) |upstream| {
+ lib.addIncludePath(upstream.path(""));
+ }
+ }
+
+ if (b.lazyDependency("libpng", .{})) |upstream| {
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ "-DPNG_ARM_NEON_OPT=0",
+ "-DPNG_POWERPC_VSX_OPT=0",
+ "-DPNG_INTEL_SSE_OPT=0",
+ "-DPNG_MIPS_MSA_OPT=0",
+ });
+
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = srcs,
+ .flags = flags.items,
+ });
+
+ lib.installHeader(b.path("pnglibconf.h"), "pnglibconf.h");
+ lib.installHeadersDirectory(
+ upstream.path(""),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ b.installArtifact(lib);
+}
+
+const srcs: []const []const u8 = &.{
+ "png.c",
+ "pngerror.c",
+ "pngget.c",
+ "pngmem.c",
+ "pngpread.c",
+ "pngread.c",
+ "pngrio.c",
+ "pngrtran.c",
+ "pngrutil.c",
+ "pngset.c",
+ "pngtrans.c",
+ "pngwio.c",
+ "pngwrite.c",
+ "pngwtran.c",
+ "pngwutil.c",
+};
diff --git a/vendor/libghostty-vt/pkg/libpng/build.zig.zon b/vendor/libghostty-vt/pkg/libpng/build.zig.zon
new file mode 100644
index 00000000..b5153ff7
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libpng/build.zig.zon
@@ -0,0 +1,17 @@
+.{
+ .name = .libpng,
+ .version = "1.6.43",
+ .fingerprint = 0xb7a09eb437ca8a79,
+ .paths = .{""},
+ .dependencies = .{
+ // glennrp/libpng
+ .libpng = .{
+ .url = "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz",
+ .hash = "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD",
+ .lazy = true,
+ },
+
+ .zlib = .{ .path = "../zlib", .lazy = true },
+ .apple_sdk = .{ .path = "../apple-sdk" },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/libpng/pnglibconf.h b/vendor/libghostty-vt/pkg/libpng/pnglibconf.h
new file mode 100644
index 00000000..b39c38c7
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libpng/pnglibconf.h
@@ -0,0 +1,219 @@
+/* pnglibconf.h - library build configuration */
+
+/* libpng version 1.6.38.git */
+
+/* Copyright (c) 2018-2020 Cosmin Truta */
+/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
+
+/* This code is released under the libpng license. */
+/* For conditions of distribution and use, see the disclaimer */
+/* and license in png.h */
+
+/* pnglibconf.h */
+/* Machine generated file: DO NOT EDIT */
+/* Derived from: scripts/pnglibconf.dfa */
+#ifndef PNGLCONF_H
+#define PNGLCONF_H
+/* options */
+#define PNG_16BIT_SUPPORTED
+#define PNG_ALIGNED_MEMORY_SUPPORTED
+/*#undef PNG_ARM_NEON_API_SUPPORTED*/
+/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
+#define PNG_BENIGN_ERRORS_SUPPORTED
+#define PNG_BENIGN_READ_ERRORS_SUPPORTED
+/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
+#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
+#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_COLORSPACE_SUPPORTED
+#define PNG_CONSOLE_IO_SUPPORTED
+#define PNG_CONVERT_tIME_SUPPORTED
+#define PNG_EASY_ACCESS_SUPPORTED
+/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
+#define PNG_ERROR_TEXT_SUPPORTED
+#define PNG_FIXED_POINT_SUPPORTED
+#define PNG_FLOATING_ARITHMETIC_SUPPORTED
+#define PNG_FLOATING_POINT_SUPPORTED
+#define PNG_FORMAT_AFIRST_SUPPORTED
+#define PNG_FORMAT_BGR_SUPPORTED
+#define PNG_GAMMA_SUPPORTED
+#define PNG_GET_PALETTE_MAX_SUPPORTED
+#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+#define PNG_INCH_CONVERSIONS_SUPPORTED
+#define PNG_INFO_IMAGE_SUPPORTED
+#define PNG_IO_STATE_SUPPORTED
+#define PNG_MNG_FEATURES_SUPPORTED
+#define PNG_POINTER_INDEXING_SUPPORTED
+/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
+/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
+#define PNG_PROGRESSIVE_READ_SUPPORTED
+#define PNG_READ_16BIT_SUPPORTED
+#define PNG_READ_ALPHA_MODE_SUPPORTED
+#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
+#define PNG_READ_BACKGROUND_SUPPORTED
+#define PNG_READ_BGR_SUPPORTED
+#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
+#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
+#define PNG_READ_EXPAND_16_SUPPORTED
+#define PNG_READ_EXPAND_SUPPORTED
+#define PNG_READ_FILLER_SUPPORTED
+#define PNG_READ_GAMMA_SUPPORTED
+#define PNG_READ_GET_PALETTE_MAX_SUPPORTED
+#define PNG_READ_GRAY_TO_RGB_SUPPORTED
+#define PNG_READ_INTERLACING_SUPPORTED
+#define PNG_READ_INT_FUNCTIONS_SUPPORTED
+#define PNG_READ_INVERT_ALPHA_SUPPORTED
+#define PNG_READ_INVERT_SUPPORTED
+#define PNG_READ_OPT_PLTE_SUPPORTED
+#define PNG_READ_PACKSWAP_SUPPORTED
+#define PNG_READ_PACK_SUPPORTED
+#define PNG_READ_QUANTIZE_SUPPORTED
+#define PNG_READ_RGB_TO_GRAY_SUPPORTED
+#define PNG_READ_SCALE_16_TO_8_SUPPORTED
+#define PNG_READ_SHIFT_SUPPORTED
+#define PNG_READ_STRIP_16_TO_8_SUPPORTED
+#define PNG_READ_STRIP_ALPHA_SUPPORTED
+#define PNG_READ_SUPPORTED
+#define PNG_READ_SWAP_ALPHA_SUPPORTED
+#define PNG_READ_SWAP_SUPPORTED
+#define PNG_READ_TEXT_SUPPORTED
+#define PNG_READ_TRANSFORMS_SUPPORTED
+#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_READ_USER_CHUNKS_SUPPORTED
+#define PNG_READ_USER_TRANSFORM_SUPPORTED
+#define PNG_READ_bKGD_SUPPORTED
+#define PNG_READ_cHRM_SUPPORTED
+#define PNG_READ_eXIf_SUPPORTED
+#define PNG_READ_gAMA_SUPPORTED
+#define PNG_READ_hIST_SUPPORTED
+#define PNG_READ_iCCP_SUPPORTED
+#define PNG_READ_iTXt_SUPPORTED
+#define PNG_READ_oFFs_SUPPORTED
+#define PNG_READ_pCAL_SUPPORTED
+#define PNG_READ_pHYs_SUPPORTED
+#define PNG_READ_sBIT_SUPPORTED
+#define PNG_READ_sCAL_SUPPORTED
+#define PNG_READ_sPLT_SUPPORTED
+#define PNG_READ_sRGB_SUPPORTED
+#define PNG_READ_tEXt_SUPPORTED
+#define PNG_READ_tIME_SUPPORTED
+#define PNG_READ_tRNS_SUPPORTED
+#define PNG_READ_zTXt_SUPPORTED
+#define PNG_SAVE_INT_32_SUPPORTED
+#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_SEQUENTIAL_READ_SUPPORTED
+#define PNG_SETJMP_SUPPORTED
+#define PNG_SET_OPTION_SUPPORTED
+#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_SET_USER_LIMITS_SUPPORTED
+#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
+#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED
+#define PNG_SIMPLIFIED_READ_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
+#define PNG_SIMPLIFIED_WRITE_SUPPORTED
+#define PNG_STDIO_SUPPORTED
+#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_TEXT_SUPPORTED
+#define PNG_TIME_RFC1123_SUPPORTED
+#define PNG_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_USER_CHUNKS_SUPPORTED
+#define PNG_USER_LIMITS_SUPPORTED
+#define PNG_USER_MEM_SUPPORTED
+#define PNG_USER_TRANSFORM_INFO_SUPPORTED
+#define PNG_USER_TRANSFORM_PTR_SUPPORTED
+#define PNG_WARNINGS_SUPPORTED
+#define PNG_WRITE_16BIT_SUPPORTED
+#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
+#define PNG_WRITE_BGR_SUPPORTED
+#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
+#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
+#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
+#define PNG_WRITE_FILLER_SUPPORTED
+#define PNG_WRITE_FILTER_SUPPORTED
+#define PNG_WRITE_FLUSH_SUPPORTED
+#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
+#define PNG_WRITE_INTERLACING_SUPPORTED
+#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
+#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
+#define PNG_WRITE_INVERT_SUPPORTED
+#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
+#define PNG_WRITE_PACKSWAP_SUPPORTED
+#define PNG_WRITE_PACK_SUPPORTED
+#define PNG_WRITE_SHIFT_SUPPORTED
+#define PNG_WRITE_SUPPORTED
+#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
+#define PNG_WRITE_SWAP_SUPPORTED
+#define PNG_WRITE_TEXT_SUPPORTED
+#define PNG_WRITE_TRANSFORMS_SUPPORTED
+#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
+#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
+#define PNG_WRITE_bKGD_SUPPORTED
+#define PNG_WRITE_cHRM_SUPPORTED
+#define PNG_WRITE_eXIf_SUPPORTED
+#define PNG_WRITE_gAMA_SUPPORTED
+#define PNG_WRITE_hIST_SUPPORTED
+#define PNG_WRITE_iCCP_SUPPORTED
+#define PNG_WRITE_iTXt_SUPPORTED
+#define PNG_WRITE_oFFs_SUPPORTED
+#define PNG_WRITE_pCAL_SUPPORTED
+#define PNG_WRITE_pHYs_SUPPORTED
+#define PNG_WRITE_sBIT_SUPPORTED
+#define PNG_WRITE_sCAL_SUPPORTED
+#define PNG_WRITE_sPLT_SUPPORTED
+#define PNG_WRITE_sRGB_SUPPORTED
+#define PNG_WRITE_tEXt_SUPPORTED
+#define PNG_WRITE_tIME_SUPPORTED
+#define PNG_WRITE_tRNS_SUPPORTED
+#define PNG_WRITE_zTXt_SUPPORTED
+#define PNG_bKGD_SUPPORTED
+#define PNG_cHRM_SUPPORTED
+#define PNG_eXIf_SUPPORTED
+#define PNG_gAMA_SUPPORTED
+#define PNG_hIST_SUPPORTED
+#define PNG_iCCP_SUPPORTED
+#define PNG_iTXt_SUPPORTED
+#define PNG_oFFs_SUPPORTED
+#define PNG_pCAL_SUPPORTED
+#define PNG_pHYs_SUPPORTED
+#define PNG_sBIT_SUPPORTED
+#define PNG_sCAL_SUPPORTED
+#define PNG_sPLT_SUPPORTED
+#define PNG_sRGB_SUPPORTED
+#define PNG_tEXt_SUPPORTED
+#define PNG_tIME_SUPPORTED
+#define PNG_tRNS_SUPPORTED
+#define PNG_zTXt_SUPPORTED
+/* end of options */
+/* settings */
+#define PNG_API_RULE 0
+#define PNG_DEFAULT_READ_MACROS 1
+#define PNG_GAMMA_THRESHOLD_FIXED 5000
+#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
+#define PNG_INFLATE_BUF_SIZE 1024
+#define PNG_LINKAGE_API extern
+#define PNG_LINKAGE_CALLBACK extern
+#define PNG_LINKAGE_DATA extern
+#define PNG_LINKAGE_FUNCTION extern
+#define PNG_MAX_GAMMA_8 11
+#define PNG_QUANTIZE_BLUE_BITS 5
+#define PNG_QUANTIZE_GREEN_BITS 5
+#define PNG_QUANTIZE_RED_BITS 5
+#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)
+#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
+#define PNG_USER_CHUNK_CACHE_MAX 1000
+#define PNG_USER_CHUNK_MALLOC_MAX 8000000
+#define PNG_USER_HEIGHT_MAX 1000000
+#define PNG_USER_WIDTH_MAX 1000000
+#define PNG_ZBUF_SIZE 8192
+#define PNG_ZLIB_VERNUM 0 /* unknown */
+#define PNG_Z_DEFAULT_COMPRESSION (-1)
+#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
+#define PNG_Z_DEFAULT_STRATEGY 1
+#define PNG_sCAL_PRECISION 5
+#define PNG_sRGB_PROFILE_CHECKS 2
+/* end of settings */
+#endif /* PNGLCONF_H */
diff --git a/vendor/libghostty-vt/pkg/libxml2/build.zig b/vendor/libghostty-vt/pkg/libxml2/build.zig
new file mode 100644
index 00000000..a9b3e4b1
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libxml2/build.zig
@@ -0,0 +1,227 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const upstream_ = b.lazyDependency("libxml2", .{});
+
+ const lib = b.addLibrary(.{
+ .name = "xml2",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ }),
+ .linkage = .static,
+ });
+ lib.linkLibC();
+
+ if (upstream_) |upstream| lib.addIncludePath(upstream.path("include"));
+ lib.addIncludePath(b.path("override/include"));
+ if (target.result.os.tag == .windows) {
+ lib.addIncludePath(b.path("override/config/win32"));
+ lib.linkSystemLibrary("ws2_32");
+ } else {
+ lib.addIncludePath(b.path("override/config/posix"));
+ }
+
+ var flags: std.ArrayList([]const u8) = .empty;
+ defer flags.deinit(b.allocator);
+ try flags.appendSlice(b.allocator, &.{
+ // Version info, hardcoded
+ comptime "-DLIBXML_VERSION=" ++ Version.number(),
+ comptime "-DLIBXML_VERSION_STRING=" ++ Version.string(),
+ "-DLIBXML_VERSION_EXTRA=\"\"",
+ comptime "-DLIBXML_DOTTED_VERSION=" ++ Version.dottedString(),
+
+ // These might now always be true (particularly Windows) but for
+ // now we just set them all. We should do some detection later.
+ "-DSEND_ARG2_CAST=",
+ "-DGETHOSTBYNAME_ARG_CAST=",
+ "-DGETHOSTBYNAME_ARG_CAST_CONST=",
+
+ // Always on
+ "-DLIBXML_STATIC=1",
+ "-DLIBXML_AUTOMATA_ENABLED=1",
+ "-DWITHOUT_TRIO=1",
+ });
+ if (target.result.os.tag != .windows) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_ARPA_INET_H=1",
+ "-DHAVE_ARPA_NAMESER_H=1",
+ "-DHAVE_DL_H=1",
+ "-DHAVE_NETDB_H=1",
+ "-DHAVE_NETINET_IN_H=1",
+ "-DHAVE_PTHREAD_H=1",
+ "-DHAVE_SHLLOAD=1",
+ "-DHAVE_SYS_DIR_H=1",
+ "-DHAVE_SYS_MMAN_H=1",
+ "-DHAVE_SYS_NDIR_H=1",
+ "-DHAVE_SYS_SELECT_H=1",
+ "-DHAVE_SYS_SOCKET_H=1",
+ "-DHAVE_SYS_TIMEB_H=1",
+ "-DHAVE_SYS_TIME_H=1",
+ "-DHAVE_SYS_TYPES_H=1",
+ });
+ }
+
+ // Enable our `./configure` options. For bool-type fields we translate
+ // it to the `LIBXML_{field}_ENABLED` C define where field is uppercased.
+ inline for (std.meta.fields(Options)) |field| {
+ const opt = b.option(bool, field.name, "Configure flag") orelse
+ @as(*const bool, @ptrCast(field.default_value_ptr.?)).*;
+ if (opt) {
+ var nameBuf: [32]u8 = undefined;
+ const name = std.ascii.upperString(&nameBuf, field.name);
+ const define = try std.fmt.allocPrint(b.allocator, "-DLIBXML_{s}_ENABLED=1", .{name});
+ try flags.append(b.allocator, define);
+
+ if (std.mem.eql(u8, field.name, "history")) {
+ try flags.appendSlice(b.allocator, &.{
+ "-DHAVE_LIBHISTORY=1",
+ "-DHAVE_LIBREADLINE=1",
+ });
+ }
+ if (std.mem.eql(u8, field.name, "mem_debug")) {
+ try flags.append(b.allocator, "-DDEBUG_MEMORY_LOCATION=1");
+ }
+ if (std.mem.eql(u8, field.name, "regexp")) {
+ try flags.append(b.allocator, "-DLIBXML_UNICODE_ENABLED=1");
+ }
+ if (std.mem.eql(u8, field.name, "run_debug")) {
+ try flags.append(b.allocator, "-DLIBXML_DEBUG_RUNTIME=1");
+ }
+ if (std.mem.eql(u8, field.name, "thread")) {
+ try flags.append(b.allocator, "-DHAVE_LIBPTHREAD=1");
+ }
+ }
+ }
+
+ if (upstream_) |upstream| {
+ lib.addCSourceFiles(.{
+ .root = upstream.path(""),
+ .files = srcs,
+ .flags = flags.items,
+ });
+
+ lib.installHeader(
+ b.path("override/include/libxml/xmlversion.h"),
+ "libxml/xmlversion.h",
+ );
+ lib.installHeadersDirectory(
+ upstream.path("include"),
+ "",
+ .{ .include_extensions = &.{".h"} },
+ );
+ }
+
+ b.installArtifact(lib);
+}
+
+/// The version information for this library. This is hardcoded for now but
+/// in the future we will parse this from configure.ac.
+pub const Version = struct {
+ pub const major = "2";
+ pub const minor = "11";
+ pub const micro = "5";
+
+ pub fn number() []const u8 {
+ return comptime major ++ "0" ++ minor ++ "0" ++ micro;
+ }
+
+ pub fn string() []const u8 {
+ return comptime "\"" ++ number() ++ "\"";
+ }
+
+ pub fn dottedString() []const u8 {
+ return comptime "\"" ++ major ++ "." ++ minor ++ "." ++ micro ++ "\"";
+ }
+};
+
+/// Compile-time options for the library. These mostly correspond to
+/// options exposed by the native build system used by the library.
+/// These are mapped to `b.option` calls.
+const Options = struct {
+ // These options are all defined in libxml2's configure.c and correspond
+ // to `--with-X` options for `./configure`. Their defaults are properly set.
+ c14n: bool = true,
+ catalog: bool = true,
+ debug: bool = true,
+ ftp: bool = false,
+ history: bool = true,
+ html: bool = true,
+ iconv: bool = true,
+ icu: bool = false,
+ iso8859x: bool = true,
+ legacy: bool = false,
+ mem_debug: bool = false,
+ minimum: bool = true,
+ output: bool = true,
+ pattern: bool = true,
+ push: bool = true,
+ reader: bool = true,
+ regexp: bool = true,
+ run_debug: bool = false,
+ sax1: bool = true,
+ schemas: bool = true,
+ schematron: bool = true,
+ thread: bool = true,
+ thread_alloc: bool = false,
+ tree: bool = true,
+ valid: bool = true,
+ writer: bool = true,
+ xinclude: bool = true,
+ xpath: bool = true,
+ xptr: bool = true,
+ xptr_locs: bool = false,
+ modules: bool = true,
+ lzma: bool = false,
+ zlib: bool = false,
+};
+
+const srcs = &.{
+ "buf.c",
+ "c14n.c",
+ "catalog.c",
+ "chvalid.c",
+ "debugXML.c",
+ "dict.c",
+ "encoding.c",
+ "entities.c",
+ "error.c",
+ "globals.c",
+ "hash.c",
+ "HTMLparser.c",
+ "HTMLtree.c",
+ "legacy.c",
+ "list.c",
+ "nanoftp.c",
+ "nanohttp.c",
+ "parser.c",
+ "parserInternals.c",
+ "pattern.c",
+ "relaxng.c",
+ "SAX.c",
+ "SAX2.c",
+ "schematron.c",
+ "threads.c",
+ "tree.c",
+ "uri.c",
+ "valid.c",
+ "xinclude.c",
+ "xlink.c",
+ "xmlIO.c",
+ "xmlmemory.c",
+ "xmlmodule.c",
+ "xmlreader.c",
+ "xmlregexp.c",
+ "xmlsave.c",
+ "xmlschemas.c",
+ "xmlschemastypes.c",
+ "xmlstring.c",
+ "xmlunicode.c",
+ "xmlwriter.c",
+ "xpath.c",
+ "xpointer.c",
+ "xzlib.c",
+};
diff --git a/vendor/libghostty-vt/pkg/libxml2/build.zig.zon b/vendor/libghostty-vt/pkg/libxml2/build.zig.zon
new file mode 100644
index 00000000..f932835a
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libxml2/build.zig.zon
@@ -0,0 +1,13 @@
+.{
+ .name = .libxml2,
+ .version = "2.11.5",
+ .fingerprint = 0xf268267b0b8b040d,
+ .paths = .{""},
+ .dependencies = .{
+ .libxml2 = .{
+ .url = "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz",
+ .hash = "N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK",
+ .lazy = true,
+ },
+ },
+}
diff --git a/vendor/libghostty-vt/pkg/libxml2/override/config/posix/config.h b/vendor/libghostty-vt/pkg/libxml2/override/config/posix/config.h
new file mode 100644
index 00000000..44228498
--- /dev/null
+++ b/vendor/libghostty-vt/pkg/libxml2/override/config/posix/config.h
@@ -0,0 +1,80 @@
+// This recreates parts of the generated config.h from cmake. Most of the
+// defines actually happen directly in libxml2.zig. Some of these SHOULD
+// be converted to build-time determined.
+
+/* Whether struct sockaddr::__ss_family exists */
+// #define HAVE_BROKEN_SS_FAMILY 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_DLFCN_H 1
+
+/* Have dlopen based dso */
+#define HAVE_DLOPEN 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `ftime' function. */
+#define HAVE_FTIME 1
+
+/* Define if getaddrinfo is there */
+#define HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `isascii' function. */
+#define HAVE_ISASCII 1
+
+/* Define to 1 if you have the `mmap' function. */
+#define HAVE_MMAP 1
+
+/* Define to 1 if you have the `munmap' function. */
+#define HAVE_MUNMAP 1
+
+/* mmap() is no good without munmap() */
+#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
+# undef /**/ HAVE_MMAP
+#endif
+
+/* Define to 1 if you have the header file. */
+#define HAVE_POLL_H 1
+
+/* Define to 1 if you have the `putenv' function. */
+#define HAVE_PUTENV 1
+
+/* Define to 1 if you have the `rand_r' function. */
+#define HAVE_RAND_R 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_RESOLV_H 1
+
+/* Define to 1 if you have the `stat' function. */
+#define HAVE_STAT 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_UNISTD_H 1
+
+/* Whether va_copy() is available */
+#define HAVE_VA_COPY 1
+
+/* Define to 1 if you have the