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

Re: trivial problem with histverify

On 12/01/2014 03:26 PM, Mikael Magnusson wrote:

If histverify is set or not doesn't change the fact that !! in your command will expand as normal. If you want to suppress history expansion you either have to disable the banghist option, or quote the history character (!). Long story short is: '[[:digit:]] !!' will do what you want (double quotes do not stop history expansion).

There's no issue with expansion, I want it to expand just as it does. Here's the binding:

bindkey -s "\e[5~" '\C-a print -s \C-e\C-m history 1 | grep --color=auto "[[:digit:]] !!" \C-m'

... with 'histverify' off, it executes directly, on whatever text is on the command line, but with the variable on, I must press ENTER before it fires. I'm guessing that the code that handles 'histverify' sees the " !! " and so demands the ENTER, but I'd say that in this situation that shouldn't be required since no history command is actually being executed, it's just a listing of string matches. Or if it's agreed that that should indeed require the ENTER (when 'histverify' is active), I'm wondering if there's a workaround, so that my binding is exempt. (BTW the " [[digit:]] " is just to keep the search to the beginning of history lines, after the number.) BTBTW it seems a strange way to capture whatever is on the command line but " print -s " was all that I could find that worked at the time.

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