1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-29 21:44:24 +03:00
A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
Go to file
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
.cargo Now with something approximating windows support 2018-07-20 20:39:16 -07:00
.github docs: maybe do a better job at caching mdbook 2019-12-30 15:12:51 -08:00
assets Add wezterm.desktop file to the debian package 2019-11-20 06:37:32 +00:00
base91 dyn everywhere 2019-06-08 21:28:11 -07:00
ci docs: tweak download page and add source tarball info 2019-12-29 23:06:29 -08:00
deps fixup submodules 2019-11-24 13:41:32 -08:00
docs Add note about mux protocol changes to the changelog 2020-01-05 14:47:46 -08:00
promise failure -> anyhow + thiserror 2019-12-14 21:43:05 -08:00
pty more mac + windows build tweaks 2019-12-14 22:38:24 -08:00
rangeset use rangeset to streamline line fetches 2020-01-05 14:37:17 -08:00
src reinstate scroll to bottom on input behavior 2020-01-05 18:17:06 -08:00
tabout tabout: correctly handle unicode width 2020-01-05 14:37:17 -08:00
term clippy 2020-01-05 15:14:32 -08:00
termwiz Make UnixTerminalWaker::wake non-blocking 2020-01-05 19:26:55 -08:00
vtparse Recognize C1 codes encoded as UTF-8 2019-12-28 10:33:24 -08:00
window belt and suspenders to clip the copy region 2020-01-05 17:58:14 -08:00
.gitignore docs: code generation for release info 2019-12-29 21:24:08 -08:00
.gitmodules fix CI: savannah is down, use a github mirror for freetype 2019-11-24 13:28:02 -08:00
.rustfmt.toml update rustfmt for 1.28 2018-08-03 22:34:27 -07:00
build.rs Add script that can produce a full source tarball 2019-12-24 09:41:15 -08:00
Cargo.lock switch most of the rest of the mux over to the new model 2020-01-05 14:37:17 -08:00
Cargo.toml switch most of the rest of the mux over to the new model 2020-01-05 14:37:17 -08:00
CONTRIBUTING.md Add get-deps script for installing dependencies 2018-02-25 09:24:56 -08:00
get-deps Add CI for Fedora 2019-12-29 16:41:28 -08:00
install.sh refine deploy scripts/config 2019-03-24 00:26:53 -07:00
LICENSE.md restructure termwiz tree prior to merging into wezterm repo 2018-08-05 07:55:30 -07:00
README.md remove azure status from readme 2019-12-29 17:46:21 -08:00
wt-record update record/play scripts for macos 2019-03-22 20:41:50 -07:00
wt-replay update record/play scripts for macos 2019-03-22 20:41:50 -07:00

Wez's Terminal

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust

User facing home page at: https://wezfurlong.org/wezterm/

Windows Build Status Linux &amp; macOS Build Status

Screenshot

Screenshot of wezterm on macOS, running vim

Installation

https://wezfurlong.org/wezterm/installation.html

Getting help

This is a spare time project, so please bear with me. There are two channels for support:

The gitter room is probably better suited to questions than it is to bug reports, but don't be afraid to use whichever you are most comfortable using and we'll work it out.