From 3e34009492ef9f412e2f28b9d6aba93828c71279 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 21 Sep 2025 19:44:07 -0700 Subject: [PATCH] lib-vt: expose all of terminal for now --- build.zig | 3 +++ src/lib_vt.zig | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/build.zig b/build.zig index f651c30e4..0b87dbbe1 100644 --- a/build.zig +++ b/build.zig @@ -265,6 +265,9 @@ pub fn build(b: *std.Build) !void { 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", diff --git a/src/lib_vt.zig b/src/lib_vt.zig index d8e268b1b..d375a89d2 100644 --- a/src/lib_vt.zig +++ b/src/lib_vt.zig @@ -1,4 +1,12 @@ //! This is the public API of the ghostty-vt Zig module. +//! +//! WARNING: The API is not guaranteed to be stable. +//! +//! The functionality is extremely stable, since it is extracted +//! directly from Ghostty which has been used in real world scenarios +//! by thousands of users for years. However, the API itself (functions, +//! types, etc.) may change without warning. We're working on stabilizing +//! this in the future. // The public API below reproduces a lot of terminal/main.zig but // is separate because (1) we need our root file to be in `src/` @@ -6,8 +14,56 @@ // parts of `terminal` that are not ready for public consumption // or are too Ghostty-internal. const terminal = @import("terminal/main.zig"); + +pub const apc = terminal.apc; +pub const dcs = terminal.dcs; +pub const osc = terminal.osc; +pub const point = terminal.point; +pub const color = terminal.color; +pub const device_status = terminal.device_status; +pub const kitty = terminal.kitty; +pub const modes = terminal.modes; +pub const page = terminal.page; +pub const parse_table = terminal.parse_table; +pub const search = terminal.search; +pub const size = terminal.size; +pub const x11_color = terminal.x11_color; + +pub const Charset = terminal.Charset; +pub const CharsetSlot = terminal.Slots; +pub const CharsetActiveSlot = terminal.ActiveSlot; +pub const Cell = page.Cell; +pub const Coordinate = point.Coordinate; +pub const CSI = Parser.Action.CSI; +pub const DCS = Parser.Action.DCS; +pub const MouseShape = terminal.MouseShape; +pub const Page = page.Page; +pub const PageList = terminal.PageList; pub const Parser = terminal.Parser; +pub const Pin = PageList.Pin; +pub const Point = point.Point; +pub const Screen = terminal.Screen; +pub const ScreenType = Terminal.ScreenType; +pub const Selection = terminal.Selection; +pub const SizeReportStyle = terminal.SizeReportStyle; +pub const StringMap = terminal.StringMap; +pub const Style = terminal.Style; pub const Terminal = terminal.Terminal; +pub const Stream = terminal.Stream; +pub const Cursor = Screen.Cursor; +pub const CursorStyle = Screen.CursorStyle; +pub const CursorStyleReq = terminal.CursorStyle; +pub const DeviceAttributeReq = terminal.DeviceAttributeReq; +pub const Mode = modes.Mode; +pub const ModePacked = modes.ModePacked; +pub const ModifyKeyFormat = terminal.ModifyKeyFormat; +pub const ProtectedMode = terminal.ProtectedMode; +pub const StatusLineType = terminal.StatusLineType; +pub const StatusDisplay = terminal.StatusDisplay; +pub const EraseDisplay = terminal.EraseDisplay; +pub const EraseLine = terminal.EraseLine; +pub const TabClear = terminal.TabClear; +pub const Attribute = terminal.Attribute; test { _ = terminal;