diff --git a/crates/zet-gpu/src/renderer.rs b/crates/zet-gpu/src/renderer.rs index 5285851..9f5946d 100644 --- a/crates/zet-gpu/src/renderer.rs +++ b/crates/zet-gpu/src/renderer.rs @@ -916,6 +916,70 @@ impl Renderer { } } + pub fn draw_ghostty_frame(&mut self, frame: &GhosttyFrame, vp: Viewport) { + self.quads.clear(); + self.ui_quads.clear(); + let (cw, ch) = self.cell_px(); + let origin_x = vp.x.saturating_mul(cw); + let origin_y = vp.y.saturating_mul(ch); + // Background fill. + if let Some(slot) = self.bg_slot { + for vy in 0..vp.rows { + for vx in 0..vp.cols { + if let Some((cx, cy)) = viewport_cell_origin(vp, vx, vy) { + self.quads.extend(cell_quad( + cx, + cy, + cw as f32, + ch as f32, + (slot.x, slot.y), + self.atlas_size, + Rgba::rgb(0.05, 0.05, 0.08), + )); + } + } + } + } + for y in 0..frame.rows.min(vp.rows as usize) { + for x in 0..frame.cols.min(vp.cols as usize) { + let cell = &frame.cells[y * frame.cols + x]; + let bg = if cell.inverse { + cell.fg + } else { + cell.bg.unwrap_or(Rgba::rgb(0.05, 0.05, 0.08)) + }; + if cell.bg.is_some() || cell.inverse { + if let Some((cx, cy)) = viewport_cell_origin(vp, x as u32, y as u32) { + if let Some(slot) = self.bg_slot { + self.quads.extend(cell_quad( + cx, + cy, + cw as f32, + ch as f32, + (slot.x, slot.y), + self.atlas_size, + bg, + )); + } + } + } + if cell.ch != ' ' { + let ink = if cell.inverse { + Rgba::rgb(0.05, 0.05, 0.08) + } else { + cell.fg + }; + self.draw_text_row(vp, y as u32, x as u32, &cell.ch.to_string(), ink); + } + } + } + if frame.cursor_visible { + let cx = origin_x + frame.cursor_x as u32 * cw; + let cy = origin_y + frame.cursor_y as u32 * ch; + self.draw_rect_px(cx, cy, cw, ch, Rgba::rgb(0.8, 0.8, 0.8)); + } + } + /// Tab bar on row 0: equal segments, active lifted + white ink, /// inactive dim. Labels pre-truncated by the caller; overlong text /// clips at the grid edge. @@ -2596,3 +2660,22 @@ mod viewport_tests { } } } + +#[derive(Clone, Copy)] +pub struct GhosttyCell { + pub ch: char, + pub fg: Rgba, + pub bg: Option, + pub bold: bool, + pub inverse: bool, +} + +#[derive(Clone)] +pub struct GhosttyFrame { + pub cols: usize, + pub rows: usize, + pub cells: Vec, + pub cursor_x: usize, + pub cursor_y: usize, + pub cursor_visible: bool, +} diff --git a/crates/zet-pty/src/lib.rs b/crates/zet-pty/src/lib.rs index bafe19b..619eab5 100644 --- a/crates/zet-pty/src/lib.rs +++ b/crates/zet-pty/src/lib.rs @@ -45,7 +45,36 @@ pub struct Session { } impl Session { + /// Spawn a shell in the process's current directory. + /// + /// `portable_pty` does not inherit the caller's working directory by + /// default; leaving it unset starts the shell in `$HOME`. Resolve the + /// directory explicitly so ZET behaves like an ordinary terminal. If the + /// inherited directory is invalid (for example, deleted after launch), + /// fall back to the platform default instead of failing to start. pub fn spawn(program: &str, args: &[&str], cols: u16, rows: u16) -> std::io::Result { + Self::spawn_with_cwd( + program, + args, + cols, + rows, + std::env::current_dir().ok().as_deref(), + ) + } + + /// Spawn a shell with an explicit working directory. + /// + /// A missing or inaccessible directory falls back to `portable_pty`'s + /// default startup directory (`$HOME`). Passing `None` also uses that + /// default. This keeps callers from having to special-case deleted + /// launch directories while preserving explicit, testable cwd handling. + pub fn spawn_with_cwd( + program: &str, + args: &[&str], + cols: u16, + rows: u16, + cwd: Option<&std::path::Path>, + ) -> std::io::Result { let pty_system = native_pty_system(); let pair = pty_system .openpty(PtySize { @@ -57,6 +86,11 @@ impl Session { .map_err(std::io::Error::other)?; let mut cmd = CommandBuilder::new(program); cmd.args(args); + if let Some(cwd) = cwd { + if cwd.is_dir() { + cmd.cwd(cwd); + } + } let child = pair .slave .spawn_command(cmd) diff --git a/crates/zet-pty/tests/session.rs b/crates/zet-pty/tests/session.rs index 26748e4..3819e40 100644 --- a/crates/zet-pty/tests/session.rs +++ b/crates/zet-pty/tests/session.rs @@ -119,3 +119,131 @@ fn shutdown_reaps_the_child() { "process {pid} lingers" ); } + +fn unique_temp_dir(prefix: &str) -> std::path::PathBuf { + for attempt in 0..1000 { + let nanos = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .map(|d| d.as_nanos()) + .unwrap_or(0); + let path = std::env::temp_dir().join(format!( + "zet-cwd-{prefix}-{}-{nanos}-{attempt}", + std::process::id() + )); + match std::fs::create_dir(&path) { + Ok(()) => return path, + Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => continue, + Err(e) => panic!("could not create isolated test directory {path:?}: {e}"), + } + } + panic!("could not allocate a unique temporary directory"); +} + +#[test] +fn spawn_with_cwd_starts_shell_in_requested_directory() { + let dir = unique_temp_dir("project"); + std::fs::write( + dir.join("Cargo.toml"), + "[package]\nname = \"x\"\nversion = \"0.1.0\"\n", + ) + .unwrap(); + + let mut s = Session::spawn_with_cwd("sh", &["-c", "pwd"], 80, 24, Some(&dir)).unwrap(); + let mut out = Vec::new(); + let code = s.wait_with_output(&mut out).unwrap(); + assert_eq!(code, 0); + + let text = String::from_utf8_lossy(&out); + let actual = text + .lines() + .map(str::trim) + .find(|line| !line.is_empty()) + .unwrap_or_default(); + let actual = std::fs::canonicalize(actual).unwrap_or_else(|_| std::path::PathBuf::from(actual)); + let expected = std::fs::canonicalize(&dir).unwrap(); + assert_eq!(actual, expected, "pwd was {text:?}"); + + let _ = std::fs::remove_dir_all(&dir); +} + +#[test] +fn spawn_with_cwd_falls_back_when_directory_is_invalid() { + let missing = std::env::temp_dir().join(format!( + "zet-cwd-missing-{}-{}", + std::process::id(), + std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_nanos() + )); + assert!( + !missing.exists(), + "test fixture unexpectedly exists: {missing:?}" + ); + + let mut s = Session::spawn_with_cwd("sh", &["-c", "pwd"], 80, 24, Some(&missing)).unwrap(); + let mut out = Vec::new(); + let code = s.wait_with_output(&mut out).unwrap(); + assert_eq!(code, 0); + + let text = String::from_utf8_lossy(&out); + let actual = text + .lines() + .map(str::trim) + .find(|line| !line.is_empty()) + .unwrap_or_default(); + assert!( + !actual.is_empty(), + "shell did not report a working directory" + ); + assert!( + !actual.contains("zet-cwd-missing"), + "invalid directory leaked into shell: {text:?}" + ); +} + +#[test] +fn spawn_inherits_process_current_directory() { + if std::env::var_os("ZET_PTY_INHERIT_CWD_CHILD").is_some() { + let mut s = Session::spawn("sh", &["-c", "pwd"], 80, 24).unwrap(); + let mut out = Vec::new(); + let code = s.wait_with_output(&mut out).unwrap(); + assert_eq!(code, 0); + let text = String::from_utf8_lossy(&out); + let actual = text + .lines() + .map(str::trim) + .find(|line| !line.is_empty()) + .unwrap_or_default(); + println!("ZET_CWD_RESULT={actual}"); + return; + } + + let dir = unique_temp_dir("inherit"); + let expected = std::fs::canonicalize(&dir).unwrap(); + let exe = std::env::current_exe().unwrap(); + let output = std::process::Command::new(&exe) + .arg("spawn_inherits_process_current_directory") + .arg("--exact") + .arg("--nocapture") + .env("ZET_PTY_INHERIT_CWD_CHILD", "1") + .current_dir(&dir) + .output() + .unwrap(); + assert!( + output.status.success(), + "child test failed: {}", + String::from_utf8_lossy(&output.stderr) + ); + + let stdout = String::from_utf8_lossy(&output.stdout); + let result = stdout + .lines() + .find_map(|line| line.strip_prefix("ZET_CWD_RESULT=")) + .unwrap_or_default() + .trim(); + let actual = std::fs::canonicalize(result).unwrap_or_else(|_| std::path::PathBuf::from(result)); + assert_eq!(actual, expected, "child pwd was {stdout:?}"); + + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/zet/Cargo.toml b/crates/zet/Cargo.toml index 352c721..8ce0554 100644 --- a/crates/zet/Cargo.toml +++ b/crates/zet/Cargo.toml @@ -12,6 +12,10 @@ path = "src/lib.rs" name = "zet" path = "src/main.rs" +[features] +default = [] +ghostty-vt = [] + [dependencies] zet-agent = { path = "../zet-agent" } zet-agent-observe = { path = "../zet-agent-observe" } diff --git a/crates/zet/build.rs b/crates/zet/build.rs new file mode 100644 index 0000000..b8bbcfc --- /dev/null +++ b/crates/zet/build.rs @@ -0,0 +1,12 @@ +fn main() { + #[cfg(feature = "ghostty-vt")] + { + let lib_dir = std::env::var("GHOSTTY_VT_LIB_DIR").unwrap_or_else(|_| { + "/home/bandit/zet-ghostty-a2/ghostty-0fa3d577a5614150ff8e2c152de5fb9d5c6d2dec/zig-out/lib" + .to_string() + }); + println!("cargo:rustc-link-search=native={lib_dir}"); + println!("cargo:rustc-link-lib=dylib=ghostty-vt"); + println!("cargo:rustc-link-arg=-Wl,-rpath,{lib_dir}"); + } +} diff --git a/crates/zet/src/ghostty.rs b/crates/zet/src/ghostty.rs new file mode 100644 index 0000000..ca0dc9c --- /dev/null +++ b/crates/zet/src/ghostty.rs @@ -0,0 +1,327 @@ +//! Experimental `libghostty-vt` terminal engine. +//! +//! This module is compiled only with `--features ghostty-vt`. It is not the +//! production terminal engine and is activated only by +//! `ZET_TERMINAL_ENGINE=ghostty`. + +use std::ffi::c_void; + +use zet_gpu::quad::Rgba; +pub type GhosttyCell = zet_gpu::renderer::GhosttyCell; +pub type GhosttyFrame = zet_gpu::renderer::GhosttyFrame; + +#[repr(C)] +struct GhosttyStyleColor { + tag: u8, + value: GhosttyStyleColorValue, +} + +#[repr(C)] +union GhosttyStyleColorValue { + palette: u8, + rgb: GhosttyColorRgb, +} + +#[repr(C)] +#[derive(Clone, Copy)] +struct GhosttyColorRgb { + r: u8, + g: u8, + b: u8, +} + +#[repr(C)] +struct GhosttyStyle { + fg_color: GhosttyStyleColor, + bg_color: GhosttyStyleColor, + underline_color: GhosttyStyleColor, + flags: u16, + reserved: u16, +} + +type GhosttyTerminalHandle = *mut c_void; +type GhosttyRenderState = *mut c_void; +type GhosttyRenderStateRowIterator = *mut c_void; +type GhosttyRenderStateRowCells = *mut c_void; +type GhosttyResult = i32; + +#[link(name = "ghostty-vt")] +extern "C" { + fn ghostty_terminal_new( + allocator: *const c_void, + terminal: *mut GhosttyTerminalHandle, + cols: u16, + rows: u16, + ) -> GhosttyResult; + fn ghostty_terminal_free(terminal: GhosttyTerminalHandle); + fn ghostty_terminal_vt_write(terminal: GhosttyTerminalHandle, data: *const u8, len: usize); + fn ghostty_terminal_resize( + terminal: GhosttyTerminalHandle, + cols: u16, + rows: u16, + cw: u32, + ch: u32, + ) -> GhosttyResult; + fn ghostty_render_state_new( + allocator: *const c_void, + state: *mut GhosttyRenderState, + ) -> GhosttyResult; + fn ghostty_render_state_free(state: GhosttyRenderState); + fn ghostty_render_state_update( + state: GhosttyRenderState, + terminal: GhosttyTerminalHandle, + ) -> GhosttyResult; + fn ghostty_render_state_get( + state: GhosttyRenderState, + key: u32, + out: *mut c_void, + ) -> GhosttyResult; + fn ghostty_render_state_row_iterator_new( + allocator: *const c_void, + out: *mut GhosttyRenderStateRowIterator, + ) -> GhosttyResult; + fn ghostty_render_state_row_iterator_free(it: GhosttyRenderStateRowIterator); + fn ghostty_render_state_row_iterator_next(it: GhosttyRenderStateRowIterator) -> bool; + fn ghostty_render_state_row_get( + it: GhosttyRenderStateRowIterator, + key: u32, + out: *mut c_void, + ) -> GhosttyResult; + fn ghostty_render_state_row_cells_new( + allocator: *const c_void, + out: *mut GhosttyRenderStateRowCells, + ) -> GhosttyResult; + fn ghostty_render_state_row_cells_free(cells: GhosttyRenderStateRowCells); + fn ghostty_render_state_row_cells_next(cells: GhosttyRenderStateRowCells) -> bool; + fn ghostty_render_state_row_cells_get( + cells: GhosttyRenderStateRowCells, + key: u32, + out: *mut c_void, + ) -> GhosttyResult; + fn ghostty_cell_get(cell: u64, key: u32, out: *mut c_void) -> GhosttyResult; +} + +pub struct GhosttyTerminal { + term: GhosttyTerminalHandle, + render_state: GhosttyRenderState, +} + +impl GhosttyTerminal { + pub fn new(cols: u16, rows: u16) -> Result { + unsafe { + let mut term: GhosttyTerminalHandle = std::ptr::null_mut(); + let rc = ghostty_terminal_new(std::ptr::null(), &mut term, cols, rows); + if rc != 0 { + return Err(format!("ghostty_terminal_new failed: {rc}")); + } + let mut render_state: GhosttyRenderState = std::ptr::null_mut(); + let rc = ghostty_render_state_new(std::ptr::null(), &mut render_state); + if rc != 0 { + ghostty_terminal_free(term); + return Err(format!("ghostty_render_state_new failed: {rc}")); + } + Ok(Self { term, render_state }) + } + } + + pub fn feed(&mut self, bytes: &[u8]) { + unsafe { ghostty_terminal_vt_write(self.term, bytes.as_ptr(), bytes.len()) } + } + + pub fn resize(&mut self, cols: u16, rows: u16) { + unsafe { + let _ = ghostty_terminal_resize(self.term, cols, rows, 8, 16); + } + } + + pub fn frame(&mut self) -> GhosttyFrame { + unsafe { + let _ = ghostty_render_state_update(self.render_state, self.term); + + let mut cols: u16 = 0; + let mut rows: u16 = 0; + let _ = + ghostty_render_state_get(self.render_state, 1, &mut cols as *mut _ as *mut c_void); + let _ = + ghostty_render_state_get(self.render_state, 2, &mut rows as *mut _ as *mut c_void); + + #[repr(C)] + #[derive(Clone, Copy)] + struct Cursor { + size: usize, + viewport_has_value: bool, + viewport_x: u16, + viewport_y: u16, + wide_tail: bool, + visible: bool, + blinking: bool, + password_input: bool, + visual_style: i32, + } + let mut cursor = Cursor { + size: std::mem::size_of::(), + viewport_has_value: false, + viewport_x: 0, + viewport_y: 0, + wide_tail: false, + visible: false, + blinking: false, + password_input: false, + visual_style: 0, + }; + let _ = ghostty_render_state_get( + self.render_state, + 18, + &mut cursor as *mut _ as *mut c_void, + ); + + let mut cells_handle: GhosttyRenderStateRowCells = std::ptr::null_mut(); + let _ = ghostty_render_state_row_cells_new(std::ptr::null(), &mut cells_handle); + + let mut frame_cells = vec![ + zet_gpu::renderer::GhosttyCell { + ch: ' ', + fg: Rgba::rgb(0.85, 0.85, 0.85), + bg: None, + bold: false, + inverse: false, + }; + (cols as usize) * (rows as usize) + ]; + + let mut it: GhosttyRenderStateRowIterator = std::ptr::null_mut(); + let _ = ghostty_render_state_row_iterator_new(std::ptr::null(), &mut it); + let _ = + ghostty_render_state_get(self.render_state, 4, &mut it as *mut _ as *mut c_void); + + let mut row_idx = 0usize; + while row_idx < rows as usize && ghostty_render_state_row_iterator_next(it) { + let _ = + ghostty_render_state_row_get(it, 3, &mut cells_handle as *mut _ as *mut c_void); + let mut col_idx = 0usize; + while col_idx < cols as usize && ghostty_render_state_row_cells_next(cells_handle) { + let mut raw: u64 = 0; + let _ = ghostty_render_state_row_cells_get( + cells_handle, + 1, + &mut raw as *mut _ as *mut c_void, + ); + let mut cp: u32 = 0; + if raw != 0 { + let _ = ghostty_cell_get(raw, 1, &mut cp as *mut _ as *mut c_void); + } + let mut style = GhosttyStyle { + fg_color: GhosttyStyleColor { + tag: 0, + value: GhosttyStyleColorValue { palette: 0 }, + }, + bg_color: GhosttyStyleColor { + tag: 0, + value: GhosttyStyleColorValue { palette: 0 }, + }, + underline_color: GhosttyStyleColor { + tag: 0, + value: GhosttyStyleColorValue { palette: 0 }, + }, + flags: 0, + reserved: 0, + }; + let _ = ghostty_render_state_row_cells_get( + cells_handle, + 2, + &mut style as *mut _ as *mut c_void, + ); + + let idx = row_idx * (cols as usize) + col_idx; + if idx < frame_cells.len() { + frame_cells[idx].ch = char::from_u32(cp).unwrap_or(' '); + frame_cells[idx].fg = + resolve_color(style.fg_color, Rgba::rgb(0.85, 0.85, 0.85)); + if style.bg_color.tag != 0 { + frame_cells[idx].bg = + Some(resolve_color(style.bg_color, Rgba::rgb(0.0, 0.0, 0.0))); + } + frame_cells[idx].bold = style.flags & 1 != 0; + frame_cells[idx].inverse = style.flags & (1 << 4) != 0; + } + col_idx += 1; + } + row_idx += 1; + } + + ghostty_render_state_row_cells_free(cells_handle); + ghostty_render_state_row_iterator_free(it); + + GhosttyFrame { + cols: cols as usize, + rows: rows as usize, + cells: frame_cells, + cursor_x: if cursor.viewport_has_value { + cursor.viewport_x as usize + } else { + 0 + }, + cursor_y: if cursor.viewport_has_value { + cursor.viewport_y as usize + } else { + 0 + }, + cursor_visible: cursor.visible, + } + } + } +} + +impl Drop for GhosttyTerminal { + fn drop(&mut self) { + unsafe { + ghostty_render_state_free(self.render_state); + ghostty_terminal_free(self.term); + } + } +} + +fn palette_color(idx: u8) -> Rgba { + let table: [Rgba; 16] = [ + Rgba::rgb(0.0, 0.0, 0.0), + Rgba::rgb(0.8, 0.0, 0.0), + Rgba::rgb(0.0, 0.8, 0.0), + Rgba::rgb(0.8, 0.8, 0.0), + Rgba::rgb(0.0, 0.0, 0.8), + Rgba::rgb(0.8, 0.0, 0.8), + Rgba::rgb(0.0, 0.8, 0.8), + Rgba::rgb(0.8, 0.8, 0.8), + Rgba::rgb(0.3, 0.3, 0.3), + Rgba::rgb(1.0, 0.3, 0.3), + Rgba::rgb(0.3, 1.0, 0.3), + Rgba::rgb(1.0, 1.0, 0.3), + Rgba::rgb(0.3, 0.3, 1.0), + Rgba::rgb(1.0, 0.3, 1.0), + Rgba::rgb(0.3, 1.0, 1.0), + Rgba::rgb(1.0, 1.0, 1.0), + ]; + if (idx as usize) < table.len() { + table[idx as usize] + } else if idx >= 232 { + let v = (idx as f32 - 232.0) / 23.0; + Rgba::rgb(v, v, v) + } else { + let i = idx as usize - 16; + let r = (i / 36) as f32 / 5.0; + let g = ((i / 6) % 6) as f32 / 5.0; + let b = (i % 6) as f32 / 5.0; + Rgba::rgb(r, g, b) + } +} + +fn resolve_color(c: GhosttyStyleColor, fallback: Rgba) -> Rgba { + match c.tag { + 0 => fallback, + 1 => palette_color(unsafe { c.value.palette }), + 2 => { + let v = unsafe { c.value.rgb }; + Rgba::rgb(v.r as f32 / 255.0, v.g as f32 / 255.0, v.b as f32 / 255.0) + } + _ => fallback, + } +} diff --git a/crates/zet/src/lib.rs b/crates/zet/src/lib.rs index 47fb265..538efa1 100644 --- a/crates/zet/src/lib.rs +++ b/crates/zet/src/lib.rs @@ -6,3 +6,6 @@ pub mod mode; pub mod window; + +#[cfg(feature = "ghostty-vt")] +pub mod ghostty; diff --git a/crates/zet/src/window/mod.rs b/crates/zet/src/window/mod.rs index 7e6b577..7012477 100644 --- a/crates/zet/src/window/mod.rs +++ b/crates/zet/src/window/mod.rs @@ -104,6 +104,10 @@ struct Tab { undo_rx: Option>>, was_alt: bool, search: SearchState, + #[cfg(feature = "ghostty-vt")] + ghostty: Option, + #[cfg(feature = "ghostty-vt")] + ghostty_frame: Option, } /// Scrollback find state (per tab): the query, absolute-row matches, @@ -207,6 +211,14 @@ impl Tab { matches: Vec::new(), current: 0, }, + #[cfg(feature = "ghostty-vt")] + ghostty: if std::env::var("ZET_TERMINAL_ENGINE").as_deref() == Ok("ghostty") { + crate::ghostty::GhosttyTerminal::new(80, 24).ok() + } else { + None + }, + #[cfg(feature = "ghostty-vt")] + ghostty_frame: None, } } } @@ -667,6 +679,10 @@ impl App { }; for chunk in chunks { self.tabs[i].term.feed(&chunk); + #[cfg(feature = "ghostty-vt")] + if let Some(ghostty) = &mut self.tabs[i].ghostty { + ghostty.feed(&chunk); + } } let responses = self.tabs[i].term.drain_responses(); if !responses.is_empty() { @@ -710,6 +726,10 @@ impl App { } None => (Vec::new(), None, Vec::new(), 0), }; + #[cfg(feature = "ghostty-vt")] + if let Some(ghostty) = &mut self.tabs[i].ghostty { + self.tabs[i].ghostty_frame = Some(ghostty.frame()); + } self.agent_observations .record_persistence_failures(failed_persists); if let Some(session) = session_id { @@ -2111,6 +2131,10 @@ impl App { self.welcome.release_placement(); for tab in &mut self.tabs { tab.term.resize(cols, rows); + #[cfg(feature = "ghostty-vt")] + if let Some(ghostty) = &mut tab.ghostty { + ghostty.resize(cols as u16, rows as u16); + } if let Some(s) = &tab.session { let _ = s.resize(cols.min(32767) as u16, rows.min(32767) as u16); } @@ -6513,6 +6537,13 @@ impl ApplicationHandler for App { .present(&self.tabs[self.active].term, gpu_vp.cols, gpu_vp.rows) .cloned(); if let (Some(r), Some(_)) = (&mut self.renderer, &self.window) { + #[cfg(feature = "ghostty-vt")] + if let Some(frame) = &self.tabs[self.active].ghostty_frame { + r.draw_ghostty_frame(frame, gpu_vp); + } else { + r.draw_terminal_in(&self.tabs[self.active].term, gpu_vp, sel); + } + #[cfg(not(feature = "ghostty-vt"))] r.draw_terminal_in(&self.tabs[self.active].term, gpu_vp, sel); if self.focus == Focus::Terminal { let (cw, ch) = r.cell_px(); @@ -7055,6 +7086,10 @@ mod layout_fit_tests { matches: Vec::new(), current: 0, }, + #[cfg(feature = "ghostty-vt")] + ghostty: None, + #[cfg(feature = "ghostty-vt")] + ghostty_frame: None, } } @@ -9559,6 +9594,10 @@ mod p2b_signature_tests { matches: Vec::new(), current: 0, }, + #[cfg(feature = "ghostty-vt")] + ghostty: None, + #[cfg(feature = "ghostty-vt")] + ghostty_frame: None, } } @@ -9731,6 +9770,10 @@ mod p4a3_r3_acceptance { matches: Vec::new(), current: 0, }, + #[cfg(feature = "ghostty-vt")] + ghostty: None, + #[cfg(feature = "ghostty-vt")] + ghostty_frame: None, } }