zsh-users
 help / color / mirror / code / Atom feed
From: ZyX <kp-pav@yandex.ru>
To: Chris Down <chris@chrisdown.name>
Cc: Zsh users <zsh-users@zsh.org>
Subject: Re: Infinite history size
Date: Sat, 14 Dec 2013 15:49:12 +0400	[thread overview]
Message-ID: <2151387021752@web29g.yandex.ru> (raw)
In-Reply-To: <20131214104823.GA16269@chrisdown.name>

14.12.13, 14:52, "Chris Down" <chris@chrisdown.name>":
> 
> Hello,
> 
> I am looking to remove the upper limits on the history size in zsh.
> 
> 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. On zsh, doing the same thing with HISTSIZE and
> SAVEHIST results in HISTSIZE becoming 1, and SAVEHIST becoming 0.

It is not possible for history to occupy more memory then you have thus if you think there is no upper limit then you are false.

> 
> Setting an indiscriminately high number is not really appropriate -- I
> have years of (uniq'd by last usage) history that I would like to
> also import, and even that is fairly substantial:
> 
>     $ wc -l .bash_history
>     32539 .bash_history
> 
> Since I don't have any plans for this size to decrease, using a high
> number is probably not a wise idea.

You should determine how much memory you have, how much of it you can allow to be occupied by the history (AFAIK it is always fully loaded into memory) and act accordingly. Removing the limit is not wiser as it leaves you with an idea that there is no limit while it is always limited by available resources.

Or if you do not think you will ever hit a problem with resource exhaustion you can just set HISTSIZE to LONG_MAX from limits.h: it is the maximum number HISTSIZE can have.

> 
> 
> How can I do this in zsh?
> 
> Thanks.


  reply	other threads:[~2013-12-14 11:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-14 10:48 Chris Down
2013-12-14 11:49 ` ZyX [this message]
2013-12-14 11:53   ` Chris Down
2013-12-15 20:06     ` Bart Schaefer
2013-12-15 20:17       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2151387021752@web29g.yandex.ru \
    --to=kp-pav@yandex.ru \
    --cc=chris@chrisdown.name \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).