Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Infinite history size
- X-seq: zsh-users 18216
- From: ZyX <kp-pav@xxxxxxxxx>
- To: Chris Down <chris@xxxxxxxxxxxxxx>
- Subject: Re: Infinite history size
- Date: Sat, 14 Dec 2013 15:49:12 +0400
- Cc: Zsh users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1387021753; bh=EOwHkc9j5nTaMbk2xnudSS3Aqxj5wgSsMLTVMdPBC3s=; h=From:To:Cc:In-Reply-To:Subject:Date; b=HrX903sF8wqbP9cBIM6peeLBU0cT6RO5g/bNtIIjgYRIxKtFtZVjSvnxMG5sFjjP/ V2V5i8rxsZWtf5SaRm/jJ3WHD3DNIFXshgujiCS2pup2EUjKPRRahrbBEPrqwRgLP6 l5gPtKLRRCfkmpgcGVmaNzgBUPiGDy8ehAeA0ld8=
- In-reply-to: <20131214104823.GA16269@chrisdown.name>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
14.12.13, 14:52, "Chris Down" <chris@xxxxxxxxxxxxxx>":
>
> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author