d0095f6bba56b6616e359087ddd555e80ebfc155
This is a bit fiddly because the serde library doesn't let us know
eg: which key in a map had an error, so we have to show the information
from the value and hope that there is enough context for the user.
This commit adds our own Debug impl for ValueWrapper as that one
provided by mlua isn't useful for tables; our impl will iterate
the pairs in the table and pretty print them.
The struct error message has been adjusted to include the lua
value that failed to deserialize in addition to the type name.
Because the config structs can get quite large, this commit adjusts
the ordering of the components in the error message; we now print
the outermost error first and leave the most specific portion at
the bottom. This is so that the error window is more likely to
show the most useful information at the bottom.
I've added some similar improvements when processing enums.
It's not perfect but hopefully more useful when figuring out
a config problem.
This invalid config:
```lua
local wezterm = require 'wezterm';
return {
keys = {
{key="{", mods="SHIFT|ALT", action="Search"},
}
}
```
yields:
```
While (re)loading configuration: Error converting lua value returned by script /tmp/issue-201.lua to Config struct: while processing a struct of type `Config` with value:
{
"keys": [
{
"mods": "SHIFT|ALT",
"key": "{",
"action": "Search",
},
],
}
while processing a struct of type `Key` with value:
{
"mods": "SHIFT|ALT",
"key": "{",
"action": "Search",
}
while processing an enum of type `KeyAssignment` and value "Search"
which has allowed variants `ActivateCopyMode`, `ActivateTab`, `ActivateTabRelative`, `ClearScrollback`, `CloseCurrentTab`, `CompleteSelection`, `CompleteSelectionOrOpenLinkAtMouseCursor`, `Copy`, `DecreaseFontSize`, `DisableDefaultAssignment`, `ExtendSelectionToMouseCursor`, `Hide`, `HideApplication`, `IncreaseFontSize`, `MoveTab`, `MoveTabRelative`, `Nop`, `OpenLinkAtMouseCursor`, `Paste`, `PastePrimarySelection`, `QuitApplication`, `ReloadConfiguration`, `ResetFontSize`, `ScrollByPage`, `Search`, `SelectTextAtMouseCursor`, `SendString`, `Show`, `ShowLauncher`, `ShowTabNavigator`, `SpawnCommandInNewTab`, `SpawnCommandInNewWindow`, `SpawnTab`, `SpawnWindow`, `ToggleFullScreen`
Expected a variant with parameters but got a unit variant instead
```
refs: https://github.com/wez/wezterm/issues/201
Wez's Terminal
A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
User facing home page at: https://wezfurlong.org/wezterm/
Screenshot of wezterm on macOS, running vim
Installation
https://wezfurlong.org/wezterm/installation.html
Getting help
This is a spare time project, so please bear with me. There are two channels for support:
- You can use the GitHub issue tracker to see if someone else has a similar issue, or to file a new one: https://github.com/wez/wezterm/issues
- There is a Gitter room which is bridged to the Matrix/Riot.im for (potentially!) real time discussions
The Gitter/Matrix room is probably better suited to questions than it is to bug reports, but don't be afraid to use whichever you are most comfortable using and we'll work it out.
Description
The agentic terminal: a WezTerm fork with LLeMbas built in
316 MiB
0 Stars
2 Watchers
0 Forks
Languages
Rust
97.7%
Python
1%
Shell
0.9%
Nix
0.2%
