mirror-ghostty/src/cli
Jon Parise a5550a2dcb cli: fix readEntries leak and double-free
readEntries had two memory bugs on the allocation failure path, both
only reachable under OOM:

- The map itself was never freed if we ran into an allocation failure
- The unconditional `errdefer`s for the dupe'd hostname and terminfo
  values could double-free if there was a later allocation failure.

This change restructures this function so that these values are dupe'd
up-front, and then their ownership is tracked using optionals that can
be null'ed out once their ownership is transferred into the map.

Both of these cases are now covered by unit tests.
2026-05-25 11:49:01 -04:00
..
ssh-cache cli: fix readEntries leak and double-free 2026-05-25 11:49:01 -04:00
CommaSplitter.zig windows: handle backslash paths in config value parsing 2026-03-23 19:30:14 +01:00
Pager.zig cli: also recognize $GHOSTTY_PAGER 2026-03-30 10:53:53 -04:00
README.md docs: generate mdx file for cli actions 2025-01-23 15:58:33 -08:00
action.zig cli: make the action parser (+foo) generic and reusable 2025-07-09 15:06:24 -07:00
args.zig logging: document GHOSTTY_LOG and make it more flexible 2025-12-15 11:54:36 -08:00
boo.zig Remove unused imports 2025-11-27 13:37:53 -08:00
crash_report.zig Zig 0.15: zig build test 2025-10-03 07:10:43 -07:00
diagnostics.zig perf: replace `std.debug.assert` with inlined version 2025-11-17 12:13:56 -07:00
edit_config.zig cli: escape path in +edit-config 2026-03-27 12:24:26 -05:00
explain_config.zig cli: use a caller-provided write buffer 2026-03-30 10:48:07 -04:00
ghostty.zig cli: add an ssh-wrapping +ssh action (#12582) 2026-05-22 09:04:36 -07:00
help.zig Zig 0.15: zig build test 2025-10-03 07:10:43 -07:00
list_actions.zig fix: list-actions outputs without `--docs` 2026-03-08 15:51:09 +01:00
list_colors.zig Zig 0.15: zig build test 2025-10-03 07:10:43 -07:00
list_fonts.zig address review: Discover.init takes a Library across all backends 2026-04-23 23:06:21 +09:00
list_keybinds.zig feat(cli): list keybindings from key tables 2025-12-23 08:19:45 -06:00
list_themes.zig remove auto theme include in config-template 2025-12-17 01:50:53 +08:00
lorem_ipsum.txt cli: "fancy" theme preview 2024-09-27 10:53:58 -07:00
new_window.zig gtk: fix +new-window `--working-directory` inferrence. 2026-03-11 02:23:12 -05:00
show_config.zig cli: add pager support for +show-config 2026-03-30 10:48:07 -04:00
show_face.zig Zig 0.15: zig build test 2025-10-03 07:10:43 -07:00
ssh.zig cli: add an ssh-wrapping +ssh action 2026-05-04 20:21:45 -04:00
ssh_cache.zig Remove unused imports 2025-11-27 13:37:53 -08:00
toggle_quick_terminal.zig Fix "Available since" 2026-05-17 14:42:27 -05:00
tui.zig cli/crash-report: make it simpler (uglier, honestly) 2024-09-10 21:15:40 -07:00
validate_config.zig Remove unused imports 2025-11-27 13:37:53 -08:00
version.zig Zig 0.15: zig build test 2025-10-03 07:10:43 -07:00

README.md

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.