{"record":{"id":"69396dc400444a26","repo":"wezterm/wezterm","slug":"error","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/src/lib.rs","lineNumber":459,"sourceCode":"pub fn configuration() -> ConfigHandle {\n    CONFIG.get()\n}\n\n/// Returns a version of the config (loaded from the config file)\n/// with some field overridden based on the supplied overrides object.\npub fn overridden_config(overrides: &wezterm_dynamic::Value) -> Result<ConfigHandle, Error> {\n    CONFIG.overridden(overrides)\n}\n\npub fn reload() {\n    CONFIG.reload();\n}\n\n/// If there was an error loading the preferred configuration,\n/// return it, otherwise return the current configuration\npub fn configuration_result() -> Result<ConfigHandle, Error> {\n    if let Some(error) = CONFIG.get_error() {\n        bail!(\"{}\", error);\n    }\n    Ok(CONFIG.get())\n}\n\n/// Returns the combined set of errors + warnings encountered\n/// while loading the preferred configuration\npub fn configuration_warnings_and_errors() -> Vec<String> {\n    CONFIG.get_warnings_and_errors()\n}\n\nstruct ConfigInner {\n    config: Arc<Config>,\n    error: Option<String>,\n    warnings: Vec<String>,\n    generation: usize,\n    watcher: Option<notify::RecommendedWatcher>,\n    subscribers: HashMap<usize, Box<dyn Fn() -> bool + Send>>,\n}","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/wezterm/wezterm/blob/3ff7522b9617ec920f7fbdb22b57e93d42d93ee9/config/src/lib.rs#L441-L477","documentation":"wezterm::config::configuration_result() (config/src/lib.rs:459) is the umbrella surface for 'your config failed to load': the Lua config is evaluated lazily, and if evaluation produced an error (syntax error, runtime error, invalid option value) the error is stored on the global CONFIG and re-raised here as bail!(\"{}\", error). The message body is whatever the config loader recorded — typically a Lua error with file/line information. Hitting it means the config handle you asked for was never built.","triggerScenarios":"A syntax error in wezterm.lua or a required config file; calling a nonexistent WezTerm API (e.g. wezterm.some_misspelled_fn()); passing a wrong-typed option value; `--config key=value` overrides whose RHS evaluates to nil; a plugin that requires a newer WezTerm version.","commonSituations":"Editing the config and introducing a typo; upgrading WezTerm across releases where options were renamed or removed; a plugin update that calls APIs not present in the installed binary.","solutions":["Read the embedded message — it carries the original Lua error including chunk name and line number; fix that location first.","Reproduce from a shell without the GUI: run any `wezterm` CLI subcommand (e.g. `wezterm show-keys`) — it loads the config and prints the same error to stderr.","Bisect by commenting out recently changed sections, especially event callbacks and plugin requires.","After a version upgrade, check the changelog/docs for renamed options; update or pin plugins whose API calls no longer exist."],"exampleFix":"-- before (wezterm.lua)\nlocal wezterm = require 'wezterm'\nwezterm.nonexistent_function() -- runtime error: attempt to call a nil value\nreturn {}\n\n-- after\nlocal wezterm = require 'wezterm'\nreturn {}","handlingStrategy":"try-catch","validationCode":"# CI / shell: any CLI subcommand loads the config and exits non-zero on error\nwezterm show-keys --lua > /dev/null || { echo 'config failed to load'; exit 1; }","typeGuard":null,"tryCatchPattern":"let config = match wezterm::config::configuration_result() {\n    Ok(handle) => handle,\n    Err(err) => {\n        log::error!(\"config failed to load: {err:#}\");\n        // fall back to last-good handle or defaults instead of propagating\n        return;\n    }\n};","preventionTips":["Test config changes by running a CLI subcommand before reloading the GUI.","Keep the config in version control so a broken edit is one revert away.","After upgrading wezterm or plugins, re-run the config check — renamed options surface here."],"tags":["wezterm","config","lua","startup","rust"],"backgroundTag":"config-load-failed","analyzedSha":"3ff7522b9617ec920f7fbdb22b57e93d42d93ee9","analyzedAt":"2026-08-20T04:47:31.434Z","contentChangedAt":"2026-08-20T04:47:31.434Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}