summaryrefslogtreecommitdiffstats
path: root/src/history.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-10 23:07:08 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-10 23:07:08 -0500
commita87e03fa707cfdd9779334d4bf177188bb54db5b (patch)
tree8133f5d896ac433268c88e1e3e41b96d1ed78b9a /src/history.rs
parented83c606b26affee61d8745bbc9cd9601f8a52e6 (diff)
downloadnbsh-a87e03fa707cfdd9779334d4bf177188bb54db5b.tar.gz
nbsh-a87e03fa707cfdd9779334d4bf177188bb54db5b.zip
space to recall focused command to the readline
Diffstat (limited to 'src/history.rs')
-rw-r--r--src/history.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/history.rs b/src/history.rs
index 93fcaa4..2753470 100644
--- a/src/history.rs
+++ b/src/history.rs
@@ -138,6 +138,10 @@ impl History {
self.entries[idx].lock_arc().await.running()
}
+ pub async fn history_cmd(&self, idx: usize) -> String {
+ self.entries[idx].lock_arc().await.cmd.clone()
+ }
+
pub fn entry_count(&self) -> usize {
self.entries.len()
}