diff options
author | Maciej Makowski <maciejm.github@cfiet.net> | 2019-11-16 21:11:56 +0000 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-11-16 22:11:56 +0100 |
commit | 48861e463311145a653350688dc4bad83a528d91 (patch) | |
tree | 6d384990dde03d27eb83a89852e75aa275b9db0e /alacritty_terminal/src/tty/windows/conpty.rs | |
parent | d741d3817debe9fdd4030bede3e4c8ca84ad078a (diff) | |
download | alacritty-48861e463311145a653350688dc4bad83a528d91.tar.gz alacritty-48861e463311145a653350688dc4bad83a528d91.zip |
Fix WinPTY freeze on termination
Fixes #2889.
Diffstat (limited to 'alacritty_terminal/src/tty/windows/conpty.rs')
-rw-r--r-- | alacritty_terminal/src/tty/windows/conpty.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/alacritty_terminal/src/tty/windows/conpty.rs b/alacritty_terminal/src/tty/windows/conpty.rs index 185acfc2..f34ad922 100644 --- a/alacritty_terminal/src/tty/windows/conpty.rs +++ b/alacritty_terminal/src/tty/windows/conpty.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use super::{Pty, HANDLE}; - use std::i16; use std::io::Error; use std::mem; @@ -22,7 +20,6 @@ use std::ptr; use std::sync::Arc; use dunce::canonicalize; -use log::info; use mio_anonymous_pipes::{EventedAnonRead, EventedAnonWrite}; use miow; use widestring::U16CString; @@ -41,6 +38,8 @@ use winapi::um::wincontypes::{COORD, HPCON}; use crate::config::{Config, Shell}; use crate::event::OnResize; use crate::term::SizeInfo; +use crate::tty::windows::child::ChildExitWatcher; +use crate::tty::windows::Pty; /// Dynamically-loaded Pseudoconsole API from kernel32.dll /// @@ -241,14 +240,10 @@ pub fn new<'a, C>( } } - // Store handle to console - unsafe { - HANDLE = proc_info.hProcess; - } - let conin = EventedAnonWrite::new(conin); let conout = EventedAnonRead::new(conout); + let child_watcher = ChildExitWatcher::new(proc_info.hProcess).unwrap(); let agent = Conpty { handle: pty_handle, api }; Some(Pty { @@ -257,6 +252,8 @@ pub fn new<'a, C>( conin: super::EventedWritablePipe::Anonymous(conin), read_token: 0.into(), write_token: 0.into(), + child_event_token: 0.into(), + child_watcher, }) } |