From: Alain Bench Date: Tue, 4 Jul 2006 17:23:16 +0000 (+0000) Subject: Adopt shell convention of omitting from the history commands prefixed X-Git-Tag: mutt-1-5-12-rel~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86c449be7fdff9f4d67e5288f5ca355da37ab0c9;p=mutt Adopt shell convention of omitting from the history commands prefixed with a space. --- 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)