Skip to content

Instantly share code, notes, and snippets.

@vifon
Created June 8, 2012 19:36
Show Gist options
  • Save vifon/2897747 to your computer and use it in GitHub Desktop.
Save vifon/2897747 to your computer and use it in GitHub Desktop.
zsh, histacceptspace patch
diff --git a/Src/hist.c b/Src/hist.c
index 4d522dd..78a98ed 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1122,6 +1122,9 @@ should_ignore_line(Eprog prog)
if (isset(HISTIGNORESPACE)) {
if (*chline == ' ' || aliasspaceflag)
return 1;
+ } else if (isset(HISTACCEPTSPACE)) {
+ if (*chline != ' ')
+ return 1;
}
if (!prog)
diff --git a/Src/options.c b/Src/options.c
index 5fbb06b..92aa7c0 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -142,6 +142,7 @@ static struct optname optns[] = {
{{NULL, "hashdirs", OPT_ALL}, HASHDIRS},
{{NULL, "hashexecutablesonly", 0}, HASHEXECUTABLESONLY},
{{NULL, "hashlistall", OPT_ALL}, HASHLISTALL},
+{{NULL, "histacceptspace", 0}, HISTACCEPTSPACE},
{{NULL, "histallowclobber", 0}, HISTALLOWCLOBBER},
{{NULL, "histbeep", OPT_ALL}, HISTBEEP},
{{NULL, "histexpiredupsfirst",0}, HISTEXPIREDUPSFIRST},
diff --git a/Src/zsh.h b/Src/zsh.h
index cc3a670..9c345ad 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1997,6 +1997,7 @@ enum {
HASHDIRS,
HASHEXECUTABLESONLY,
HASHLISTALL,
+ HISTACCEPTSPACE,
HISTALLOWCLOBBER,
HISTBEEP,
HISTEXPIREDUPSFIRST,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment