diff options
-rw-r--r-- | Cargo.lock | 1 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/format.rs | 6 | ||||
-rw-r--r-- | src/main.rs | 8 | ||||
-rw-r--r-- | src/state/history/mod.rs | 4 |
5 files changed, 12 insertions, 8 deletions
@@ -514,7 +514,6 @@ dependencies = [ "pest_derive", "pty-process", "serde", - "signal-hook", "signal-hook-async-std", "terminal_size", "textmode", @@ -20,7 +20,6 @@ pest = "2.1.3" pest_derive = "2.1.0" pty-process = { version = "0.2.0", features = ["async"] } serde = { version = "1.0.133", features = ["derive"] } -signal-hook = "0.3.13" signal-hook-async-std = "0.2.1" terminal_size = "0.1.17" textmode = { version = "0.3.0", features = ["async"] } diff --git a/src/format.rs b/src/format.rs index e88f5a9..1560439 100644 --- a/src/format.rs +++ b/src/format.rs @@ -4,9 +4,9 @@ pub fn exit_status(status: std::process::ExitStatus) -> String { status.signal().map_or_else( || format!("{:03} ", status.code().unwrap()), |sig| { - signal_hook::low_level::signal_name(sig).map_or_else( - || format!("SIG{} ", sig), - |name| format!("{:4} ", &name[3..]), + nix::sys::signal::Signal::try_from(sig).map_or_else( + |_| format!("SIG{} ", sig), + |sig| format!("{:4} ", &sig.as_str()[3..]), ) }, ) diff --git a/src/main.rs b/src/main.rs index 9709a32..072e717 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,13 +60,17 @@ async fn async_main() -> anyhow::Result<i32> { let (event_w, event_r) = async_std::channel::unbounded(); { + // nix::sys::signal::Signal is repr(i32) + #[allow(clippy::as_conversions)] let signals = signal_hook_async_std::Signals::new(&[ - signal_hook::consts::signal::SIGWINCH, + nix::sys::signal::Signal::SIGWINCH as i32, ])?; let event_w = event_w.clone(); async_std::task::spawn(async move { + // nix::sys::signal::Signal is repr(i32) + #[allow(clippy::as_conversions)] let mut signals = async_std::stream::once( - signal_hook::consts::signal::SIGWINCH, + nix::sys::signal::Signal::SIGWINCH as i32, ) .chain(signals); while signals.next().await.is_some() { diff --git a/src/state/history/mod.rs b/src/state/history/mod.rs index bf0c11f..fa02b98 100644 --- a/src/state/history/mod.rs +++ b/src/state/history/mod.rs @@ -608,6 +608,8 @@ async fn run_pipeline( return (std::process::ExitStatus::from_raw(1 << 8), false); } Res::Exit(Ok(status)) => { + // nix::sys::signal::Signal is repr(i32) + #[allow(clippy::as_conversions)] return ( status, // i'm not sure what exactly the expected behavior here is @@ -615,7 +617,7 @@ async fn run_pipeline( // SIGTERM doesn't, but i don't know what the precise // logic is or how other signals are handled status.signal() - == Some(signal_hook::consts::signal::SIGINT), + == Some(nix::sys::signal::Signal::SIGINT as i32), ); } Res::Exit(Err(e)) => { |