feat: add a hyde deployment metafile and split the wezterm config - #5
Conversation
📝 WalkthroughWalkthroughAdds HyDE deployment metadata for WezTerm, introduces a managed defaults module, delegates ChangesHyDE WezTerm integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant HyDE
participant Wallbash
participant WezTerm
HyDE->>Wallbash: Deploy wezterm.dcol
Wallbash->>WezTerm: Generate hyde.toml
WezTerm->>WezTerm: Reload watched configuration
Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@wezterm/hyde.lua`:
- Line 20: Replace the manually reconstructed config_dir in hyde.lua with
WezTerm’s resolved wezterm.config_dir value, ensuring palette checks and file
watching use the directory containing the active configuration loaded via
--config-file or WEZTERM_CONFIG_FILE.
In `@wezterm/README.md`:
- Around line 48-49: Update the two WezTerm reference links in the README from
the obsolete wezfurlong.org/wezterm/config URLs to their corresponding
wezterm.org/config URLs, preserving the existing link labels and anchors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 80921921-1faa-4d42-bb48-baefddf804ab
📒 Files selected for processing (5)
dots.tomlwezterm/README.mdwezterm/hyde.luawezterm/wezterm.dcolwezterm/wezterm.lua
|
|
||
| local M = {} | ||
|
|
||
| local config_dir = (os.getenv("XDG_CONFIG_HOME") or (os.getenv("HOME") .. "/.config")) .. "/wezterm" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg '(^|/)wezterm/|hyde\.lua$|hyde\.toml$|wezterm' || true
echo "== hyde.lua =="
if [ -f wezterm/hyde.lua ]; then
cat -n wezterm/hyde.lua
else
fd -a 'hyde\.lua$' . | while read -r f; do echo "--- $f"; cat -n "$f"; done
fi
echo "== wezterm config files =="
git ls-files wezterm | sortRepository: HyDE-Project/terminal-emulators
Length of output: 3569
🌐 Web query:
WezTerm Lua config_dir command line --config-file WEZTERM_CONFIG_FILE documentation
💡 Result:
In WezTerm, you can specify a custom configuration file via the command line or environment variable, and access the configuration directory path within your Lua configuration. Command Line and Environment Configuration You can override WezTerm's default configuration file resolution using the following methods: 1. --config-file CLI Argument: You can specify a custom configuration file by using the --config-file flag when launching WezTerm [1][2]. Example: wezterm --config-file /path/to/my-config.lua 2. WEZTERM_CONFIG_FILE Environment Variable: Setting this environment variable will also direct WezTerm to use the specified file as your configuration [1][3]. Note that configuration specified via the --config CLI argument (for individual key/value overrides) will always override the values provided in your configuration file, even if that file is reloaded [1][4]. Accessing the Directory in Lua Within your wezterm.lua configuration file, you can access the path of the directory containing the loaded configuration file using the wezterm.config_dir constant [5]. Example usage: local wezterm = require 'wezterm' wezterm.log_info('The configuration directory is: '.. wezterm.config_dir) This constant is useful for modularizing your configuration, such as requiring other Lua files located in the same directory as your main wezterm.lua [3].
Citations:
- 1: https://wezterm.org/config/files.html
- 2: https://wezterm.org/cli/general.html
- 3: https://wezterm-wezterm.mintlify.app/config/files
- 4: https://github.com/wezterm/wezterm/blob/76b606ec/docs/config/files.md
- 5: https://wezterm.org/config/lua/wezterm/config_dir.html
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== wezterm.lua outline =="
ast-grep outline wezterm/wezterm.lua --view expanded || true
echo "== wezterm.lua relevant content =="
cat -n wezterm/wezterm.lua
echo "== hyde.lua usages =="
rg -n "config\\(|require\\(\"hyde\"\\)|hyde\\.toml|config_dir" wezterm -SRepository: HyDE-Project/terminal-emulators
Length of output: 1632
🌐 Web query:
wezterm --config-file config_dir lua "local file"
💡 Result:
To use a specific configuration file with WezTerm, you can use the --config-file command-line argument. This flag overrides the standard configuration file resolution logic [1][2]. Usage syntax: wezterm --config-file /path/to/your/config.lua If you are referring to the wezterm.config_file variable within a Lua configuration script, this variable provides the absolute path to the configuration file that WezTerm is currently using [3]. It is part of the wezterm module and can be accessed as follows: local wezterm = require 'wezterm' print(wezterm.config_file) Similarly, wezterm.config_dir provides the path to the directory containing that configuration file [3]. These are often useful when you need to reference other files (such as themes or helper scripts) relative to your main configuration file.
Citations:
- 1: https://wezterm.org/cli/general.html
- 2: https://wezterm.org/config/files.html
- 3: https://wezterm-wezterm.mintlify.app/lua/wezterm/overview
Use WezTerm’s resolved configuration directory.
This reconstruction ignores configurations loaded via --config-file or WEZTERM_CONFIG_FILE, so hyde.lua checks/watches the built-in wezterm/hyde.toml instead of the palette relative to the actual config directory. Use wezterm.config_dir, which points to the directory containing the loaded configuration file.
Proposed fix
-local config_dir = (os.getenv("XDG_CONFIG_HOME") or (os.getenv("HOME") .. "/.config")) .. "/wezterm"
+local config_dir = wezterm.config_dir📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| local config_dir = (os.getenv("XDG_CONFIG_HOME") or (os.getenv("HOME") .. "/.config")) .. "/wezterm" | |
| local config_dir = wezterm.config_dir |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@wezterm/hyde.lua` at line 20, Replace the manually reconstructed config_dir
in hyde.lua with WezTerm’s resolved wezterm.config_dir value, ensuring palette
checks and file watching use the directory containing the active configuration
loaded via --config-file or WEZTERM_CONFIG_FILE.
| - [WezTerm configuration files](https://wezfurlong.org/wezterm/config/files.html) | ||
| - [WezTerm colour schemes](https://wezfurlong.org/wezterm/config/appearance.html#defining-a-color-scheme-in-a-separate-file) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the WezTerm reference links.
Both wezfurlong.org/wezterm/config/... URLs currently return 404; the official pages are now under wezterm.org/config/.... ()
Proposed fix
-- [WezTerm configuration files](https://wezfurlong.org/wezterm/config/files.html)
-- [WezTerm colour schemes](https://wezfurlong.org/wezterm/config/appearance.html#defining-a-color-scheme-in-a-separate-file)
+- [WezTerm configuration files](https://wezterm.org/config/files.html)
+- [WezTerm colour schemes](https://wezterm.org/config/appearance.html#defining-a-color-scheme-in-a-separate-file)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - [WezTerm configuration files](https://wezfurlong.org/wezterm/config/files.html) | |
| - [WezTerm colour schemes](https://wezfurlong.org/wezterm/config/appearance.html#defining-a-color-scheme-in-a-separate-file) | |
| - [WezTerm configuration files](https://wezterm.org/config/files.html) | |
| - [WezTerm colour schemes](https://wezterm.org/config/appearance.html#defining-a-color-scheme-in-a-separate-file) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@wezterm/README.md` around lines 48 - 49, Update the two WezTerm reference
links in the README from the obsolete wezfurlong.org/wezterm/config URLs to
their corresponding wezterm.org/config URLs, preserving the existing link labels
and anchors.
Follow-up to HyDE-Project/HyDE#1874, where @kRHYME7 suggested hosting the WezTerm config here and letting HyDE consume
dots.tomlover the branch archive.dots.tomlat the root declares the WezTerm dot. Paths are written without the archive's top-level directory, since the installer strips it when the archive contains a single root.wezterm/hyde.luais new: HyDE's defaults behindrequire("hyde").config().wezterm/wezterm.luabecomes the three-line entry point that calls it, so an update can replace the defaults without touching what the user edited.Two fixes carried over from that PR:
hyde.tomlexists. Naming a missing scheme makes WezTerm logcolor_scheme="wallbash" but that scheme was not foundon every start, which is what a fresh install looks like before the first theme switch.config_builder()is called through a guard, so a build that predates it gets a plain table instead of an error.The template's target line moves from
${HOME}/.configto${confDir}, matching the other templates HyDE ships.Checked against WezTerm 20260117 with
wezterm --config-file … show-keys: clean with the palette present and with it absent.dots.tomlparses, the rendered template parses as TOML with the scheme name and eight ansi colours in place.Summary by CodeRabbit
New Features
wezterm.luaas a user-owned entry point.Documentation