Commit Graph
1830 Commits
Author SHA1 Message Date
Wez Furlong bf910397dd fix error reporting if daemonize fails
This got broken in the move to anyhow
2020-01-05 20:38:53 -08:00
Jun Wu 1c5538976d Make windows::EventHandle Sync
See also https://github.com/wez/wzsh/issues/4.

This makes `WindowsTerminalWaker` Send and unblocks building streampager on Windows.
2020-01-05 19:59:19 -08:00
Jun Wu 6fdae9b226 Make UnixTerminalWaker::wake non-blocking
I was running `hg log --config pager.pager=sp` and pressing space without
releasing it. After about 10k lines sp appears to deadlock. It seems sp uses a
single thread for both reading terminal events and sending wake events and it
sends too many wake events without reading the events.

Failing to write to the wake pipe due to EWOULDBLOCK does not seem to be a
problem - there are enough events in the pipe to wake up the other side.
Therefore let's just make wake_pipe_write nonblocking and treat EWOULDBLOCK as
a success.

Context: The stuck thread looks like:

    #0  0x00007f32671ee237 in write () from /usr/lib/libc.so.6
    #1  0x000055c466022823 in std::sys::unix::fd::FileDesc::write () at src/libstd/sys/unix/fd.rs:96
    #2  std::sys::unix::net::Socket::write () at src/libstd/sys/unix/net.rs:276
    #3  <&std::sys::unix::ext::net::UnixStream as std::io::Write>::write ()
        at src/libstd/sys/unix/ext/net.rs:597
    #4  <std::sys::unix::ext::net::UnixStream as std::io::Write>::write ()
        at src/libstd/sys/unix/ext/net.rs:582
    #5  0x000055c465d010a6 in termwiz::terminal::unix::UnixTerminalWaker::wake (self=0x7ffe6bd32de0)
        at /home/quark/.cargo/git/checkouts/wezterm-6425bab852909cc8/ef1b836/termwiz/src/terminal/unix.rs:278
    #6  0x000055c465a6c64b in streampager::event::EventSender::send_unique (self=0x7ffe6bd32dd0, event=..., 
        unique=0x7ffe6bd32de8) at src/event.rs:66
    #7  0x000055c465a7e65a in streampager::display::start (term=..., term_caps=..., events=..., files=..., 
        error_files=..., progress=..., mode=streampager::config::FullScreenMode::Auto) at src/display.rs:295
    #8  0x000055c465a453a7 in streampager::Pager::run (self=...) at src/lib.rs:171
    #9  0x000055c465a0aced in sp::open_files (args=...) at src/bin/sp/main.rs:170
    #10 0x000055c465a08e4f in sp::main () at src/bin/sp/main.rs:25
2020-01-05 19:26:55 -08:00
Wez Furlong f38e39134e reinstate scroll to bottom on input behavior
This was temporarily disabled as part of the mux datamodel changes
2020-01-05 18:17:06 -08:00
Wez Furlong 59de97034a belt and suspenders to clip the copy region
a debug assertion triggers for me on macos because we were trying
to copy out of bounds.  This makes the copy routine safe again.
2020-01-05 17:58:14 -08:00
Wez Furlong fe0b9bde86 fix selection row when viewport is scrolled back 2020-01-05 17:31:45 -08:00
Wez Furlong ac2c8aadf6 fix an issue where the cursor would appear in the tab bar
If the cursor was in the first non-tab bar row, we'd incorrectly render
it in the same column on both rows.
2020-01-05 16:23:03 -08:00
Wez Furlong bda0a3b5fe windows: remove DoubleClick from input enums
double clicks weren't registering correctly with the new selection
logic.  Tell windows that we're doing all our own click counting
and simplify the logic.
2020-01-05 16:16:06 -08:00
Wez Furlong 048495b651 Fix x11 compilation due to bad semver bump in xcb-util
Force using xcb-util 0.2.1 precisely because 0.2.2 pulls in a
conflicting major version of xcb (0.8 -> 0.9).

It's a non-trivial upgrade: the types around xkb are different
and features need to be specified in the manifest to enable compilation
of the things that we depend upon.

In addition, xkbdcommon, on which we depend, requires xcb 0.8 and
results in pulling in two conflicting versions of the crates.

It's a bit of a painful situation and will require some effort to
figure out how to upgrade the xcb dependency, when we're ready for that.

refs: https://github.com/meh/rust-xcb-util/issues/12
2020-01-05 15:51:48 -08:00
Wez Furlong 4687b3bb48 clippy 2020-01-05 15:14:32 -08:00
Wez Furlong 89f2023577 mux: invalidate StableRowIndex 0..rows when switching alt screen
We would leave a copy of the alt screen lines at the top of the
scrollback.

This commit ensures that those lines are marked dirty and that
the dirty bits are propagated to the client to invalidate its cache.
2020-01-05 15:07:00 -08:00
Wez Furlong c3a58f21cb Add note about mux protocol changes to the changelog 2020-01-05 14:47:46 -08:00
Wez Furlong 9f270c25e7 mux: fix tab title at attach time
We were ignoring the title returned by list tabs and would subsequently
only pick up the title after a later update.

This passes the title in at construction.
2020-01-05 14:44:08 -08:00
Wez Furlong 94b78a47c8 mux: workaround a spurious panic notification with ssh connections
The issue is that when we start the proxy mode up, we haven't set
up a frontend, and the ssh client wants to kick off a non-essential
task via the executor.

This commit starts up a null frontend in proxy mode so that that
machinery is present.

Then, because we don't register any tabs with the mux, we need to
adjust the behavior of the null frontend to not terminate when
the mux has no tabs.

It's a little gross.
2020-01-05 14:37:17 -08:00
Wez Furlong 624c7234e4 Improve serializing hyperlinks in lines for the mux
This is both a little more efficient on the wire and results in
hovering over hyperlinks working as you would expect in the mux.
2020-01-05 14:37:17 -08:00
Wez Furlong dfa2b08c72 move URL highlight processing to the gui layer 2020-01-05 14:37:17 -08:00
Wez Furlong ad91742439 refine log levels of some debug logs 2020-01-05 14:37:17 -08:00
Wez Furlong cd2b57cc51 use rangeset to streamline line fetches 2020-01-05 14:37:17 -08:00
Wez Furlong 01f3adc2cb remove more old surface sync code, improve fetch quality
Still not perfect and still iterating
2020-01-05 14:37:17 -08:00
Wez Furlong d79455c2b4 switch most of the rest of the mux over to the new model
This mostly works, but has a cache invalidation issue wrt.
passing invalidated rows from the server to the client...
sometimes.

However, scrollback is cached on demand and selection works.
2020-01-05 14:37:17 -08:00
Wez Furlong 66b8b774f5 partially connect new data to mux rpc layer 2020-01-05 14:37:17 -08:00
Wez Furlong 60e05dbe95 add RangeSet type
The idea is to use this to maintain a set of dirty StableRowIndex
values for the mux rpc.
2020-01-05 14:37:17 -08:00
Wez Furlong 400c8aa66d remove explicit dirty manipulation from Renderable
This commit leaves mux domains broken for the moment,
but also simplifes the implementation of the renderable interface.
2020-01-05 14:37:17 -08:00
Wez Furlong ed97a56055 remove viewport control from renderable trait
This is now handled 100% by the gui layer
2020-01-05 14:37:17 -08:00
Wez Furlong d8701dc771 instrument executor spawn delay 2020-01-05 14:37:17 -08:00
Wez Furlong bc24399f06 instrument rpc size distribution 2020-01-05 14:37:17 -08:00
Wez Furlong cb9e0f9c59 tabout: correctly handle unicode width
This commit fixes this:

```
STAT                  p50      p75       p95
Key(gui.paint.opengl) 30.15ms  32.37ms   59.51ms
Key(shape.harfbuzz)   68.10µs 290.82µs 307.20µs
```

so that it renders like this:

```
STAT                  p50      p75      p95
Key(gui.paint.opengl) 5.28ms   28.97ms  89.65ms
Key(shape.harfbuzz)   210.94µs 288.77µs 395.26µs
```
2020-01-05 14:37:17 -08:00
Wez Furlong 43dd7dd03b add harfbuzz shaping stats 2020-01-05 14:37:17 -08:00
Wez Furlong 4f5441deb6 make the stats output a bit prettier 2020-01-05 14:37:17 -08:00
Wez Furlong e4fed76bd1 instrument painting and rpc calls 2020-01-05 14:37:17 -08:00
Wez Furlong 4270d144d4 Add GetLines rpc 2020-01-05 14:37:17 -08:00
Wez Furlong f17feb305b remove highlight and mouse response bits from the rpc 2020-01-05 14:37:17 -08:00
Wez Furlong 0a1a44eef0 pass mouse grabbed state over remote tabs
This allows local double click selection to work outside vim
and for mouse reporting to work inside vim.
2020-01-05 14:37:17 -08:00
Wez Furlong c5a8531a91 fix mouse cursor after changing the selection logic
We weren't setting the cursor to an I-beam
2020-01-05 14:37:17 -08:00
Wez Furlong 1b925b593a fix reported scrollback size for surface based tabs 2020-01-05 14:37:17 -08:00
Wez Furlong bcf3d8db35 remove some dead code 2020-01-05 14:37:17 -08:00
Wez Furlong 6db31d5f64 implement triple click selection 2020-01-05 14:37:17 -08:00
Wez Furlong fac3c3c719 implement double click word selection 2020-01-05 14:37:17 -08:00
Wez Furlong 02ab0f1c3e Implement select and copy 2020-01-05 14:37:17 -08:00
Wez Furlong 5a605ea5c5 render selection locally
This enables drag to select and rendering of the selection.

Actually copying it is still TODO, as is double and triple click
handling.
2020-01-05 14:37:17 -08:00
Wez Furlong 55e4050aa3 use LastMouseClick for paste click counting 2020-01-05 14:37:17 -08:00
Wez Furlong 17b2c49c68 rearrange more mouse event code 2020-01-05 14:37:17 -08:00
Wez Furlong 48d971c106 pull click counting code up from terminalstate 2020-01-05 14:37:17 -08:00
Wez Furlong f1089e84bf Middle button always pastes if shift is held 2020-01-05 14:37:17 -08:00
Wez Furlong fa9f699d46 rearrange mouse coordinate math
Move it up so that we can reference it in a later diff
2020-01-05 14:37:17 -08:00
Wez Furlong a8bf11a825 add Selection types to the gui layer
These are still unused

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong 4912e83f3e StableCursorPosition to track the cursor
This fixes up the cursor position when scrolling.

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong 12b537d2c8 serde_derive -> serde with derive feature 2020-01-05 14:37:17 -08:00
Wez Furlong 1c716898e7 Remove viewport_offset from RenderableDimensions
refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong ef072255dd Process shift+pageup/down at the gui layer
Refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00