diff options
author | John Nunley <jtnunley01@gmail.com> | 2023-10-07 12:56:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-07 19:56:11 +0000 |
commit | c2f8abecfbaf6b6388e7746b733b7f22cbb7a750 (patch) | |
tree | 3b8e3cb638d25346f7147001ee57cffa46d52f80 /alacritty_terminal/src/tty/windows/conpty.rs | |
parent | ace987f343649ae98e5fb63cf825414855ccd86e (diff) | |
download | r-alacritty-c2f8abecfbaf6b6388e7746b733b7f22cbb7a750.tar.gz r-alacritty-c2f8abecfbaf6b6388e7746b733b7f22cbb7a750.tar.bz2 r-alacritty-c2f8abecfbaf6b6388e7746b733b7f22cbb7a750.zip |
Port from mio to polling
This patch replaces the mio crate with the polling. Now that
smol-rs/polling#96 has been merged, we should be at full feature parity
with mio v0.6 now.
Fixes #7104.
Fixes #6486.
Diffstat (limited to 'alacritty_terminal/src/tty/windows/conpty.rs')
-rw-r--r-- | alacritty_terminal/src/tty/windows/conpty.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/alacritty_terminal/src/tty/windows/conpty.rs b/alacritty_terminal/src/tty/windows/conpty.rs index c9ed631e..12189371 100644 --- a/alacritty_terminal/src/tty/windows/conpty.rs +++ b/alacritty_terminal/src/tty/windows/conpty.rs @@ -3,8 +3,6 @@ use std::io::Error; use std::os::windows::io::IntoRawHandle; use std::{mem, ptr}; -use mio_anonymous_pipes::{EventedAnonRead, EventedAnonWrite}; - use windows_sys::core::{HRESULT, PWSTR}; use windows_sys::Win32::Foundation::{HANDLE, S_OK}; use windows_sys::Win32::System::Console::{ @@ -21,9 +19,12 @@ use windows_sys::Win32::System::Threading::{ use crate::config::PtyConfig; use crate::event::{OnResize, WindowSize}; +use crate::tty::windows::blocking::{UnblockedReader, UnblockedWriter}; use crate::tty::windows::child::ChildExitWatcher; use crate::tty::windows::{cmdline, win32_string, Pty}; +const PIPE_CAPACITY: usize = crate::event_loop::READ_BUFFER_SIZE; + /// Load the pseudoconsole API from conpty.dll if possible, otherwise use the /// standard Windows API. /// @@ -220,8 +221,8 @@ pub fn new(config: &PtyConfig, window_size: WindowSize) -> Option<Pty> { } } - let conin = EventedAnonWrite::new(conin); - let conout = EventedAnonRead::new(conout); + let conin = UnblockedWriter::new(conin, PIPE_CAPACITY); + let conout = UnblockedReader::new(conout, PIPE_CAPACITY); let child_watcher = ChildExitWatcher::new(proc_info.hProcess).unwrap(); let conpty = Conpty { handle: pty_handle as HPCON, api }; |