Skip to main content
The validate-config command checks a Ghostty configuration file for syntax errors, invalid options, and configuration problems.

Usage

Description

This command validates a Ghostty configuration file without launching the terminal. It reports any errors, warnings, or issues found in the configuration. When executed without arguments, it validates the configuration from the default location ($XDG_CONFIG_HOME/ghostty/config or equivalent for your platform). The command exits with code 0 if validation succeeds and code 1 if any problems are found.

Options

string
Path to a specific configuration file to validate. If not specified, validates the default configuration file location.The path can be absolute or relative to the current directory.
flag
Display help information for this command.

Examples

Validate Default Configuration

Validate Specific File

Validates a configuration file in the current directory.

Validate Absolute Path

Validates a configuration file at an absolute path.

Check Exit Code

Validate in CI/CD

GitHub Actions

Common Validation Errors

Unknown Configuration Key

Error
Cause: Typo in option name
Fix: Correct the option name (should be font-family)

Invalid Value Type

Error
Cause: Wrong type for option value
Fix: Ensure the value matches the expected type

Invalid Enum Value

Error
Cause: Invalid choice for enum option
Fix: Use one of the valid values listed

Syntax Error

Error
Cause: Malformed configuration line
Fix: Ensure proper key = value format

Theme Not Found

Error
Cause: Referenced theme doesn’t exist
Fix: Use ghostty +list-themes to find available themes

Font Not Found

Warning
Cause: Specified font not available
Fix: Use ghostty +list-fonts to find available fonts

Validation Checks

The validator checks for:
  • Syntax errors: Malformed configuration lines
  • Unknown keys: Option names that don’t exist
  • Type errors: Values that don’t match the expected type
  • Range errors: Numeric values outside valid ranges
  • Enum errors: Invalid choices for option values
  • File references: Missing theme or font files
  • Keybind errors: Invalid keybinding syntax
  • Conditional errors: Malformed conditional configuration

Use Cases

Pre-Deployment Validation

Editor Integration

Configure your editor to run validation on save:
.vimrc

Configuration Management

Script

Notes

Validation includes checking for recursive file inclusions and evaluating conditional configuration, so the validation represents the actual configuration that would be loaded.
Some warnings (like missing fonts) won’t prevent the configuration from loading, but will cause Ghostty to fall back to defaults. These still appear in validation output.
The validator resolves relative paths based on the configuration file’s location, just like Ghostty does when loading the config.

Exit Codes

  • 0 - Configuration is valid (no errors)
  • 1 - Configuration has errors or warnings

See Also