Files
ghostty/src/cli
Jon Parise 484d6ec66b cli: add an ssh-wrapping +ssh action
Add a drop-in `ssh` wrapper that sets up the remote environment for
Ghostty. Anything not consumed as one of our own flags is forwarded to
the real, wrapped `ssh` binary. It can be used directly (`ghostty +ssh
user@host`), aliased (`alias ssh='ghostty +ssh --'`), or invoked through
Ghostty's shell integration.

Before exec'ing ssh, `+ssh`:

- Forwards Ghostty environment to the remote (`--forward-env`): sets
  TERM=xterm-256color and requests SendEnv forwarding of COLORTERM,
  TERM_PROGRAM, and TERM_PROGRAM_VERSION.
- Installs Ghostty's terminfo on the remote (`--terminfo`), informed by
  our existing `ssh-cache` system and using our internal xterm-ghostty
  terminfo representation.

A third flag, `--cache`, controls cache use; `--cache=false` bypasses
both read and write, which is useful for scripting and for debugging
install failures without polluting the cache.

For shell integration, this replaces the per-shell logic (which made up
roughly a third of our shell integration scripts) with a simple wrapper
function that translates GHOSTTY_SHELL_FEATURES into a `ghostty +ssh`
command line. This commit only migrates the bash integration; the other
shells will follow separately.
2026-05-04 20:21:45 -04:00
..
2025-11-27 13:37:53 -08:00
2025-10-03 07:10:43 -07:00
2025-10-03 07:10:43 -07:00
2025-10-03 07:10:43 -07:00
2024-09-27 10:53:58 -07:00
2026-03-30 10:53:53 -04:00
2025-10-03 07:10:43 -07:00
2025-11-27 13:37:53 -08:00
2026-05-04 20:21:45 -04:00
2025-11-27 13:37:53 -08:00
2025-10-03 07:10:43 -07:00

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.