From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8216 invoked by alias); 10 Dec 2013 07:09:49 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18213 Received: (qmail 28545 invoked from network); 10 Dec 2013 07:09:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131209230927.ZM8394@torch.brasslantern.com> Date: Mon, 09 Dec 2013 23:09:27 -0800 In-reply-to: Comments: In reply to Jan Larres "Re: shared history but recalling history in current terminal" (Dec 9, 12:54pm) References: <131127000208.ZM18878@torch.brasslantern.com> <52964328.5040801@necoro.eu> <131127170553.ZM23821@torch.brasslantern.com> <5297AB37.80504@necoro.eu> <131128133318.ZM25004@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: shared history but recalling history in current terminal MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 9, 12:54pm, Jan Larres wrote: } Subject: Re: shared history but recalling history in current terminal } } After some more investigation I noticed that unsetting local-history } does actually work, but re-running the widget after entering something } does not. So if I have this in my zshrc: } } bindkey '^r' history-incremental-pattern-search-backward } } If I then press ^r and enter some word it gets correctly found in the } global history, but if I press ^r again to search for an earlier } occurence it always fails. Is there any way to fix this? Since (as previously discussed) we don't have a hook for isearch-init, the only way to fix that one is to rebind the widget: history-incremental-pattern-search-backward() { if [[ $LASTWIDGET != history-incremental-pattern-search-backward ]] then NUMERIC=0 zle set-local-history fi zle .history-incremental-pattern-search-backward "$@" } zle -N history-incremental-pattern-search-backward I haven't actually tested that but it should be close to something that works ...