We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec6fa9c commit 9a932d1Copy full SHA for 9a932d1
1 file changed
crates/q_cli/src/cli/mod.rs
@@ -66,6 +66,7 @@ use fig_util::{
66
};
67
use internal::InternalSubcommand;
68
use serde::Serialize;
69
+use tokio::signal::ctrl_c;
70
use tracing::{
71
Level,
72
debug,
@@ -367,9 +368,20 @@ impl Cli {
367
368
cmd.args(args);
369
}
370
- cmd.status().await?;
371
+ // Because we are spawning chat as a child process, we need the parent process (this one)
372
+ // to ignore sigint that are meant for chat (i.e. all of them)
373
+ tokio::spawn(async move {
374
+ loop {
375
+ let _ = ctrl_c().await;
376
+ }
377
+ });
378
- Ok(ExitCode::SUCCESS)
379
+ let exit_status = cmd.status().await?;
380
+ let exit_code = exit_status
381
+ .code()
382
+ .map_or(ExitCode::FAILURE, |e| ExitCode::from(e as u8));
383
+
384
+ Ok(exit_code)
385
386
387
async fn send_telemetry(&self) {
0 commit comments