From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1700 invoked by alias); 27 Nov 2013 19:16:19 -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: 18171 Received: (qmail 22546 invoked from network); 27 Nov 2013 19:16:12 -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 autolearn=ham version=3.3.2 Message-ID: <52964328.5040801@necoro.eu> Date: Wed, 27 Nov 2013 20:08:24 +0100 From: =?ISO-8859-1?Q?Ren=E9_=27Necoro=27_Neumann?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130925 Thunderbird/17.0.9 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: shared history but recalling history in current terminal References: <131127000208.ZM18878@torch.brasslantern.com> In-Reply-To: <131127000208.ZM18878@torch.brasslantern.com> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Am 27.11.2013 09:02, schrieb Bart Schaefer: > On Nov 26, 10:31pm, Wayne Davison wrote: >> >> bindkey '^p' up-line-or-local-history >> >> up-line-or-local-history() { >> zle set-local-history 1 >> zle up-line-or-history >> zle set-local-history 0 >> } >> zle -N up-line-or-local-history > > Another possibility is something like: > > zle-line-init() { zle set-local-history 1 } > zle -N zle-line-init > > zle-keymap-select() { > [[ $KEYMAP = isearch ]] > zle set-local-history $? > } > zle -N zle-keymap-select > > Then incremental search is non-local history, everything else is local, > and you don't have to re-create individual keybindings. > Unfortunately, this seems only to work when not doing a 'RETURN' without command in a session, because then the other sessions are imported again: S1>ls S2>echo muh S1>(UP) -> ls (ESC) S1>(RETURN) S1>(RETURN) S1>(UP) -> echo muh This seems to be not completely deterministic, in some cases it does not happen. I tried to debug the widgets you defined, but any 'echo' or 'zle -M' I put in there was ignored. - René