Files
ghostty-rs/docs/rewrite/notes/final-Z2.md
T
ddidderr a9f3856b15 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
2026-10-12 08:14:02 +02:00

1.9 KiB

Z2 final notes (core / lib / termio / apprt-gtk)

  • Windows: cargo check --target x86_64-pc-windows-gnu -p ghostty-core --tests passes. Surface init gates rt_pre_exec_info, rt_post_fork_info, create_scope and restore_rlimit on cfg(unix). Screen-file writing only sets mode 0600 on unix. The test that read the file mode is unix-gated.
  • Embedded init: global::init calls ensure_locale. InitOptions.crash carries crash metadata, with default_crash_options() (shared version; Metal/CoreText/none tags on Apple). ghostty_init ignores SIGPIPE and passes crash options for the lib build. It also stores the raw argv with ghostty_os::args::set_argv, so ghostty_config_load_cli_args uses it (I added set_argv and a vec-returning iterator() in ghostty-os/args.rs). ghostty_config_load_file keeps non-UTF-8 path bytes (file_load::open decodes them).
  • Bytes: Pwd.pwd and Surface::pwd() carry OSC 7 bytes with the reversible osbytes escape. pwd_bytes() returns the raw bytes. Sinks decode: C Action::Pwd, inherited working dir, termio cwd/args/env/PWD/Raw input. Embedded surface working-directory/command/env/initial_input and ghostty_surface_text (text_callback_bytes) pass raw bytes. GTK file drop uses paste_bytes and a new CoreSurface::complete_paste_bytes.
  • Version: XTVERSION, TERM_PROGRAM_VERSION, both GTK About branches and crash metadata use ghostty_build_info::VERSION_STRING.
  • Tests added: e2e OSC 7 non-UTF-8, command.rs non-UTF-8 cwd/args, embedded surface-options bytes, tests/init_argv.rs (argv, SIGPIPE, non-UTF-8 load_file), crash defaults.
  • Gate: workspace build, tests and clippy (--no-deps -D warnings) for my crates pass, and cargo +nightly fmt is applied. Not done: macOS cross clippy (the wrapper setup was declined at the tool prompt). No GTK drop UI test (needs a display). The paste confirmation dialog is text-based, so it carries non-UTF-8 bytes via the escape.