[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: history -a misbehaves with $HISTSIZE
From: |
Chet Ramey |
Subject: |
Re: history -a misbehaves with $HISTSIZE |
Date: |
Fri, 1 Mar 2019 11:43:55 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 |
On 2/28/19 5:53 PM, Айрат Васбикарамов wrote:
>> It seems like what you want is min(history_lines_this_session,
>> history_offset),
>> kind of like what you say below. Try the attached patch and see if it
>> does what you want.
>
> Yes, that's what I mean.
>
>> I don't think this would happen too much in practice, though, because if
>> you wait until you have more than $HISTSIZE history entries, you'll lose
>> information no matter what you use.
>
> I don't think that happens frequent either. But it's possible. Someone set
> HISTSIZE to 1000 as he don't care about too old commands and it's happened
> that he typed more than 1000 command. Then he run "history -a" to synchronize
> current history with another started bash for example. And lost recent
> commands. Possibly he notice it. But may not.
>
> Anyway I don't see downsides of this behavior comparing to current. And it
> seems more intuitive to me. So should it be default?
It's in the devel branch. Try it and see if it does what you want.
Chet
--
``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/
- Re: history -a misbehaves with $HISTSIZE,
Chet Ramey <=