fix: Windows core build, embedded init, byte-exact paths, version info

Closes the remaining core/lib/termio/GTK rows (final-Z2.md):
- ghostty-core compiles for Windows (Unix-only exec fields and file
  modes gated); checked with cargo check --target x86_64-pc-windows-gnu.
- Embedded init: ensure_locale, SIGPIPE ignored in ghostty_init for
  C/Swift hosts, Apple crash tags; the argv passed to ghostty_init feeds
  ghostty_config_load_cli_args; ghostty_config_load_file accepts
  non-UTF-8 paths.
- OSC 7 pwd, embedded surface cwd/command/env/initial input,
  ghostty_surface_text and GTK file drops keep raw bytes.
- XTVERSION, TERM_PROGRAM_VERSION, the About dialog and crash metadata
  use ghostty_build_info instead of hardcoded versions.

Test Plan:
- cargo test --workspace (3327 passed)
- cargo clippy --workspace --all-targets -- -D warnings
This commit is contained in:
ddidderr committed 2026-10-12 08:14:02 +02:00
1 parent 8519f1ba1b
commit ebefad5031
30 files changed
+863 -80

No files matched your search

+7 -4
View File
@@ -181,7 +181,7 @@ impl Exec {
// set that on the terminal now. This allows rapidly initializing
// new surfaces to use the proper pwd.
if let Some(cwd) = &self.subprocess.cwd
&& let Err(err) = term.set_pwd(cwd.as_bytes())
&& let Err(err) = term.set_pwd(&ghostty_os::osbytes::config_str_to_bytes(cwd))
{
log::warn!("error setting initial pwd err={err:?}");
}
@@ -907,7 +907,10 @@ impl Subprocess {
// Add the environment variables that override any others.
for (k, v) in cfg.env_override.iter() {
env.insert(k, v);
env.insert(
ghostty_os::osbytes::config_str_to_os(k),
ghostty_os::osbytes::config_str_to_os(v),
);
}
// Build our args list
@@ -925,7 +928,7 @@ impl Subprocess {
// https://github.com/kovidgoyal/kitty/issues/1595
// https://github.com/ghostty-org/ghostty/discussions/7769
if let Some(pwd) = &cwd {
env.insert("PWD", pwd.clone());
env.insert("PWD", ghostty_os::osbytes::config_str_to_os(pwd));
}
Ok(Subprocess {
@@ -1037,7 +1040,7 @@ impl Subprocess {
}
}
Some(proposed) => {
if std::path::Path::new(proposed).exists() {
if std::path::Path::new(&ghostty_os::osbytes::config_str_to_os(proposed)).exists() {
Some(proposed.clone())
} else {
log::warn!("cannot access cwd, ignoring: {proposed}");