summaryrefslogtreecommitdiffstats
path: root/atuin/src/command/client/history.rs
diff options
context:
space:
mode:
Diffstat (limited to 'atuin/src/command/client/history.rs')
-rw-r--r--atuin/src/command/client/history.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/atuin/src/command/client/history.rs b/atuin/src/command/client/history.rs
index b9e54b50..e6774816 100644
--- a/atuin/src/command/client/history.rs
+++ b/atuin/src/command/client/history.rs
@@ -348,6 +348,15 @@ impl Cmd {
return Ok(());
}
+ if !settings.store_failed && h.exit != 0 {
+ debug!("history has non-zero exit code, and store_failed is false");
+
+ // the history has already been inserted half complete. remove it
+ db.delete(h).await?;
+
+ return Ok(());
+ }
+
h.exit = exit;
h.duration = match duration {
Some(value) => i64::try_from(value).context("command took over 292 years")?,