atuinsh/atuin · error
failed to listen for ctrl+c
Error message
failed to listen for ctrl+c
What it means
The non-Unix branch of `shutdown_signal()` awaits `tokio::signal::ctrl_c()`, which panics if the Ctrl+C listener cannot be installed. On Windows this means the console control handler registration failed.
Solutions
- Run the daemon in an environment with an attached console for development
- Use proper Windows service/SCM shutdown handling instead of relying on Ctrl+C
- Enable tokio's `signal` feature in Cargo.toml
- Prefer the Unix build path (WSL) where signal handling is better supported
Defensive patterns
Strategy: try-catch
Try / catch
tokio::signal::ctrl_c().await.map_err(|e| BootError::CtrlC(e))?;
Prevention
- Don't rely on Ctrl+C for shutdown in Windows services — use SCM stop events
- Keep a console attached when debugging the daemon on Windows
- Prefer running the daemon under WSL for consistent signal semantics
When it happens
Trigger: Daemon `boot()` on a non-Unix platform when `ctrl_c()` registration fails — typically no attached console (detached/service process) or unsupported runtime configuration.
Common situations: Running the daemon as a Windows service or scheduled task with no console; launching via a process wrapper that detaches from the console; tokio runtime without the signal feature.
Related errors
- failed to register sigint handler
- failed to register sigterm handler
- output-capture delete task panicked
- output-capture read task panicked
- output-capture reclaim task panicked
AI-assisted analysis of atuinsh/atuin@c0c717ab04 (2026-09-12).
Data as JSON: /api/errors/b6fdb4f50dda7128.
Report an issue: GitHub.
Appendix: source
Thrown at crates/atuin-daemon/src/lib.rs:148
/// Wait for a shutdown signal (Ctrl+C or SIGTERM).
#[cfg(unix)]
async fn shutdown_signal() {
let mut term = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())
.expect("failed to register sigterm handler");
let mut int = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::interrupt())
.expect("failed to register sigint handler");
tokio::select! {
_ = term.recv() => {},
_ = int.recv() => {},
}
}
/// Wait for a shutdown signal (Ctrl+C).
#[cfg(not(unix))]
async fn shutdown_signal() {
tokio::signal::ctrl_c().await.expect("failed to listen for ctrl+c");
}
View on GitHub (pinned to c0c717ab04)