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

Re: have run-help not put itself in history?



On Dec 10,  8:57pm, Greg Klanderman wrote:
} 
} Hmm after perusing the manual and playing around a bit, this seems to
} do the trick:
} 
} zshaddhistory () {
}     [[ $1 != run-help\ * ]] || fc -p
} }

That the above works, almost looks like a bug to me.  Why is the history
ever reset to the default in this case?  It's a stack push without any
stack pop, and automatic popping is supposed to require the -a option
(which I think would pop the stack too soon).
 
} Oh run-help doesn't work so well if you're editing a continued
} line.. maybe processcmd() should do pushinput() rather than
} pushline()?

Unfortunately because of the way the lexer and the line editor work
together (or fail to), pushinput() implies the equivalent of a call
to send-break, killing the line editor so that $PREBUFFER can be
merged back into $BUFFER.  This means you lose the opportunity to
prepend anything to the reconstructed buffer, and also can't proceed
with the implicit accept-line.

Further, consider that if you're in the middle of a complex command
rather than just on a continuation of a simple command, you don't want
to prefix run-help to the entire complex command.



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