From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10641 invoked by alias); 15 Dec 2013 20:06:22 -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: 18220 Received: (qmail 3144 invoked from network); 15 Dec 2013 20:06:16 -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: <131215120607.ZM20484@torch.brasslantern.com> Date: Sun, 15 Dec 2013 12:06:07 -0800 In-reply-to: <20131214104823.GA16269@chrisdown.name> Comments: In reply to Chris Down "Infinite history size" (Dec 14, 6:48pm) References: <20131214104823.GA16269@chrisdown.name> <2151387021752@web29g.yandex.ru> <20131214115345.GA17562@chrisdown.name> In-reply-to: <20131214115345.GA17562@chrisdown.name> Comments: In reply to Chris Down "Re: Infinite history size" (Dec 14, 7:53pm) X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh users Subject: Re: Infinite history size MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 14, 6:48pm, Chris Down wrote: } } In bash, and some other shells, this can be done by nullfying (note: not } unsetting) HIST{,FILE}SIZE, and then making sure readline's } "history-size" is -1. I think what you've found there is a behavior of readline, not especially a behavior of the shells in question. Since zsh doesn't use readline, ... On Dec 14, 7:53pm, Chris Down wrote: } } So I'll take the answer as "you can't" (although LONG_MAX is obviously } not something that I'm going to reach :-) ). Although setting a very large number is probably the easiest way, you could do something along these lines: SAVEHIST=$(( $(wc -l $HISFILE) * 2 )) HISTSIZE=$SAVEHIST zshaddhistory() { if (( HISTNO == HISTSIZE )); then (( HISTSIZE *= 2 )) SAVEHIST=$HISTSIZE fi return 0 } I haven't tested that, and obviously it needs some tweaking for cases where file size actually becomes a significant fraction of LONG_MAX.