Page 3 of 5

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 13:56 UTC
by petermad
The next Total Commander will support restart via command:
CM_EXIT 1
This will start TC with parameter /N after saving paths on exit (if this is enabled by the user). It will also pass parameters /i= and /f= for the ini files if they were passed to the running program. Anything else?
It would be nice if the current paths and cursorpositions are used - even if saving paths is disabled by user - maybe as CM_EXIT 2

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 14:25 UTC
by Fla$her
petermad wrote: 2022-10-03, 13:56 UTCif saving paths is disabled by user
Does TC have such settings?

I agree about the positions of the active and inactive cursors. It would also be useful. But it's still necessary to take into account partially blocked tabs (ignore their settings when restoring) in the context of saving paths (including FS plugins, any virtual folders, network folders, ftp).

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 16:05 UTC
by sa16
Fla$her wrote: 2022-10-03, 14:25 UTC Does TC have such settings?
Configuration --> Operation --> Save on exit --> Directories ?

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 16:38 UTC
by Fla$her
Understood, forgot about this option.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 00:59 UTC
by Sir_SiLvA
ghisler(Author) wrote: 2022-10-03, 09:12 UTC The next Total Commander will support restart via command:
CM_EXIT 1
This will start TC with parameter /N after saving paths on exit (if this is enabled by the user). It will also pass parameters /i= and /f= for the ini files if they were passed to the running program. Anything else?
Only one: call the default one CM_RESTART so it can be built into menus without having to relay on usercmd.ini please.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 08:32 UTC
by ghisler(Author)
returning to directories that were opened in partially blocked tabs.
How should this work? I just runs a new instance, which loads the settings from wincmd.ini saved by the previous instance.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 09:04 UTC
by Fla$her
ghisler(Author) wrote: 2022-10-04, 08:32 UTCHow should this work?
In my script for such tabs, I executed cm_GotoPreviousDir when starting a new instance.
Since you have more tools to work with different types of directories, you can restore directories from the information stored in memory about them. Or, even better, you can introduce a special directive that for such tabs will work with the current folders as if they did not have a lock, but only when restarting.
In general, it is much easier for you to cope with this qualitatively than using scripts.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 10:00 UTC
by ghisler(Author)
For the current tabs, I just need to pass /L= and/or /R= parameters to the new instance. But for the inactive tabs, there is no such solution. But I will add this if the tabs don't point to plugins.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 10:11 UTC
by Fla$her
ghisler(Author) wrote: 2022-10-04, 10:00 UTC For the current tabs, I just need to pass /L= and/or /R= parameters to the new instance.
No, I've been through this for a long time (10 years ago), it won't do. One more time:
Fla$her wrote: 2022-10-03, 14:25 UTCBut it's still necessary to take into account partially blocked tabs (ignore their settings when restoring) in the context of saving paths (including FS plugins, any virtual folders, network folders, ftp).
ghisler(Author) wrote: 2022-10-04, 10:00 UTCBut I will add this if the tabs don't point to plugins.
Any return is needed. All of the above, not just regular folders.
ghisler(Author) wrote: 2022-10-04, 10:00 UTCBut for the inactive tabs, there is no such solution.
Of course, this does not apply to inactive tabs. Only those that are currently displayed in the panels.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 13:53 UTC
by ghisler(Author)
(including FS plugins, any virtual folders, network folders, ftp).
Sorry, this will not be supported.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 15:07 UTC
by Fla$her
ghisler(Author) wrote: 2022-10-04, 13:53 UTCSorry, this will not be supported.
In that case, it's not interesting. What you suggested with the command-line key substitution has long been done. There is little benefit from this. Well, we will continue to use workarounds. Too bad. There's nothing can do. :(

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 16:22 UTC
by ghisler(Author)
Total Commander 10.52 RC1 is available now! CM_EXIT now supports the following parameters:
0 or no parameter: Just exit.
Or sum of:
1: Exit and restart Total Commander
2: Exit and restart, and switch between 32-bit and 64-bit versions (note: 2 and 3 do the same thing)
4: Save directories, tabs and panels (brief, full etc.) even when disabled in settings

4 can be either added to 1 or 2 for restarting, or used for itself to just save the settings.

It does return to directories opened in tabs which are locked but with directory changes allowed. However, it does not restore the scroll position or selected files, there are no parameters to do this and there is no easy way to add it either.
In that case, it's not interesting.
You can still use your own method if you need more. This is meant for the majority of users who just want to restart the program quickly without the need for any external software.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-04, 16:46 UTC
by Fla$her
ghisler(Author) wrote: 2022-10-04, 16:22 UTC However, it does not restore the scroll position or selected files, there are no parameters to do this and there is no easy way to add it either.
And what are the difficulties here? The names of the two objects under the cursor to pass in /P /L= for you just a cakewalk.
ghisler(Author) wrote: 2022-10-04, 16:22 UTC You can still use your own method if you need more. This is meant for the majority of users who just want to restart the program quickly without the need for any external software.
To each according to his need. I understand. But I have to do it with insufficiently reliable and full-fledged methods. And you can implement it as efficiently as possible with simple tab management directives. For example, commit the lock paths in memory, execute 3919/cm_ToggleLockCurrentTab, and at startup return the lock status with the old paths.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-09, 16:28 UTC
by Fla$her
2ghisler(Author)
Please add some message when restarting (like TCFS2.exe /ef msg(88888,0,0) ), so that it can be used in autorun.cfg to allow closing Everything only with simple exit (i.e. without flags 1 or 2).

Code: Select all

SetMessageAction 88888 Restart = 1

Pragma AutorunFinalizeSection
If Not Restart Then ProcessTerminate /F /A '%COMMANDER_PATH%\Utils\Everything\Everything.exe'
Everything loads the system very much with database checking and indexing, so it is impractical to terminate it when restarting.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-10, 02:48 UTC
by monarch-lfv
2Fla$her
Therefore, I do as I described earlier:
At the first launching of the TC, all the applications I need are launched and are constantly in the tray. They do not depend of TC restarts in any way.