Files
ghostty-rs/crates/ghostty-cli/src/lib.rs
T
ddidderr f76179f49a fix: +show-face u21/UTF-8 semantics, Zig output buffering, isAbsolute
Resolves RV14 (docs/rewrite/notes/review-rv14-codex.md, final-Z17.md):
- +show-face --cp parses as u21 (new U21 field type): out-of-range
  values give an invalid-value diagnostic and exit 1 instead of a panic;
  --string accepts raw bytes and fails with error.InvalidUtf8 after the
  codepoint lookup like Zig.
- CLI actions write through ZigWriter, a model of Zig 0.15's buffered
  File.writer (fixed buffer, drain on overflow, explicit flush), so
  stdout/stderr interleave in Zig's flush order (+show-face, help,
  version, validate-config, show-config, list-*, ssh-cache, crash-report,
  edit-config, new-window).
- Zig 0.15.2 std.fs.path.isAbsolute port (Windows: \theme and /theme are
  absolute) replaces Path::is_absolute at every Zig isAbsolute site.
- io_uring is available iff a 256-entry ring can be created, like
  libxev; the reactor falls back to IORING_OP_TIMEOUT without EXT_ARG.
- Windows basename (`λ:theme`) verified against 0.15.2 (test added).

Test Plan:
- cargo test --workspace --no-fail-fast
- diff +show-face outputs (pipe) against /usr/bin/ghostty
2026-10-12 15:15:18 +02:00

48 lines
1.2 KiB
Rust

//! ghostty-cli: `ghostty +action` CLI actions (ZIG/src/cli).
//!
//! Every action lives in its own module and exposes `run(args)`, which takes
//! the full process argument vector (including `argv[0]`, like Zig's
//! `args.argsIterator`) and returns the process exit code. Actions write to
//! stdout/stderr exactly like the Zig implementation.
#![allow(
clippy::wildcard_imports,
clippy::struct_field_names,
clippy::items_after_statements,
clippy::needless_pass_by_value,
clippy::too_many_arguments,
clippy::type_complexity,
clippy::collapsible_if,
clippy::doc_lazy_continuation,
clippy::doc_overindented_list_items
)]
#[macro_use]
mod options;
pub mod action;
pub mod boo;
pub mod build_info;
pub mod crash_report;
pub mod edit_config;
pub mod error;
pub mod ghostty;
pub mod help;
pub mod list_actions;
pub mod list_colors;
pub mod list_fonts;
pub mod list_keybinds;
pub mod list_themes;
pub mod new_window;
pub mod show_config;
pub mod show_face;
pub mod ssh_cache;
pub mod tui;
pub mod validate_config;
pub mod version;
pub(crate) mod zig_writer;
pub use error::Error;
pub use ghostty::{Action, run_from_args};
pub use options::{NoOptions, parse_options};