summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-11 11:14:18 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-11 11:14:18 -0500
commit21035ea723f2a85328fc1b7b50f9488097346ab4 (patch)
treeb5849c9843a529ceec667bb6ac8de02fd8311f89
parent6744503cc1cb7bbba54316240c9fe2b971e8b178 (diff)
downloadnbsh-21035ea723f2a85328fc1b7b50f9488097346ab4.tar.gz
nbsh-21035ea723f2a85328fc1b7b50f9488097346ab4.zip
don't allow an entry to transition from exited back to running
-rw-r--r--src/shell/history/entry.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shell/history/entry.rs b/src/shell/history/entry.rs
index f2a7d08..b20321d 100644
--- a/src/shell/history/entry.rs
+++ b/src/shell/history/entry.rs
@@ -313,7 +313,9 @@ impl Entry {
}
pub fn set_span(&mut self, span: (usize, usize)) {
- self.state = State::Running(span);
+ if matches!(self.state, State::Running(_)) {
+ self.state = State::Running(span);
+ }
}
pub async fn finish(