Digits in command line

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Digits in command line

Post by *VadiMGP »

May be it is not a bug, but it is unpleasant surprise in TC7 beta 3.
If typed command (in the command line) contains digits only TC tries to execute corresponding internal command.

I discovered this while attempting to run several batch files named 1.bat, 2.bat, etc... And it was really BIG surprise.

If this behavior is intentionally, I think it should be optionally also.
User avatar
petermad
Power Member
Power Member
Posts: 14914
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Support.

executables (.exe, .com, .bar, .cmd) with mumeric names really should have precedence over internal command numbers.

Same thing applies to executables with same name as alias'es.

IMHO internal commands and alias'es should only be executed if normal execution of the command is unsuccessful.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Agree.
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

petermad wrote:Support.

executables (.exe, .com, .bar, .cmd) with mumeric names really should have precedence over internal command numbers.
Same thing applies to executables with same name as alias'es.
IMHO internal commands and alias'es should only be executed if normal execution of the command is unsuccessful.
The precedence of real executables files over internal numeric commands and user defined aliases is questionable. :wink:

Your arguments sound convincing at first glance only, but actually, there is the possibility that a user deliberately chooses to create aliases which have the same name as internal commands or external executables in order to override them.

The question really is which should be the order of priority if names collide?
(1) external executable (without extension, with extension there is no collision very likely)
(2) internal commands
(3) aliases
Or which order?

Have a look at 4NT (JpSoft) e.g.:
The order is - if names collide -:
(1) aliases
(2) internal commands
(3) external executables
If you wish to override this order, then you prefix an asterix to the commandline.

E.g.:
+ alias "cm_edit" defined to call pspad.exe
+ internal command "cm_edit" will call Windows default editor (notepad.exe)
+ So launching "cm_edit" inside 4NT will launch pspad.exe.
+ If you wish the internal command, you would type "*cm_edit" and get the Windows default editor.
+ And if there were a cm_edit.exe somewhere in your path you woud have to launch "cm_edit.exe".

You see things are only simple and unambiguous if one looks at them only from one perspective.
Taking a different perspective, things will look differently.

As I have got used to the JPSoft 4NT logic for years now (which somehow seems to be in accordance with the Linux/Unix handling of aliases) , bet which order of priority I would prefer?!

--
Summary
There is no such thing as a natural order of aliases, internal commands and external executables, if their names collide.
There is only such a thing as a broadly accepted convention as to what the order of precedence should be.
Christian might explain what the current order of precedence is. (It should definitely be clearly stated inside the helpfile - did not search for it so far :oops: )

Kind regards,
Karl
User avatar
petermad
Power Member
Power Member
Posts: 14914
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

here is only such a thing as a broadly accepted convention as to what the order of precedence should be
I won't argue against that - my opinion was based on not having worked with neither 4NT nor Linux/Unix - merely thinking that assigning the name of an executable to an alias would be more likely to by accident than by choice, but I can appreciate your way of seing it too.

It should definitely be clearly stated inside the helpfile
I agree - and I haven't found anything there yet.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This feature has now been removed from TC7 beta 4.
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2ghisler(Author)
Yes, now it works as before. Thanks!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

2ghisler(Author)
Can you re-add this possibility as optional in next RC?
User avatar
Hacker
Moderator
Moderator
Posts: 13102
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

DrShark,
Just create aliases for the internal commands you intend to use.

HTH
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.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Hacker wrote:DrShark,
Just create aliases for the internal commands you intend to use.
You mean something like em_number?
It's not difficult for me :) but I think entering the digits without em_ more quicky and comfortable :)
Why using digits in command line is bad if will be disabled by default?
p.s. I think command em_xxx more useful for button/menu but not for command line...
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Sorry, I understand what is Alias (quote from help):
Alias Enter an alias here, e.g. "np" to start Notepad via the command line.
Maybe, it's a good solution if I use a few commands.
Post Reply