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

1077 Commits

Author SHA1 Message Date
Wez Furlong
75eb16bec4 move spawn_task into a new promise::spawn module 2020-01-16 03:50:48 -08:00
Wez Furlong
ac3ccab1c5 window: adopt async_task for spawn_task 2020-01-16 01:31:28 -08:00
Wez Furlong
62f0f7a273 adopt async-task for muxserver task runner
This simplifies some of its code
2020-01-16 01:03:32 -08:00
Wez Furlong
256b4e6da8 fix pollable_channel to be non-blocking on Windows
Upgrade filedescriptor to 0.7 to use the portable helper for
setting non-blocking mode, and enable non-blocking mode on Windows.
2020-01-15 21:30:14 -08:00
Wez Furlong
101aedd6a5 remove .wait() from finish_attach
While debugging on windows earlier today I saw that we were
blocked on this wait on the main thread.  For whatever reason,
that only blocks in practice on Windows; I suspect that this is
due to a timing issue on windows where the server side takes
longer to respond than it does on posix.
2020-01-15 20:50:54 -08:00
Wez Furlong
4442e8030d mux: fix disconnect when a lot of output is dumped to the terminal
The root cause and secondary effect were a little surprising: the mux
pub/sub notification pipe filled up and because the mux notify routine
uses `retain` with the success of the send as a predicate it meant that
the full pipe resulted in the muxer killing that end of the subscriber
and that in turn made the ClientSession loop fail when it was
dispatching a notify on the other end, which terminated the loop and
disconnected the client.

Now, with this fixed, we have a flow control problem and the terminal
will remain busy with ctrl-c not being effective in the mux session.
2020-01-14 22:51:48 -08:00
Wez Furlong
3352013614 fix lingering selection when a row is changed
This was an accidental casualty of some recent refactoring;
we need to clear the selection range when lines that intersect
with it are changed, so that's what this does.

Fixes: https://github.com/wez/wezterm/issues/118
2020-01-14 22:21:25 -08:00
Wez Furlong
4b455288dd track the full current dir URL for OSC 7
Matching against the current dir when it includes a host and a
path seems like a handy way to automate selecting appropriate
theme/color/profile settings, so I'd like to make sure that
we have the full URL content available for that.

Refs: https://github.com/wez/wezterm/issues/115
Refs: https://github.com/wez/wezterm/issues/117
2020-01-14 22:06:13 -08:00
Wez Furlong
ced85ac11b macos: teach it about the color schemes path in the .app bundle 2020-01-13 10:44:54 -08:00
Wez Furlong
bb6251fad9 prevent stats printing from interfering with cli proxy
This makes using stats with the mux possible again:

```
periodic_stat_logging = 10
```
2020-01-13 08:56:38 -08:00
Wez Furlong
c989485a77 mux: add basic version handshake at domain connect time 2020-01-13 08:10:23 -08:00
Wez Furlong
ac32ae19d8 gah, rustfmt 2020-01-12 22:20:18 -08:00
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
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
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
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
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
2e581252c1 refine vertical size adjustments when resizing the terminal 2020-01-11 09:40:36 -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
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
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
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
Wez Furlong
68d460295a improve some rate control in the mux protocol
The client side will limit how many rows it decides to speculatively
prefetch and defer to the lines requested by the renderer once we
exceed a certain number of fetch requests per second.

On the server side, we weren't actually coalescing individual tab
output events together; this commit restructures the end of the
appropriate loop block to make that effective.
2020-01-07 18:04:22 -08:00
Wez Furlong
3fb89d7e02 ensure that domain.attach() is awaited for or waited on 2020-01-07 07:55:22 -08:00
Wez Furlong
a8561a40b2 asyncify the ssh initialization 2020-01-07 07:46:21 -08:00
Wez Furlong
4edc17f157 simply the logic in run_mux_client a bit 2020-01-07 07:30:32 -08:00
Wez Furlong
9c9bf6fb97 add CommandBuilder::from_argv 2020-01-07 07:27:02 -08:00
Wez Furlong
89171cd706 begin async'ifying main.rs 2020-01-07 07:16:41 -08:00
Wez Furlong
41ee87f43c make Domain::attach return a Future
This avoids a hang on startup if you're using an ssh multiplexer
connection and haven't already registered your ssh key and need
to perform password authentication.
2020-01-06 22:41:59 -08:00
Wez Furlong
6a5f203e4b Fix an issue where a config reload would trigger a cascade of reloads
The last config reload time didn't seem to stick in the periodic timer
callback.

Need to investigate that further, and also see if the blink paint
time is similarly impacted.
2020-01-06 14:08:14 -08:00
Wez Furlong
c7aa8cd845 fix some warnings 2020-01-06 11:42:09 -08:00