Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

History confusion

Status
Not open for further replies.
May
7
0
Hello,

I'm using TCC LE 11.0. I have usually a window open where I run manually commands. Sometimes I run manually commands in a second window, or I run a batch script that runs in a different window/process.

None of the local history checkboxes is checked.

It seems that whenever another TCC process runs (and probably completes), the history (commands, directories) of the one window that I have normally open gets messed up. It seems to lose the commands of the current session in this situation -- which is bad, because my sessions usually are long.

Am I doing something wrong? Is this a "feature" of the LE version?

Thanks,
Gerhard
 
There seem to be a few different issues involved. I'm trying here to make sense of them... Please correct me where I'm wrong.

In my 4NT setup, I used this in the startup script of the primary shell:
Code:
history /r C:\cmd\4NT\history.log
dirhistory /r C:\cmd\4NT\dirhistory.log
And this in the exit script of the primary shell:
Code:
@history > C:\cmd\4NT\history.log
@dirhistory > C:\cmd\4NT\dirhistory.log
AIUI, you are suggesting something similar, only using the %_SHELL variable instead of the Primary and Secondary sections in 4NT.INI to run these commands only for primary shells. IIRC this lost commands from independent (primary) shells; only the history of the primary shell that was closed last was preserved. A workaround would probably be to only launch independent shells from the primary shell.

With "don't use a history file" you probably mean to leave the text fields "History File" and "Directory History" on the "Command Line" tab of the options dialog empty.

AIUI, the files in the "Logging" section of the "Startup" tab of the options dialog have nothing to do with the command or path history.

Is this all correct?

Thanks.
 
I think I used a global history and only loaded the history file if the history was empty.

Maybe you'd like to vote for my suggestion in the feedback forum so Rex will save us the trouble!
 
From: David Marcus
| I think I used a global history and only loaded the history file if
| the history was empty.
|
| Maybe you'd like to vote for my suggestion in the feedback forum so
| Rex will save us the trouble!

I had no such trouble for years since I switched to the following approach in WinXP, with all four sharable entities (aliases, user functions, command history, directory history) global, with sizes set to the maximum value:
When I log in, I automatically run a temporary instance of TCC which does the following:
1/ defines the environment variable SHRALIAS_SAVE_PATH
1/ starts SHRALIAS
2/ loads the saved GLOBAL tables from files HISTORY.SAV, DIRHISTORY.SAV, ALIAS.SAV, FUNCTION.SAV located in the directory specified by SHRALIAS_SAVE_PATH
3/ exits
This method keeps all tables in memory until I log out, at which time they are automatically saved (see SHRALIAS command).
If I make changes in aliases or functions, they will immediately propaget to all current instances of TCC. Likewise, interactive commands executed in any instance are immediately shared in by all instances.
--
HTH, Steve
 
When I log in, I automatically run a temporary instance of TCC which does the following:
1/ defines the environment variable SHRALIAS_SAVE_PATH
1/ starts SHRALIAS
2/ loads the saved GLOBAL tables from files HISTORY.SAV, DIRHISTORY.SAV, ALIAS.SAV, FUNCTION.SAV located in the directory specified by SHRALIAS_SAVE_PATH
3/ exits
This method keeps all tables in memory until I log out, at which time they are automatically saved (see SHRALIAS command).
Thanks, that sounds helpful. I just have a few questions about how this works...

The doc says ("Local and Global History Lists"): "SHRALIAS retains the lists in memory, but cannot preserve it when Windows itself is shut down or the user logs out. To save your histories for the next restart of Windows, you must store them in a file and reload them after the system restarts."

You say that they are saved automatically. This is also how I read the SHRALIAS documentation:

"If you have an environment variable named SHRALIAS_SAVE_PATH, SHRALIAS will save the alias, history, dirhistory, and function lists to the path specified by SHRALIAS_SAVE_PATH when SHRALIAS exits."

Also, shouldn't the temporary session load the lists as they were when they were last saved -- without explicitly loading them? And the SHRALIAS command then persist them in memory?

PS Sorry for the delay in responding... I didn't get an email notification.
 
From: gerhard
|
| Also, shouldn't the temporary session load the lists as they were
| when they were last saved -- without explicitly loading them? And the
| SHRALIAS command then persist them in memory?

The LOADING of the saved lists is NOT automatic. I approve of this design, since it is very simple to do it myself. OTOH you may not want to load the automatically saved tables in the first session after loggin in.
--
Steve
 
The LOADING of the saved lists is NOT automatic.

Thanks a lot, I think I have it figured out now. In the options dialog, I removed the definitions for a history and a dirhistory file. This disables the automatic loading of these -- which were saved with duplicates, differently from what shralias saves. I now "manually" load the shralias *.sav files in the login script.
 
Status
Not open for further replies.
Back
Top