[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [OT] Not clobbering bash history
From: |
Jens Schmidt |
Subject: |
Re: [OT] Not clobbering bash history |
Date: |
Thu, 23 Nov 2023 21:12:08 +0100 |
User-agent: |
Mozilla Thunderbird |
On 2023-11-23 13:42, Spencer Baugh wrote:
> Arsen Arsenović <arsen@aarsen.me> writes:
>
>> Unfortunately, I have been unable to produce a decent set of
>> reproduction steps. This issue happens (relatively) infrequently and
>> inexplicably on my machines. It pains me to complain without solid
>> information.
>>
>> I also have shopt -s histappend set.
>>
>> I suspect that something starts a bash process and does not set
>> histappend (--norc?), leading bash to override history.
>
> I've always suspected TRAMP of this.
Arsen's problem description rang a bell ... on my development server
at work I configure a non-standard history file in my .bashrc. And
regardless of that, every now and then, the default ~/.bash_history
gets created.
So probably a work-around for your overwrite problems could be exactly
that: Just configure HISTFILE=~/.my_hidden_bash_history near the same
spot where you set 'shopt -s histappend'. Any villain not respecting
the latter won't (hopefully) respect the former as well, leaving your
non-default Bash history untouched. (Unless you have tried that
already, of course.)
Besides that, the contents and timestamp of the default ~/.bash_history,
should it still get created, could then help finding the villain.