bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Savannah and (getting old) issue 108530 reported there


From: Chet Ramey
Subject: Re: Savannah and (getting old) issue 108530 reported there
Date: Sat, 06 Jun 2015 16:49:56 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 6/2/15 5:24 AM, Balaco Baco wrote:
> I'm surprised to read you saying that this is not a problem with Bash.

Because technically the history facilities are provided by readline, and
bash builds on those.

> I use Bash as my shell. As configure it (from its appropriate config
> file). And I get results opposite to what would be expected. And you say
> there is no problem with bash? Bash does not only deal with in memory
> lists because it reads the history from the file .bash_history when we
> open a new session. It will read history files with duplicate commands
> it wrote before, although we configured for not doing this.

It reads and writes history files, but the session history it keeps, and
the history that, for instance, the `history' and `fc' commands act on,
is a list kept in memory and managed by the history library that's part
of readline.  This is the way it has always been.

You may not like that design.  You may think it causes you problems.  But
it is the implementation.

> 
> Bash has HIST_CONTROL, HISTFILESIZE and HISTSIZE (at least) to let us
> control how *files* are kept, including history files (not only memory
> commands).

The only one of those that acts on a file is HISTFILESIZE.

> I think it's a problem with Bash and that it should be addressed by
> Bash, directly or not (since you point to Readline).

Thank you.  You have reported the issue.  I have looked at it before, but
I concluded that it was not the highest priority thing I could be spending
my limited development time doing.

You are free to, and I encourage you to, modify bash to use a file-based
history mechanism and to implement some kind of synchronization between
processes that use it.  I would be glad to look at your work.

If you want to take a shot at solving the general problem, great.  If you
don't want to, take a look at the hist_erasedups() function I referred to
in my message.  There's a little more bookkeeping you'd have to do if you
put it into bash, but that should be straightforward.  I'd appreciate the
help, and you would solve your problem.

> And keeping an open and apparently unseen issue in Savannah is bad. Even
> if the decision would be what you said in this message, the assumed
> improvement I had (and have seen in others) before posting it there
> would not feel abandoned. Well, ...

I changed the status to `postponed'.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]