aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/apprt
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
commitdcfe11a7588fcd42471159453810abc9b7720a57 (patch)
treec32a77266028e73ca2382b96c96f8438a5fcd621 /vendor/libghostty-vt/src/apprt
parent2dfed860103c4e4505ac7f25def9fe37da1e1e6a (diff)
build: update libghostty-vt vendor
vendor ghostty 063ac3e and remove the musl libc++ link workaround. expose the new selection formatter and hyperlink uri apis for follow-up rendering work. add manual artifact validation for static linux builds.
Diffstat (limited to 'vendor/libghostty-vt/src/apprt')
-rw-r--r--vendor/libghostty-vt/src/apprt/embedded.zig24
-rw-r--r--vendor/libghostty-vt/src/apprt/gtk/class/surface_scrolled_window.zig3
-rw-r--r--vendor/libghostty-vt/src/apprt/gtk/class/window.zig5
-rw-r--r--vendor/libghostty-vt/src/apprt/gtk/ui/1.5/surface-scrolled-window.blp13
4 files changed, 35 insertions, 10 deletions
diff --git a/vendor/libghostty-vt/src/apprt/embedded.zig b/vendor/libghostty-vt/src/apprt/embedded.zig
index 519a35f2..730913eb 100644
--- a/vendor/libghostty-vt/src/apprt/embedded.zig
+++ b/vendor/libghostty-vt/src/apprt/embedded.zig
@@ -20,6 +20,7 @@ const CoreInspector = @import("../inspector/main.zig").Inspector;
const CoreSurface = @import("../Surface.zig");
const configpkg = @import("../config.zig");
const Config = configpkg.Config;
+const String = @import("../main_c.zig").String;
const log = std.log.scoped(.embedded_window);
@@ -1465,8 +1466,8 @@ pub const CAPI = struct {
/// if it were sent to the surface right now. The "right now"
/// is important because things like trigger sequences are only
/// valid until the next key event.
- export fn ghostty_app_key_is_binding(
- app: *App,
+ export fn ghostty_config_key_is_binding(
+ config: *Config,
event: KeyEvent,
) bool {
const core_event = event.keyEvent().core() orelse {
@@ -1474,7 +1475,7 @@ pub const CAPI = struct {
return false;
};
- return app.core_app.keyEventIsBinding(app, core_event);
+ return config.keyEventIsBinding(core_event);
}
/// Notify the app that the keyboard was changed. This causes the
@@ -1709,6 +1710,23 @@ pub const CAPI = struct {
};
}
+ /// Returns the PID of the foreground process for the surface PTY.
+ export fn ghostty_surface_foreground_pid(surface: *Surface) u64 {
+ return surface.core_surface.getProcessInfo(.foreground_pid) orelse 0;
+ }
+
+ /// Returns the PTY name for the surface. The returned string must be
+ /// freed by the caller via ghostty_string_free.
+ export fn ghostty_surface_tty_name(surface: *Surface) String {
+ const tty_name = surface.core_surface.getProcessInfo(.tty_name) orelse return .empty;
+ const copy = surface.app.core_app.alloc.dupeZ(u8, tty_name) catch |err| {
+ log.err("error allocating tty name err={}", .{err});
+ return .empty;
+ };
+
+ return .fromSlice(copy);
+ }
+
/// Update the color scheme of the surface.
export fn ghostty_surface_set_color_scheme(surface: *Surface, scheme_raw: c_int) void {
const scheme = std.meta.intToEnum(apprt.ColorScheme, scheme_raw) catch {
diff --git a/vendor/libghostty-vt/src/apprt/gtk/class/surface_scrolled_window.zig b/vendor/libghostty-vt/src/apprt/gtk/class/surface_scrolled_window.zig
index dd4f17d1..6ccb0a0d 100644
--- a/vendor/libghostty-vt/src/apprt/gtk/class/surface_scrolled_window.zig
+++ b/vendor/libghostty-vt/src/apprt/gtk/class/surface_scrolled_window.zig
@@ -163,8 +163,7 @@ pub const SurfaceScrolledWindow = extern struct {
_: ?*anyopaque,
) callconv(.c) void {
const priv = self.private();
- const child: *gtk.Widget = self.as(Parent).getChild().?;
- const scrolled_window = gobject.ext.cast(gtk.ScrolledWindow, child).?;
+ const scrolled_window = self.private().scrolled_window.as(gtk.ScrolledWindow);
scrolled_window.setChild(if (priv.surface) |s| s.as(gtk.Widget) else null);
// Unbind old config binding if it exists
diff --git a/vendor/libghostty-vt/src/apprt/gtk/class/window.zig b/vendor/libghostty-vt/src/apprt/gtk/class/window.zig
index bf2a2fe7..0c8dfaa7 100644
--- a/vendor/libghostty-vt/src/apprt/gtk/class/window.zig
+++ b/vendor/libghostty-vt/src/apprt/gtk/class/window.zig
@@ -1079,7 +1079,10 @@ pub const Window = extern struct {
// Hide quick-terminal if set to autohide
if (self.isQuickTerminal()) {
if (self.getConfig()) |cfg| {
- if (cfg.get().@"quick-terminal-autohide" and self.as(gtk.Window).isActive() == 0) {
+ if (cfg.get().@"quick-terminal-autohide" and
+ self.as(gtk.Window).isActive() == 0 and
+ self.as(gtk.Widget).isVisible() == 1)
+ {
self.toggleVisibility();
}
}
diff --git a/vendor/libghostty-vt/src/apprt/gtk/ui/1.5/surface-scrolled-window.blp b/vendor/libghostty-vt/src/apprt/gtk/ui/1.5/surface-scrolled-window.blp
index 75582a89..8ba27cb6 100644
--- a/vendor/libghostty-vt/src/apprt/gtk/ui/1.5/surface-scrolled-window.blp
+++ b/vendor/libghostty-vt/src/apprt/gtk/ui/1.5/surface-scrolled-window.blp
@@ -3,9 +3,14 @@ using Adw 1;
template $GhostttySurfaceScrolledWindow: Adw.Bin {
notify::surface => $notify_surface();
-
- Gtk.ScrolledWindow scrolled_window {
- hscrollbar-policy: never;
- vscrollbar-policy: bind $scrollbar_policy(template.config) as <Gtk.PolicyType>;
+ // The double-nesting is required due to a GTK bug where you can't
+ // bind the first child of a builder layout. If you do, you get a double
+ // dispose. Easiest way to see that is simply remove this and see the
+ // GTK critical errors (and sometimes crashes).
+ Adw.Bin {
+ Gtk.ScrolledWindow scrolled_window {
+ hscrollbar-policy: never;
+ vscrollbar-policy: bind $scrollbar_policy(template.config) as <Gtk.PolicyType>;
+ }
}
}