mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 03:25:50 +00:00
We previously wrote our new cache file into a temporary directory and the (atomically) renamed it to the canonical cache file path. This rename operation unfortunately only works when both files are on the same file system, and that's not always the case (e.g. when $TMPDIR is on its own file system). Instead, we can use Zig's AtomicFile to safely perform this operation inside of the cache directory. There's a new risk of a crash leaving the temporary file around in this directory (and not getting cleaned up like $TMPDIR-based files), but the probability is low and those files will only be readable by the creating user (mode 0o600). There's a new test cash that verifies the expected AtomicFile clean up behavior. I also switched the file-oriented tests to use testing.tmpDir rather than using our application-level TempDir type.
Subcommand Actions
This is the cli specific code. It contains cli actions and tui definitions and argument parsing.
This README is meant as developer documentation and not as user documentation. For user documentation, see the main README or ghostty.org.
Updating documentation
Each cli action is defined in it's own file. Documentation for each action is defined
in the doc comment associated with the run function. For example the run function
in list_keybinds.zig contains the help text for ghostty +list-keybinds.