Skip to main content

Quick Start

Create a file named .wezterm.lua in your home directory with the following contents:

Configuration File Locations

WezTerm searches for your configuration file in the following order:
1

Command Line Argument

Use the --config-file CLI argument to specify a custom location:
2

Environment Variable

Set the WEZTERM_CONFIG_FILE environment variable:
3

Windows Portable Mode

On Windows, WezTerm checks if wezterm.lua exists in the same directory as wezterm.exe (useful for running from a USB drive).
4

XDG Config Directory

If $XDG_CONFIG_HOME is set:
5

Standard Config Directory

Platform-specific standard locations:
6

Home Directory (Recommended)

The simplest option for single-file configurations:
For simple configurations, use $HOME/.wezterm.lua. For complex multi-file setups, use ~/.config/wezterm/wezterm.lua.

Configuration File Structure

The configuration file is a Lua script that must return a configuration table:

Using config_builder()

The wezterm.config_builder() function creates a configuration object with built-in validation:

Configuration Reloading

WezTerm automatically watches your configuration file for changes:
  • Changes take effect immediately for most options
  • Use CTRL+SHIFT+R to manually reload the configuration
  • Some options (like domain configurations) may require restart
Your configuration file may be evaluated multiple times. Avoid side effects like unconditionally spawning background processes or writing to files in the main configuration flow.

Command Line Overrides

You can override configuration values via command line arguments:
Command line overrides persist even after configuration reloads.

Multi-File Configurations

For complex configurations, organize your config across multiple files:

Module Path Configuration

Lua’s package.path is pre-configured with these directories:
  • ~/.config/wezterm/
  • ~/.wezterm/
  • System-specific Lua module paths

Creating Modules

Create a helper module at ~/.config/wezterm/helpers.lua:
helpers.lua
Use the module in ~/.config/wezterm/wezterm.lua:
wezterm.lua

Example Multi-File Structure

Per-Window Configuration Overrides

You can set window-specific overrides dynamically:

Configuration Validation

WezTerm validates your configuration on load:
If your configuration file has syntax errors or fails to load, WezTerm will display an error and use default settings.
To test your configuration:

Best Practices

1

Use config_builder()

Always use wezterm.config_builder() for better error messages and validation.
2

Avoid Side Effects

Don’t spawn processes or write files in the main configuration flow. Use event handlers instead.
3

Comment Your Config

Add comments explaining non-obvious configuration choices.
4

Version Control

Keep your configuration in version control (git) for easy backups and history.
5

Start Simple

Begin with a minimal configuration and add features as needed.

Troubleshooting

Configuration Not Loading

  1. Check file location:
  2. Verify Lua syntax:
  3. Check WezTerm logs:
    • Press CTRL+SHIFT+L to open the debug overlay
    • Look for error messages

Changes Not Taking Effect

  • Manually reload: CTRL+SHIFT+R
  • Some options require restart
  • Check for command-line overrides that may conflict

Module Not Found

If require 'mymodule' fails:
  1. Verify file is named mymodule.lua
  2. Place in ~/.config/wezterm/ or ~/.wezterm/
  3. Check file permissions
  4. Verify no syntax errors in the module file