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
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.
Display help information for this command.
Examples
Validate Default Configuration
Validate Specific File
Validate Absolute Path
Check Exit Code
Validate in CI/CD
GitHub Actions
Common Validation Errors
Unknown Configuration Key
Error
Fix: Correct the option name (should be
font-family)
Invalid Value Type
Error
Fix: Ensure the value matches the expected type
Invalid Enum Value
Error
Fix: Use one of the valid values listed
Syntax Error
Error
Fix: Ensure proper
key = value format
Theme Not Found
Error
Fix: Use
ghostty +list-themes to find available themes
Font Not Found
Warning
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
- show-config - Display current configuration
- edit-config - Open config in editor
- Configuration Reference