Auto save session periodically
Moderators: Hacker, petermad, Stefan2, white
Auto save session periodically
Hello.
I've got a feature request. The current situation with TC is that you cannot foresee a crash, but once it happens - you have to use old session, as the latest one will be lost.
I have an idea with a good solution of this problem:
Add an automatic save of session periodically.
Periods should be also configurable (how often do a session store?) and they maybe "clever" (i.e. store the session only if there are difference with old one and don't store sessions more often then once in 5 sec).
The automatism of this feature should be made with a checkbox, so the ones who doesn't need it - they can turn it off.
If you won't add this feature as an automated process, then you could at least set command-line keys for all kinds of settings that are being saved when a session save is initialized and tell us what are they, so we could manually initiate a session store process by creating buttons, and we need specifics then: what is a command that should be run and what are the command-line keys for each of 4* different types of settings.
* these 4 types are: directories, panels, old command lines and directory history.
And they are listed here: Configuration > Options > Operation > Save on exit.
Example of the code of such a button:
cm_ConfigSaveSettings /dir /pan /dirHistory - this is meant to save directory, it's history and the panels.
But it would be way better if you'd add it as a periodic and automatic function.
I've got a feature request. The current situation with TC is that you cannot foresee a crash, but once it happens - you have to use old session, as the latest one will be lost.
I have an idea with a good solution of this problem:
Add an automatic save of session periodically.
Periods should be also configurable (how often do a session store?) and they maybe "clever" (i.e. store the session only if there are difference with old one and don't store sessions more often then once in 5 sec).
The automatism of this feature should be made with a checkbox, so the ones who doesn't need it - they can turn it off.
If you won't add this feature as an automated process, then you could at least set command-line keys for all kinds of settings that are being saved when a session save is initialized and tell us what are they, so we could manually initiate a session store process by creating buttons, and we need specifics then: what is a command that should be run and what are the command-line keys for each of 4* different types of settings.
* these 4 types are: directories, panels, old command lines and directory history.
And they are listed here: Configuration > Options > Operation > Save on exit.
Example of the code of such a button:
cm_ConfigSaveSettings /dir /pan /dirHistory - this is meant to save directory, it's history and the panels.
But it would be way better if you'd add it as a periodic and automatic function.
Last edited by HAL 9000 on 2010-01-26, 21:30 UTC, edited 1 time in total.
- Vochomurka
- Power Member
- Posts: 816
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
There are many utilities capable of working with windows and their handles, and having scheduling capabilities. I would use PowerPro in this case.
1. Detect the TC handle (that of window with the TTOTAL_CMD class);
2. Create an event (event.dll plugin) that operates every N seconds;
3. Each time it sends the cm_ConfigSaveSettings (580) command to the window with known handle.
If there is a need, I can easily write a PowerPro script.
1. Detect the TC handle (that of window with the TTOTAL_CMD class);
2. Create an event (event.dll plugin) that operates every N seconds;
3. Each time it sends the cm_ConfigSaveSettings (580) command to the window with known handle.
If there is a need, I can easily write a PowerPro script.
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
- Vochomurka
- Power Member
- Posts: 816
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
It was really one of my goals to NOT support this proposal (Я того и добивался
)

Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
Well, you didn't argument your point. You just said that you know how to get this feature using incorrect method.
I want developer to comment this feature request.
All other commentaries with arguments pro/cons would be also appreciated.
+ I'd like to say that
1. cm_ConfigSaveSettings is slow
2. There is no simple way to detect state changing => stupid fixed delay between saves => too slow
3. Realization of this feature in the way you suggested means that my portable TC wouldn't not be portable anymore:
a). it'd require additional software (file weight increases)
b). I'm not sure there is a portable version of this scripting software
c). + load time, cause it'd require two programs to be run, not just one.
4. What would happen with your script if I decide to run 2 TC windows?
5. There is a global rule: more soft = more bugs. Why not just add a really small, but useful feature to the good software, that really lacks it?
I want developer to comment this feature request.
All other commentaries with arguments pro/cons would be also appreciated.
+ I'd like to say that
1. cm_ConfigSaveSettings is slow
2. There is no simple way to detect state changing => stupid fixed delay between saves => too slow
3. Realization of this feature in the way you suggested means that my portable TC wouldn't not be portable anymore:
a). it'd require additional software (file weight increases)
b). I'm not sure there is a portable version of this scripting software
c). + load time, cause it'd require two programs to be run, not just one.
4. What would happen with your script if I decide to run 2 TC windows?
5. There is a global rule: more soft = more bugs. Why not just add a really small, but useful feature to the good software, that really lacks it?
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
2HAL 9000: Your are pointing out the problems of autosave yourself:
Yes, periodically autosave will kill your USB-Stick after a short while.3. Realization of this feature in the way you suggested means that my portable TC wouldn't not be portable anymore:
Well, which configuration should be autosaved (both windows are using the same ini file ...) ?4. What would happen with your script if I decide to run 2 TC windows?
#5767 Personal license
That's why I also requested a checkbox to turn off this feature, but I need it turned on when I'm using it on a PC.sqa_wizard wrote:Yes, periodically autosave will kill your USB-Stick after a short while.
Both should be autosaved, but I meant that I'm not sure, that a script can do the same.sqa_wizard wrote:Well, which configuration should be autosaved (both windows are using the same ini file ...) ?
It is quite easy to write algo that will periodically enum existing TC windows and pass them cm_ConfigSaveSettings command, so it's not a problem at all (if you don't like scripts I can make separate 3-KB .exe that will do this with passed delay). But USB stick trouble is important, and here simple algo won't work good. BTW if you use TC from stick, it is better to redirect temporary parameters like history, tabs etc to some INI in temporary folder. Although, I think cm_ConfigSaveSettings will overwrite wincmd.ini also, so this will kill stick anyway, but you may try to make it read-only so cm_ConfigSaveSettings won't corrupt your stick.HAL 9000 wrote:Both should be autosaved, but I meant that I'm not sure, that a script can do the same.
Why? And why do you think that TC will save same settings much faster with new command?HAL 9000 wrote:1. cm_ConfigSaveSettings is slow
The part of my request was to add different cmd-keys for each type of the settings, so I could specify only the ones that I need most and that will fasten the process.MVV wrote:Why? And why do you think that TC will save same settings much faster with new command?HAL 9000 wrote:1. cm_ConfigSaveSettings is slow
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
It's just your guess. I didn't get a respond from him. For the second time (the previous topic was about adding scrolling to tab bar).sqa_wizard wrote:AFAIK no request is ignored
You mean thousands of requests were also ignored?sqa_wizard wrote:but there are thousands of other requests on the wishlist that are requested over the years by a lot of users.
HAL 9000,
Roman
Thousands of request are on the wishlist, but Christian only has two hands and there are only 24 hours in a day.You mean thousands of requests were also ignored?
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.