Hang on executing usercommand defined to itself

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Hang on executing usercommand defined to itself

Post by *DrShark »

To reproduce:
1. In Configuration->Misc enter new Alias: testhang
2. Use Choose command dialog, go to usercmd.ini section, press New..., enter em_testhang
3. In next window define "Command:", put there the same: em_testhang
4. After saving this, go to Total Commander's command line, and execute either alias testhang or command em_testhang -> TC interface is locked, only way to close TC is a Task Manager.

I suggest to show an error when user tries to create em_ command which executes itself, and also an error if such command or alias to it executed from commandline/button/menu etc (will help if user edited wincmd and usercmd.ini manually).
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

You can also easy create loops by view modes and assigned commands
but Christian didn't want to catch such problems.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, it's practically impossible to catch all such problems. You could make chains of 100 commands calling themselves in a loop. But you should be able to abort with ESC.
Author of Total Commander
https://www.ghisler.com
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

ghisler(Author) wrote:Sorry, it's practically impossible to catch all such problems. You could make chains of 100 commands calling themselves in a loop. But you should be able to abort with ESC.
Exactly and this is why YOU Doctor Shark should use the thing between your ears and not blame TC for your mistakes :D
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

ghisler(Author) wrote:Sorry, it's practically impossible to catch all such problems. You could make chains of 100 commands calling themselves in a loop.
You could at least make a basic check when user adds such command in Configuration (step 3 in my example): if user entered in Command field the same text as the user command name, then don't make OK button active.
ghisler(Author) wrote:But you should be able to abort with ESC.
Either it didn't work or I didn't wait long enough with my example from first post.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply