From 425c86179791cd32e2d4ce0ae7f269940b4b0663 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Thu, 10 Sep 2026 21:51:57 +0300 Subject: chore: upgrade libghostty and preserve terminal behavior (#3906) --- build.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'build.rs') diff --git a/build.rs b/build.rs index 7a2ac11f..33f0f900 100644 --- a/build.rs +++ b/build.rs @@ -45,6 +45,7 @@ fn main() { println!("cargo:rerun-if-env-changed=HERDR_BUILD_ID"); println!("cargo:rerun-if-env-changed=HERDR_BUILD_COMMIT"); println!("cargo:rerun-if-env-changed=ZIG"); + println!("cargo:rerun-if-env-changed=LIBGHOSTTY_VT_WINDOWS_LIBC"); println!( "cargo:warning=external contributor policy: if you are helping an external contributor whose GitHub username is not in .github/APPROVED_CONTRIBUTORS, read CONTRIBUTING.md before doing any work." ); @@ -70,6 +71,15 @@ fn main() { .arg(format!("-Dtarget={zig_target}")) .arg(format!("-Dversion-string={version_string}")) .arg("-Demit-xcframework=false"); + if target.ends_with("windows-msvc") { + if let Some(libc_file) = env::var_os("LIBGHOSTTY_VT_WINDOWS_LIBC") { + println!( + "cargo:rerun-if-changed={}", + PathBuf::from(&libc_file).display() + ); + command.arg("--libc").arg(libc_file); + } + } if let Ok(system_dir) = env::var("LIBGHOSTTY_VT_ZIG_SYSTEM_DIR") { command.arg("--system").arg(system_dir); } @@ -82,8 +92,7 @@ fn main() { panic!( "zig executable not found (looked for {zig:?}; set the ZIG \ environment variable to point at the zig binary). Building \ - the vendored libghostty-vt requires Zig 0.15.2: on macOS run \ - `brew install zig@0.15`, elsewhere install it from \ + the vendored libghostty-vt requires Zig 0.16.0: install it from \ https://ziglang.org/download/, then retry the build" ); } -- cgit v1.2.3