mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-30 10:12:13 +00:00
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`.
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.