test(windows): run the Windows code under Wine; theme preview parity

Windows was previously only compile-checked. With Wine 11 (staging)
and mingw available, scripts/windows-wine-test.sh (`just
test-windows-wine`) builds expat/FreeType/fontconfig for mingw under
target/wine-deps and runs the test suites of ghostty-vt, unicode,
datastruct, input, os, config, terminal, crash, termio and cli under
Wine (~2,700 tests). New termio/tests/exec_windows.rs drives real
cmd.exe children over ConPTY through Termio (output, exit codes,
typing, 120 KiB writes, stop, start failure). Fixes found: Windows
paths from fs::canonicalize leaked the \\?\ prefix (new
ghostty_os::path::realpath strips it like Zig); ghostty-font compiles
hb-ft for bundled HarfBuzz on Windows; ~25 tests had Unix assumptions.
Wine limitations are ignored with reasons (ResizePseudoConsole stub,
no POSIX rename over existing files) - docs/rewrite/notes/windows-wine.md.

+list-themes preview parity (former KNOWN_DIFFERENCES rows 5-9): the
search box ports vaxis TextInput (word navigation and editing bindings,
grapheme-wise editing), ASCII-only case folding, light initial colors
until terminal reports arrive (no COLORFGBG), and load errors end the
preview with exit 1; PTY tests compare with /usr/bin/ghostty.

Test Plan:
- just test-windows-wine
- cargo test -p ghostty-cli --test list_themes_pty
- cargo test --workspace --no-fail-fast (3601 passed)
This commit is contained in:
ddidderr committed 2026-10-12 17:23:24 +02:00
1 parent d1eb32b4f7
commit 1431a8a1d8
30 files changed
+1668 -240

No files matched your search

+22 -4
View File
@@ -4216,7 +4216,7 @@ impl Config {
// Any paths referenced from the CLI are relative to the current working
// directory.
let cwd = std::fs::canonicalize(".")?;
let cwd = crate::path::realpath(".")?;
self.expand_paths(&EncodedOs::from_path(&cwd))?;
Ok(())
}
@@ -5115,12 +5115,22 @@ mod tests {
fn write_theme(td: &TempDir, name: &str, data: &str) -> String {
let p = td.path().join(name);
std::fs::write(&p, data).unwrap();
std::fs::canonicalize(&p)
crate::path::realpath(&p)
.unwrap()
.to_string_lossy()
.into_owned()
}
/// A path as a `light:`/`dark:` pair value. Backslashes are escapes in
/// the pair syntax (as in Zig), so Windows paths must be quoted.
fn pair_value(path: &str) -> String {
if cfg!(windows) {
format!("\"{}\"", path.replace('\\', "\\\\"))
} else {
path.to_owned()
}
}
#[test]
fn handle_bom_in_config_files() {
{
@@ -5223,7 +5233,11 @@ mod tests {
let dark = write_theme(&td, "theme_dark", include_str!("testdata/theme_dark"));
let mut cfg_light = Config::default();
let mut i = it(&[&format!("--theme=light:{light},dark:{dark}")]);
let mut i = it(&[&format!(
"--theme=light:{},dark:{}",
pair_value(&light),
pair_value(&dark)
)]);
cfg_light.load_iter(&mut i).unwrap();
cfg_light.finalize().unwrap();
@@ -5407,7 +5421,11 @@ mod tests {
let td = TempDir::init().unwrap();
let light = write_theme(&td, "theme_light", include_str!("testdata/theme_light"));
let dark = write_theme(&td, "theme_dark", include_str!("testdata/theme_dark"));
let arg = format!("--theme=light:{light},dark:{dark}");
let arg = format!(
"--theme=light:{},dark:{}",
pair_value(&light),
pair_value(&dark)
);
// Light
{