1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-29 00:21:57 +03:00
Commit Graph

2036 Commits

Author SHA1 Message Date
Wez Furlong
1af9ded3ce Add color_scheme configuration option
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"
```
2020-01-12 22:08:36 -08:00
Wez Furlong
ab2090c5c4 load color schemes when we parse the config
This eagerly parses all eligible schemes
2020-01-12 21:40:30 -08:00
Wez Furlong
edd773c5a7 packaging: include the color schemes in the various packages
we don't yet know how to load them, but this puts them there in
readiness.
2020-01-12 20:51:14 -08:00
Wez Furlong
2d50a17466 Import color schemes from https://github.com/mbadolato/iTerm2-Color-Schemes
These are current as of revision d7023ef0810a92a38569be86bbf0c02536c29e3f
2020-01-12 20:51:03 -08:00
Wez Furlong
6656097794 fix "random" thick cursor outlines
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.
2020-01-12 17:52:19 -08:00
Wez Furlong
746f42be17 opengl: don't give up on the paint if a line is too long
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.
2020-01-12 15:22:17 -08:00
Wez Furlong
756774ede2 mux: invalidate rather than drop lines on resize
This avoids a blank flash during resize/redraw operations

refs: https://github.com/wez/wezterm/issues/116
2020-01-12 14:56:49 -08:00
Wez Furlong
3c3e73e374 avoid some number of resize rpc calls
Skip them if the size doesn't appear to have changed

refs: https://github.com/wez/wezterm/issues/116
2020-01-12 14:49:15 -08:00
Wez Furlong
367a44fb96 avoid accidentally blocking on the pollable channel
make sure the socketpair is nonblocking (note: this only works
on unix at this time)

refs: https://github.com/wez/wezterm/issues/116
2020-01-12 14:42:38 -08:00
Wez Furlong
22884a2e81 double/triple click and drag extend selection by word/line
Closes: https://github.com/wez/wezterm/issues/89
2020-01-12 13:30:14 -08:00
Wez Furlong
e6a6825b28 refactor double/triple click boundary logic into selection.rs 2020-01-12 13:13:19 -08:00
Wez Furlong
da0185fee5 fix an issue where we'd scroll to the bottom when a modifier was pressed
This is irritating when switching tabs via keyboard shortcuts
2020-01-12 11:58:24 -08:00
Wez Furlong
41162f4361 fixup tests for the previous change
(also makes it easier to debug test failures without RUST_BACKTRACE=1)
2020-01-12 11:40:42 -08:00
Wez Furlong
e1f1f9cbd6 improve cursor positioning after a resize
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.
2020-01-12 10:15:53 -08:00
Wez Furlong
d163032cb8 add note about OSC 7 support
refs: https://github.com/wez/wezterm/issues/113
2020-01-11 19:26:44 -08:00
Jeremy Fitzhardinge
eac29274ed Comment typo 2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
cb34ac9cdd Add working dir to mux protocol 2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
24ecfca5a5 Drop directory for ssh domains 2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
d789748c99 Default to starting tab in home dir if current dir doesn't exist. 2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
83641ed46c Spawn new tabs using the current tab's current directory
(If known.)
2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
71eb27ccb5 Add get_current_working_dir to Tab 2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
b53412d0cb Track current working dir via OSC 2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
31b5798e95 pty: add cwd to CommandBuilder 2020-01-11 18:25:17 -08:00
Wez Furlong
5f0e2b01da Mux: add window invalidation concept
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.
2020-01-11 11:48:00 -08:00
Wez Furlong
d199178dd7 docs: avoid occasional page build failure
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.
2020-01-11 09:49:17 -08:00
Wez Furlong
151180ba28 docs: install: fix link to the config section 2020-01-11 09:43:10 -08:00
Wez Furlong
2e581252c1 refine vertical size adjustments when resizing the terminal 2020-01-11 09:40:36 -08:00
Wez Furlong
d91e384a7e improve cursor position adjustment on resize
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.
2020-01-11 08:44:28 -08:00
Wez Furlong
e13b4f7dc9 remove dead code
This logic has all moved to the render layer
2020-01-11 08:34:01 -08:00
Wez Furlong
afbd262740 rewrap: tweak how we consider row count 2020-01-11 08:08:42 -08:00
Wez Furlong
b5124bfbdd set the dirty bit when joining rewrapped lines 2020-01-11 00:24:05 -08:00
Wez Furlong
e6b4aa835a re-wrap lines when resizing
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
2020-01-11 00:10:25 -08:00
Wez Furlong
44b3c412b6 mux: always send the cursor row 2020-01-10 09:11:44 -08:00
Wez Furlong
ba90abf805 mux: reintroduce server side state to gate pushes
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.
2020-01-10 08:56:27 -08:00
Wez Furlong
88c3d620bf mux: bounded number of fds for ServerPollable
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.
2020-01-10 08:56:04 -08:00
Wez Furlong
b722dd178f add debug output for the pages builder
This sometimes fails and I think it is because of a race with
one of the jobs that uploads an artifact
2020-01-10 07:11:59 -08:00
Wez Furlong
ad2f724416 bump some versions 2020-01-09 22:39:34 -08:00
Wez Furlong
9a6a0ffc37 termwiz: fix a bug where the cursor style wasn't restore on exit
`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.
2020-01-09 22:29:11 -08:00
Wez Furlong
561cc856d6 prep termwiz for a new release
Make the widgets portion a feature that can be disabled
2020-01-09 21:52:47 -08:00
Wez Furlong
c8635c07f3 mux: avoid over-invalidating in a couple of cases 2020-01-09 08:47:29 -08:00
Wez Furlong
0f5eec0244 mux: I think I found the invalidation issue
Need to treat None as dirty when looking at the line cache in
get_dirty_lines
2020-01-09 08:07:17 -08:00
Wez Furlong
4765ce60e5 mux: avoid overly aggressively dirtying lines
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 :-/
2020-01-09 06:39:00 -08:00
Wez Furlong
4516036479 reduce debug log level 2020-01-08 23:09:34 -08:00
Wez Furlong
db1d6b3085 remove dead script 2020-01-08 22:16:57 -08:00
Wez Furlong
4391ab5f55 mux:improve management of line cache
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.
2020-01-08 22:05:58 -08:00
Wez Furlong
d76e4ed42d use RangeSet for the result of get_dirty_lines 2020-01-08 08:34:22 -08:00
Wez Furlong
cb624173d2 leave it up to get_lines to clear the dirty flag 2020-01-08 07:49:06 -08:00
Wez Furlong
9639d137a7 mux: avoid dirtying a line if it is unchanged on fetch
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.
2020-01-07 23:01:49 -08:00
Wez Furlong
742689ed42 tweak Fedora install instructions 2020-01-07 22:28:43 -08:00
Wez Furlong
199e873e54 add spawn_task helper function
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.
2020-01-07 20:23:26 -08:00