Skip to main content
The edit-config command opens the Ghostty configuration file in the editor specified by your $VISUAL or $EDITOR environment variables.

Usage

Description

This command provides a quick way to edit your Ghostty configuration. It opens the default user-specific configuration file in your preferred terminal text editor. The command uses the $VISUAL environment variable first, falling back to $EDITOR if $VISUAL is not set. If neither is set, it displays an error with the configuration file path so you can open it manually.
This command will not automatically reload the configuration after editing. You must manually reload using:
  • The application menu option
  • A configured keybind (typically bound to reload_config action)
  • Restarting Ghostty

Configuration File Locations

The command opens the default user configuration file:

Linux/BSD

  • $XDG_CONFIG_HOME/ghostty/config (typically ~/.config/ghostty/config)

macOS

Ghostty checks these locations in priority order:
  1. $XDG_CONFIG_HOME/ghostty/config (if set)
  2. ~/Library/Application Support/com.mitchellh.ghostty/config
  3. ~/.config/ghostty/config
Whichever path exists and is non-empty is prioritized. If neither exists, the Application Support directory is preferred.

Prerequisites

Setting Up Your Editor

Set one of these environment variables in your shell configuration:
.bashrc / .zshrc

VISUAL vs EDITOR

  • $VISUAL - Used for “visual” editors (vim, emacs, etc.)
  • $EDITOR - Used for line-based editors (ed, sed, etc.)
  • Ghostty prefers $VISUAL over $EDITOR if both are set

Examples

Basic Usage

Opens the configuration file in your default editor.

Set Editor and Open Config

One-Time Editor Override

Use a different editor just for this command.

Create Config If Missing

If the configuration file doesn’t exist, Ghostty creates it with default settings before opening.

Error Messages

Editor Not Set

Error
Solution: Set $EDITOR or $VISUAL in your shell configuration.

Editor Execution Failed

Error
Solution: Verify the editor command is in your $PATH and is executable.

Platform Support

Linux/BSD/macOS

Fully supported using the exec system call to launch your editor.

Windows

The +edit-config command is not currently supported on Windows. The command will display an error with the configuration file path for manual editing.
Windows Error

Workflow

Typical Edit Session

  1. Run ghostty +edit-config
  2. Make your changes in the editor
  3. Save and quit the editor
  4. Reload Ghostty configuration:
    • Press your reload keybind (e.g., super+shift+,)
    • Or restart Ghostty

Validate After Editing

Edit and Test Workflow

Script

Tips

Use show-config --default --docs > reference.txt to generate a complete reference file with all available options and their documentation.
Set up a keybinding for quick config access:
This uses the open_config action which has the same effect as +edit-config.
Consider using a simple editor like nano if you’re new to terminal editors:

Auto-Reload (Future)

Ghostty plans to support automatic configuration reloading in the future. Until then, manual reload is required after editing.

Config File Watching

You can set up external file watching to automatically reload:
Using fswatch

Notes

The command uses the POSIX exec system call on Unix-like systems, which replaces the current process with the editor. This is why the command doesn’t return until you exit the editor.
If you have multiple Ghostty configuration files (via includes or conditional configs), this command only opens the main default configuration file, not included files.

See Also