Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

spaceflag question; remhist() going away



There's a variable that gets set in input.c called "spaceflag".  It
gets set if the first character of the first line is a space.  Later
on, the history code checks this flag when the HIST_IGNORE_SPACE
option is set.  Can anyone tell me why the history code doesn't just
check if (*chline == ' ') instead of checking spaceflag?  I've removed
this variable from my local source, and everything appears to be
working just fine without it.

In a related area, I've dumped the function remhist() in my local
source.  This function is a constant source of bugs, and I found
yet another bug today:  if you have HIST_IGNORE_SPACE set along
with HIST_NO_STORE, you lose a line of history every time you type
" history" (note the leading space).

I've been wanting to dump remhist() for some time now due to how it
does not properly interact with the INC_APPEND_HIST & SHARE_HISTORY
options.  My solution is to use string matching of the command line
to determine if this is a command that should not be saved.  I'm also
considering adding a general-purpose environment variable that would
allow the user to specify an arbitrary pattern that would cause the
current command line not to be stored in the history.  I was thinking
about calling it $HISTIGNOREMATCH.

Comments are welcomed.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author