From 86c449be7fdff9f4d67e5288f5ca355da37ab0c9 Mon Sep 17 00:00:00 2001 From: Alain Bench Date: Tue, 4 Jul 2006 17:23:16 +0000 Subject: [PATCH] Adopt shell convention of omitting from the history commands prefixed with a space. --- history.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/history.c b/history.c index a105b5ae..4bee9ab9 100644 --- a/history.c +++ b/history.c @@ -81,7 +81,12 @@ void mutt_history_add (history_class_t hclass, const char *s) { prev = h->last - 1; if (prev < 0) prev = HistSize - 1; - if (!h->hist[prev] || mutt_strcmp (h->hist[prev], s) != 0) + + /* don't add to prompt history: + * - lines beginning by a space + * - repeated lines + */ + if (*s != ' ' && (!h->hist[prev] || mutt_strcmp (h->hist[prev], s) != 0)) { mutt_str_replace (&h->hist[h->last++], s); if (h->last > HistSize - 1) -- 2.50.1