I'll write up more comprehensive docs once CI has proven that
the color schemes are packaged correctly.
The gist of it is that you can now specify:
```
color_scheme = "Batman"
```
to specify the default color palette.
The name corresponds to one of the color schemes from the
`assets/colors` directory. That directory is packaged and installed by
the CI deployment script, but we're also able to load them from the
source dir if you're running from in the wezterm source tree.
You can see previews of the various schemes here:
<https://iterm2colorschemes.com/>
In addition to loading from those that path, wezterm will search:
* In the `config` dir that is a sibling to `wezterm.exe` on windows
(not yet tested!)
* The directories specified in your `color_scheme_dirs` config setting
(multiple paths can be specified)
* You may also define schemes directly inline in your config file
using syntax like this:
```
[color_schemes."My Name"]
foreground = "#4a4543"
background = "#f7f7f7"
```
These visual artifacts seemed to affect everything other than Wayland
and were a bit annoying. The manifestation was that the cursor outline
box might have an extra line of another color on one or more of the
borders; whether it did or not seemed dependent on a combination of the
position of the cursor and the pixel width/height of the overall window.
This commit sets the texture sampler to prefer not to interpolate/merge
the value if it is between pixels and instead take the nearest texel.
Resizes can transiently result in lines whose length doesn't
match the vertex buffer width. If that happens, we probably
still derive value from painting the remaining lines, so allow
that to continue rather than blowing up the render.
The rewrap logic makes dealing with the cursor position a bit
more complex and we had a problem where resizing the window shorter
and then taller would allow the shell to cursor up into the scrollback
when displaying its prompt, and allow it to overwrite something that
was logically in the scrollback.
This fixes a problem where a closed tab would linger until a subsequent
input event. The issue was that the layer at which we detect the tab
closure didn't have a way to signal the gui layer to repaint.
This commit adds an invalidated flag to the mux window object that is
updated when structural changes occur to its tabs; added, deleted,
activated and so on.
We check that flag in our periodic function in the gui layer and then
trigger a gui level invalidation if we see that it is set.
Sometimes we race with the nightly build while it is deleting
and uploading artifacts.
Since they have stable names, just hard code those in the the
markdown.
Avoids accidentally moving the y position of the cursor; previously
we would keep it pinned to the physical viewport relative coordinate,
but we didn't account for the implicit scroll that happens when
making the window smaller, which meant that the shell would re-render
its prompt with some artifacts during a resize.
Adds logic to resize handling that will consider the original logical
line length when the width of the terminal is changed.
The intent is that this will cause the text to be re-flowed as if it had
been printed into the terminal at the new width. Lines that were
wrapped due to hittin the margin will be un-wrapped and made into a
single logical line, and then split into chunks of the new width.
This can cause new lines to be generated in the scrollback when
making the terminal narrower. To avoid losing the top of the buffer
in that case, the rewrapping logic will prune blank lines off the
bottom.
This is a pretty simplistic brute force algorithm: each of the lines
will be visited and split, and for large scrollback buffers this could
be relatively costly with a busy live resize. We don't have much choice
in the current implementation.
refs: https://github.com/wez/wezterm/issues/14
Record a notion of the state of the invalidations that we've sent
to the client so that we can skip sending updates if nothing has
changed since the last push.
It was possible to exhaust the number of fds on the server by
opening a vertical vim split and aggressively sliding it left
and right.
This commit allows the produce side to clone an arbitrary number
of senders without using up file descriptors.
`cargo run --example widgets_basic --features widgets` changes the
cursor style but wasn't changing it back when exiting.
In addition, setting the cursor to Default was only restoring visibility
and not restoring the style.
Still not perfect; there's a window invalidation missing from
the mux somewhere on higher latency connections that gets
resolved just by moving the mouse :-/
There was an issue where we'd get stuck with a placeholder empty
line in a couple of rows when running `ls -l /etc` and scrolling
backwards. The damage was actually done during execution of the
ls command and was because we'd get confused about the state of
some of the line entries.
This diff introduces a proper state enum for them and defines
state transitions more rigorously.
I noticed the mux was running hot when idle and observed that it was
repeatedly fetching the line with the cursor.
Extract the logic into a helper function that is called from both
of the places that fetch and put lines; noticed that we were not
consistently processing hyperlinks.
When running the mux server we don't have an active window::Connection
so we can't use its spawn_task function. This little helper runs
the futures on the appropriate Tasks instance.
We can't use a trait method for this because traits abhor generic
parameter types.