1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Towards shared (dir-)history lists

Discussion in 'Support' started by djspits, Dec 20, 2016.

  1. djspits

    Joined:
    Apr 13, 2010
    Messages:
    189
    Likes Received:
    2
    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?
     
  2. Rodolfo

    Joined:
    May 20, 2009
    Messages:
    213
    Likes Received:
    0
    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
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,300
    Likes Received:
    39
    I think the %_PID variable might be useful for that.
     
  4. djspits

    Joined:
    Apr 13, 2010
    Messages:
    189
    Likes Received:
    2
    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.
     

Share This Page