Bug 252663 - tcsh history file is not merged
Summary: tcsh history file is not merged
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.2-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-14 08:10 UTC by Osamu Matsuda
Modified: 2021-01-21 01:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Osamu Matsuda 2021-01-14 08:10:26 UTC
The tcsh has been updated to 6.21.00 in FreeBSD 12.2-Release.

Unfortunately, the new tcsh 6.21.00 has a problem on merging histories.
When several tcsh instances are running with the "merge" option for "savehist" shell variable, each tcsh instance doesn't merge the history list to existing ~/.history on exit: it just overwrites ~/.history with its own history list.

How to reproduce:

1) open two tcsh's (let them as tcsh A and tcsh B) with .cshrc including
      set savehist = (1000 merge)
2) execute
      echo abc
   on tcsh A and then exit
3) execute
      echo def
   on tcsh B and then exit
4) open another tcsh and do "history".
   It only includes "echo def" not "echo abc".
   Of course we expect both "echo abc" and "echo def" were included.

The situation is the same for 13-Current.

To fix this, I found a patch for 6.22.00 at 
https://mailman.astron.com/pipermail/tcsh/2020-February/000072.html

I confirmed that the mentioned patch fixes the problem also for 6.21.00, but I'm not sure whether the patch has any side effect or not.
Comment 1 Osamu Matsuda 2021-01-21 01:01:43 UTC
According to https://github.com/tcsh-org/tcsh/blob/master/Fixes,
the latest tcsh 6.22.03 includes "Fixed reversed test that broke history merging"

The source for 6.22.03 taken from https://github.com/tcsh-org/tcsh
can be built on FreeBSD 12.2-release without any change. The history list is properly handled with this.