Towards shared (dir-)history lists

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Apr 13, 2010
190
2
57
The Hague
#1
If you provide file names for the options HistFile and DirHistFile TCC reads them at the beginning of a session, maintains changes during the session and rewrites the files on exit. Now, if a secondary shell is started it too will read the original history lists and add its own new records to them. When these shells exit they will both write to the same files and the last to write will obliterate the recent history written by the first shell to exit.

This description is not entirely complete. I have noticed that, if the secondary shell exits first, the command history of the primary shell is immediately screwed up. I guess it detects the update at some point and rereads the histories, removing all its history between startup and the moment the secondary shell was launched. This must mean that the secondary shell does not inherit the primary shell's in-memory lists, it just reads the files. Life would be beautiful if the shell that launches a secondary shell would first do an intermediate save.

Question: how to fix this. Can I write two different files and merge them later somehow? Ideas anyone?
 
May 20, 2009
216
0
53
ITALY
#2
I believe that You can test the command "log /h /w filename", using different filenames in different sessions.
I do not know how to distinguish different sessions, for example I id not find a way for tcc to get its own pid.


Regards

Rodolfo Giovanninetti
 
Apr 13, 2010
190
2
57
The Hague
#4
Thanks guys.

I will switch off the automatic histories for all secondary shells. Instead, I will use LOG /H /W %@version[etc:\Command.log] in my secondary shells. A version number will probably be more informative than a PID and certainly easier to PURGE.

Regards, DJ.