bug-bash
[Top][All Lists]
Advanced

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

Re: feature-request: don't count history time comment lines when in HIST


From: Christoph Anton Mitterer
Subject: Re: feature-request: don't count history time comment lines when in HISTFILESIZE
Date: Thu, 26 Mar 2015 01:06:09 +0100

On Wed, 2015-03-25 at 16:19 -0400, Chet Ramey wrote:
> When you start bash, and source your .bashrc, the history comment character
> is not set.  You haven't set it in .bashrc, I assume
Yes, I haven't.

> Since that's not set, the lines beginning with
> `#[digit]' are not recognized as timestamps and treated as ordinary history
> entries.
> You can fix this by assigning to histchars before setting HISTFILESIZE:
> histchars='!^#'
Okay that works in principle.

But a) this means truncation of the history file happens immediately
each the HISTFILESIZE is set and not just when the shell quits, right?

And b) it seems kinda ugly that one needs to explicitly set a default
value that would be set later anyway.
Wasn't it possible to simply set the default for histchars earlier in
the startup?
If someone wants to set histchars he'd have to do it anyway, and for
those who want to stick with the defaults, this would solve the above
issue.

Apart from that, it's not really directly obvious that histchars also
affects the history itself and not just history expansion.
E.g. it's normally not even set in my shell environment (not even the
default value).


Thanks,
Chris.




reply via email to

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