Lost history

Jun 8, 2013
98
0
Warsaw, Poland
Hello.
Several time I was annoying by loosing history when started another TCC session. Now I'm ready to define an issue.

Environment: TCC 16.03.55 Windows 7 [Version 6.1.7601]
or: TCC LE 13.06.77 Windows 7 [Version 6.1.7601]

Settings:
Code:
History=509952
HistCopy=No
HistMove=Yes
HistWrap=Yes
HistCase=No
HistDups=Last
HistFile=Z:\History.dat
LocalHistory=No

tcStart.bat
Code:
@*Echo === tcStart ===
@*History
@*Echo ===============

and History.dat:
Code:
dir 1
dir 2
dir 3

Scenario:
Start tcc.exe
Code:
=== tcStart ===
dir 1
dir 2
dir 3
===============
OK.

Some commands:
Code:
dir 2
@history

And the result is:
Code:
dir 1
dir 3
dir 2
Very good, as expected.

Now let's start another TCC session:
Code:
=== tcStart ===
dir 1
dir 3
dir 2
dir 1
dir 2
dir 3
===============
It looks, that: Tcc.exe uses history from global history (the first three lines), then appends History.dat. Would be OK. Don't execute anything in that session, go back to the first session:

Code:
@history

And the result is:
Code:
dir 1
dir 3
dir 2
dir 1
dir 2
dir 3
Ooops. I've got history shared from second session. My last issued command "dir 2" is not he last one. Ma last activities are hidden by re-read of history.dat file.

It is a simple example, the real problem is: I issued dozens of commands. All of them are available to be recalled/reviewed using just several "Up" cursor keys. Starting second shell - my work is hidden by thousands of commands reread from history file.

I'm not sure, if my last activities are hidden, or may be they are lost (due to size of history exceeding limit).

IMHO: order of operations should be reversed: 1st read from history file, 2nd append from global list.
 
Last edited:
May 20, 2008
11,543
104
Syracuse, NY, USA
A global list is just that ... a global list. TCC doesn't read from it, it just attaches to it, There is no mechanism for prepending to the history (if there were, it would be god-awful slow). I doubt the HistFile was meant to be used with a global history. I wouldn't dream of doing it. Consider using SHRALIAS. SHRALIAS protects the global history when no instances of TCC are running so there's no need to load/save the history every time you start/stop TCC.
 
Jun 8, 2013
98
0
Warsaw, Poland
In that approach: it would be enough not to read history.dat if it was possible to attach to global list - global list was already filled from history.dat in the first session.

ShraAlias doesn't resolves anything, everything is working as described previously
 
May 20, 2008
11,543
104
Syracuse, NY, USA
In that approach: it would be enough not to read history.dat if it was possible to attach to global list - global list was already filled from history.dat in the first session.

ShraAlias doesn't resolves anything, everything is working as described previously
To your second point ... if you use a global history (with SHRALIAS or not) and a HistFile it will work as you described before. A suggestion: if you want a global history, don't use a HistFile.

To your first point ... I think folks do that themselves if they want a global history loaded in the "first" session. For as long as I can remember, I have used a login script to load the (global) history (dirhistory, aliases, functions too) from files saved by SHRALIAS ... and then start SHRALIAS. That's the end of the story. I never mess with the history again. It's always there and it's the same in every instance of TCC. And TCC starts instantly (~.07 sec.) not having to load anything. I must confess to being obsessed with how fast TCC starts. I start it roughly 70-80 times a day.
 
Last edited:
It doesn't work correctly with global history. I use global directory history, so I manage saving/loading it myself in tcstart.btm and tcexit.btm.

Code:
iff %_pipe == 0 .and. %_ide == 0 then
   iff %_transient == 0 .and. "%@execstr[dirhistory /t1>&>nul]" == "" then
      dirhistory /r c:\Sys\Data\DirectoryHistory.dat
   endiff
endiff

Code:
iff %_pipe == 0 .and. %_transient == 0 then
   dirhistory > c:\Sys\Data\DirectoryHistory.dat
endiff
 
Similar threads
Thread starter Title Forum Replies Date
fishman@panix.com Lost my TCC cursor... Support 2
J Error "Contents lost before copy" Support 3
Roedy Lost scheduled task association Support 7
rconn News Site down, messages lost Support 0
BobK JPSOFT Site lost my ID.. ? Support 0
S Lost Reg After Moving OS to Diff Drive Support 1
J History file load hangs if file has complete garbage in it... Support 1
R History window wrong size, can't remember size change Support 12
T How to? retain command history across reboot? Support 6
nikbackm Speeding up the history dialog Support 6
D ParentDirectory does not update directory history Support 6
vefatica Command history search is off Support 7
D Directory History Window with wildcard search Support 3
R Long commands retrieved from command history have blank line when wrapped Support 20
Joe Caverly @HISTORY issues Support 4
vefatica Deleting entries in the command history popup? Support 3
H History and TPipe Oddness Support 3
D History and control-C Support 1
G Console exe up / down history Support 8
D What does the file "..\Everything\Run history.csv" store? Support 5
rps Cmd history recall Support 4
David McClelland Command history loosing entries Support 18
R history features. Support 6
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
M Ctrl-C when using command line history does nothing Support 2
S Debugger Bat file call history Support 9
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
vefatica ESC after recalling a command from history Support 3
T TCHelp executable history? Support 2
thorntonpg @blahblah added to history. Support 0
M Call History popup-window? Support 0
M HISTORY lessons ... Support 0
vefatica The help and IE's history Support 16
D Towards shared (dir-)history lists Support 3
vefatica Ctrl-Enter in command history window? Support 8
vefatica History recall turns off Quick-Edit Support 4
C history is getting deleted under unknown circumstances Support 9
R V19 - At startup, TCC save directory in the directory history list Support 2
T [TCC 18] Can't read nor write history Support 1
I Possible Bug: History /n Returns Nothing Support 3
T history.sav Support 4
T How to? sort history in tcexit.btm Support 22
vefatica OT: Windows console history? Support 7
S directory history locks up TCC Support 3
R In addition to ALIAS /Z and FUNCTION /Z, HISTORY /Z? Support 1
E TCC History popups too small Support 0
C How to? Keeping all history lists Support 4
E Command History not showing on up arrow button Support 8
nikbackm HISTORY /R1 performance Support 3
T Selecting line from popup history without executing Support 8

Similar threads