summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2021-05-14 08:31:29 +0100
committerGitHub <noreply@github.com>2021-05-14 08:31:29 +0100
commitf55d5cf0bfa59af144788bec7c9d0a9ada71aad4 (patch)
tree0037a12cb7f9b3859b95b6bcade658ceee23a2fc
parenta127408e938ecd7060d7f81dec557bc5eaf06d75 (diff)
Ignore commands beginning with a space, resolve #114 (#123)
-rw-r--r--src/command/history.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/command/history.rs b/src/command/history.rs
index 5811eed9..9c792cf0 100644
--- a/src/command/history.rs
+++ b/src/command/history.rs
@@ -109,6 +109,11 @@ impl Cmd {
match self {
Self::Start { command: words } => {
let command = words.join(" ");
+
+ if command.starts_with(' ') {
+ return Ok(());
+ }
+
let cwd = env::current_dir()?.display().to_string();
let h = History::new(chrono::Utc::now(), command, cwd, -1, -1, None, None);