From fe1cf326fbac5fbede750ec20829e01c1c6ca38f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 12 Nov 2021 20:00:49 -0500 Subject: just forward ^C to the running process directly the process pty will interpret this and send SIGINT to the appropriate process as necessary anyway --- src/history.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/history.rs') diff --git a/src/history.rs b/src/history.rs index 06678bf..e06762e 100644 --- a/src/history.rs +++ b/src/history.rs @@ -33,11 +33,7 @@ impl History { let (input_w, input_r) = async_std::channel::unbounded(); let (resize_w, resize_r) = async_std::channel::unbounded(); let entry = crate::util::mutex(HistoryEntry::new( - cmd, - child.id().try_into().unwrap(), - self.size, - input_w, - resize_w, + cmd, self.size, input_w, resize_w, )); let task_entry = async_std::sync::Arc::clone(&entry); let task_action = self.action.clone(); @@ -132,11 +128,6 @@ impl History { idx: usize, ) -> bool { match key { - textmode::Key::Ctrl(b'c') => { - let pid = self.entries[idx].lock_arc().await.pid; - nix::sys::signal::kill(pid, nix::sys::signal::Signal::SIGINT) - .unwrap(); - } textmode::Key::Ctrl(b'z') => { self.action .send(crate::action::Action::UpdateFocus( @@ -272,7 +263,6 @@ impl History { struct HistoryEntry { cmd: String, - pid: nix::unistd::Pid, vt: vt100::Parser, audible_bell_state: usize, visual_bell_state: usize, @@ -285,14 +275,12 @@ struct HistoryEntry { impl HistoryEntry { fn new( cmd: &str, - pid: i32, size: (u16, u16), input: async_std::channel::Sender>, resize: async_std::channel::Sender<(u16, u16)>, ) -> Self { Self { cmd: cmd.into(), - pid: nix::unistd::Pid::from_raw(pid), vt: vt100::Parser::new(size.0, size.1, 0), audible_bell_state: 0, visual_bell_state: 0, -- cgit v1.2.3-54-g00ecf