Files
ghostty/src/cli
Jeffrey C. Ollie d10e474860 gtk-ng: deprecate detection of launch source
Detecting the launch source frequently failed because various launchers
fail to sanitize the environment variables that Ghostty used to
detect the launch source. For example, if your desktop environment was
launched by `systemd`, but your desktop environment did not sanitize the
`INVOCATION_ID` or the `JOURNAL_STREAM` environment variables, Ghostty
would assume that it had been launched by `systemd` and behave as such.

This led to complaints about Ghostty not creating new windows when users
expected that it would.

To remedy this, Ghostty no longer does any detection of the launch
source. If your launch source is something other than the CLI, it must
be explicitly speciflied on the CLI. All of Ghostty's default desktop
and service files do this. Users or packagers that create custom desktop
or service files will need to take this into account.

On GTK, the `desktop` setting for `gtk-single-instance` is replaced with
`detect`. `detect` behaves as `gtk-single-instance=true` if one of the
following conditions is true:

1. If no CLI arguments have been set.
2. If `--launched-from` has been set to `desktop`, `dbus`, or `systemd`.

Otherwise `detect` behaves as `gtk-single-instance=false`.
2025-09-05 09:54:24 -05:00
..
2025-03-12 09:55:52 -07:00
2025-07-14 14:48:10 -05:00
2025-07-30 14:29:38 +10:00
2024-09-27 10:53:58 -07:00
2025-09-05 10:10:52 +02: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.