Can you add a cm command to restart TC?

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

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

Post 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).
Overquoting is evil! πŸ‘Ž
sa16
Senior Member
Senior Member
Posts: 215
Joined: 2021-09-10, 07:15 UTC

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

Post by *sa16 »

Fla$her wrote: ↑2022-10-03, 14:25 UTC Does TC have such settings?
Configuration --> Operation --> Save on exit --> Directories ?
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

Understood, forgot about this option.
Overquoting is evil! πŸ‘Ž
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

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

Post 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.
Hoecker sie sind raus!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! πŸ‘Ž
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! πŸ‘Ž
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post by *ghisler(Author) »

(including FS plugins, any virtual folders, network folders, ftp).
Sorry, this will not be supported.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

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

Post 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. :(
Overquoting is evil! πŸ‘Ž
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! πŸ‘Ž
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! πŸ‘Ž
monarch-lfv
Junior Member
Junior Member
Posts: 73
Joined: 2022-06-16, 23:37 UTC

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

Post 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.
Post Reply