[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: history -c doesn't reset command counter properly
From: |
Janek Warchoł |
Subject: |
Re: history -c doesn't reset command counter properly |
Date: |
Sun, 11 Mar 2018 09:59:43 +0100 |
Oh, nice!
That's quite a long time ago, when can I expect this change to be released?
I'm not familiar with Bash release lifecycle.
Thanks,
Janek
2018-03-10 20:56 GMT+01:00 Chet Ramey <chet.ramey@case.edu>:
> On 3/10/18 8:27 AM, Janek Warchoł wrote:
> > Hello,
> >
> > I have noticed a strange behavior when working with bash "history"
> command.
> > Every command in history has its index, and I expected that clearing
> > history should reset this index to zero. However, running history -c
> > actually decrements this index by HISTSIZE, so that following commands
> will
> > not be numbered from 1.
> >
> > This can happen e.g. when you set HISTFILESIZE to a bigger value than
> > HISTSIZE. In that case running "history -c; history -r" repeatedly will
> > keep incrementing command indices, while I think it should not.
>
> That was changed back in December, 2016, and the change is in the devel
> branch. Look at lib/readline/history.c:clear_history().
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
>