The issue here was that the from_dynamic impl derived for a struct
that was inlined in an enum didn't respect the the field properties
defined for the struct.
Refactor to reuse the same field_info helper used by the struct
code.
Update docs to clarify what the default value actually is.
refs: https://github.com/wez/wezterm/issues/2179
In #2177 we found that one of the examples that tries to use
the default initialization was failing. The root cause is that
we were constructing a value like:
`{ExtendSelectionToMouseCursor=nil}`
which is effectively the same as:
`{}`
but that has no information on the enum variant name.
This commit avoids mapping DynValue::Null to LuaValue::Nil
and instead uses a light user data nullptr value.
That allows the structure to round trip correctly.
refs: #2177
In https://github.com/wez/wezterm/issues/2170 a config like this was
used:
```lua
return {
keys = {
{key="e", ...},
copy_Mode = {
{key="a", ...}
}
}
}
```
instead of the intended:
```lua
return {
keys = {
{key="e", ...},
},
key_tables={
copy_Mode = {
{key="a", ...}
}
},
}
```
This commit makes an attempt at detecting when non-numeric, or sparse
numeric, keys are used for an array style table and generates an error.
The error isn't ideal, but it at least indicates that something is
wrong:
```
Configuration Error: Error converting lua value returned by script
/tmp/whoops.lua to Config struct: error converting Lua table to Config
(error converting Lua table to value (while processing "keys": error
converting Lua string to numeric array index (Unexpected key "copy_mode"
for array style table)))
```
refs: #2170
dc728b3895 introduced some non-determinism
by mutating the global TARGETS list.
The result is, depending on iteration order, the generated jobs
may inherit the env from earlier jobs.
Notably, if the tag job inherit the schedule reason from a continuous
job, they'll upload assets with an incorrect filename.
This commit restores the determinism by forcing each iteration
of the generation loop to make a deep copy of the statically
defined information in TARGETS.
While we're at it, ensure that the list of env vars is sorted
to avoid non-determinism there as well.
refs: https://github.com/wez/wezterm/issues/2176
I noticed that the opensuse rpms didn't show up in the latest release,
and traced it to the spec file not setting anything in the filename
to distinguish the rpm files.
This commit replaces the redhat-ish short suffix with one of our
own derived from the os info.
subst-release-info.py will need to be updated to reflect this
change, but I want to see what names are produced for the various
platforms first.
Previously, trying to do something like `foo = "bar"` in the debug
overlay wouldn't succeed, because we were always trying to wrap
the line inside `return {line}`, which allowed for only expressions
to be used.
Now we also allow a fully formed statement to be used, which means
that that kind of assignment can be performed in the repl, making
it a bit more convenient to try stuff out.
refs: https://github.com/wez/wezterm/issues/1238
This avoids a confusing situation where we'd not bother to resolve
a font for a given codepoint for say bold text if we had previously
resolved it for normal text.
This hashset would be more useful if we maintained a mapping of
codepoint to font at that layer, but we don't.
The simplest thing to do for this is to allow the search to continue
and succeed.
refs: https://github.com/wez/wezterm/issues/2158
refs: https://github.com/wez/wezterm/issues/1913
Update copymode.md: description of `O` key assignment
"only in Rectangular mode" is not correct anymore as at the
end of PR #2150, handling of `O` was changed to also work in
non-Rectangular modes.
This commit adds more trace logging around selection
related events.
That tracing uncovered a situation, when multiple wezterm windows within
the same process were involved, where one window didn't receive a
selection-clear event notification.
Since Window::get_clipboard trusted our local understand of the
clipboard contents, it would return those until the selection was
changed in that window.
This commit changes that code to always ask the X server for the
selection. It makes pasting slightly slower, but should always produce
consistent results.
refs: https://github.com/wez/wezterm/issues/2110
- Add regex that captures URLs with IP addresses as hosts.
- Removed redundant non-capturing parentheses from the first regex.
Mirrored the change to default_hyperlink_rules().
- Switched all but the first example to use literal strings for
regex (more readable).