Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
teach ValuePrinter about binary strings
This commit changes how lua Strings are rendered when printing them through ValuePrinter. Previously, we'd try to convert to a utf8 string and print the bare string to the output. If it failed, we'd get a less than useful output; for this example when inspecting the the `utf8` global module from the debug overlay: ``` > utf8.charpattern (error converting Lua string to &str (invalid utf-8 sequence of 1 bytes from index 4)) ``` Now we handle the failure case and show it as a binary string using a somewhat invented syntax; the `b"string"` syntax isn't valid in lua, but it helps to communicate that this is a binary string: ``` > utf8.charpattern b"[\x00-\x7f\xc2-\xfd][\x80-\xbf]*" ``` in addition, we now quote and escape unicode strings. Previously; ``` > wezterm.target_triple x86_64-unknown-linux-gnu ``` now: ``` > wezterm.target_triple "x86_64-unknown-linux-gnu" ``` refs: #4336
- Loading branch information