1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-11 03:27:05 +03:00
A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
Go to file
Wez Furlong d0095f6bba wezterm: improve config deserialization error messages
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
2020-05-31 17:56:39 -07:00
.cargo build static on windows for static openssl linkage 2020-02-02 13:03:07 -08:00
.github ci: change git download URL 2020-05-30 10:31:35 -07:00
assets wezterm: generate version info resource at build time 2020-05-25 12:36:29 -07:00
base91 dyn everywhere 2019-06-08 21:28:11 -07:00
ci ci: change git download URL 2020-05-30 10:31:35 -07:00
deps try to target older macos releases 2020-01-27 00:12:47 -08:00
docs docs: bleh, missed fixing a link 2020-05-30 11:40:27 -07:00
filedescriptor filedescriptor: probe for pipes between wsl and win32 2020-05-09 10:56:53 -07:00
promise promise: add tokio_spawn helper 2020-01-20 07:55:51 -08:00
pty pty: bump for 0.3.0 release 2020-05-17 12:14:55 -07:00
rangeset mux: reintroduce server side state to gate pushes 2020-01-10 08:56:27 -08:00
src wezterm: improve config deserialization error messages 2020-05-31 17:56:39 -07:00
tabout termwiz: cut 0.9.0 release 2020-05-17 12:05:46 -07:00
term wezterm: fixup DECKPAM/DECANM/DECCKM interaction 2020-05-31 15:45:25 -07:00
termwiz wezterm: fixup DECKPAM/DECANM/DECCKM interaction 2020-05-31 15:45:25 -07:00
vtparse vtparse: bump version for publish 2020-02-22 07:32:52 -08:00
window window: allow for stronger separation between raw and composed keys 2020-05-28 19:35:50 -07:00
.gitignore docs: split install page into pages by platform 2020-05-30 10:30:32 -07:00
.gitmodules fix CI: savannah is down, use a github mirror for freetype 2019-11-24 13:28:02 -08:00
.rustfmt.toml Make rustfmt happy about "async move" 2020-01-20 13:58:21 -08:00
build.rs really fixup the windows build 2020-05-25 16:48:49 -07:00
Cargo.lock cargo update 2020-05-25 22:25:39 -07:00
Cargo.toml wezterm: generate version info resource at build time 2020-05-25 12:36:29 -07:00
CONTRIBUTING.md Add get-deps script for installing dependencies 2018-02-25 09:24:56 -08:00
get-deps CI: add centos 8 builds 2020-05-04 21:55:23 -07:00
install.sh refine deploy scripts/config 2019-03-24 00:26:53 -07:00
LICENSE.md flesh out some details prior to pushing to github 2018-02-06 21:32:40 -08:00
README.md ci: remove old badges from readme 2020-02-12 13:21:57 -08:00
wt-record update record/play scripts for macos 2019-03-22 20:41:50 -07:00
wt-replay update record/play scripts for macos 2019-03-22 20:41:50 -07:00

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

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:

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.