Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: have run-help not put itself in history?
- X-seq: zsh-users 14645
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: have run-help not put itself in history?
- Date: Sun, 13 Dec 2009 15:50:39 -0800
- In-reply-to: <m3iqceuvbc.fsf@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <19231.63798.994576.177282@xxxxxxxxxxxxxxxxxx> <733654e30912091738j726992bcvf95c313b28c4babb@xxxxxxxxxxxxxx> <m3iqceuvbc.fsf@xxxxxxxxxxxxxx>
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