Alias overwrite warning

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Alias overwrite warning

Post by *fenix_productions »

Hello everybody.

First try to do something like this:
1. in usercmd.ini file define section similiar to:

Code: Select all

[em_test]
Menu=test
Cmd=D:\picture.jpg
button=
2. assign em_test to "notepad" alias

Now, writing "notepad" in command line will give You picture preview. Before 2nd step: typing "notepad" gives notepad application.

My proposal is that TC should check for existing Windows aliases and give a warning about overwriting it.

Or maybe give alternates:
1. warning dialog with "assign / change alias / cancel" buttons
2. assign alias to TC but give Information about possibility of executing system registry alias via (e.g.) Shift+Enter (this should be implemented)
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

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

Post by *petermad »

I don't think notepad is a Windows alias (whatever that might be) - it is simply the name of an executable file that happens to be placed in a directory listed in the PATH environment and therefore executed no matter wich directory one might be in.

Therefore your suggestion implies that TC should check all executables in the PATH environment when assigning an alias - I don't think that is feasible. On my system that's 879 files, and it could easily be a lot more (I am very restrictive about what I install).
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

As "Windows alias" I understand these applications which have own registry key below HKEY_CLASSES_ROOT\Applications.
I've realized that %PATH% does matter too for command line.

What is wrong with checking for existence of "sample.exe" in %PATH% or registry?

Why not feasible?
You just have to check one file.
I've wrote sample application for this purpose in 30 minutes (C# noob). It works pretty fast for ~500 exe files and 80 registry keys.
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

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

Post by *petermad »

It works pretty fast for ~500 exe files and 80 registry keys.
How fast? And shouldn't you search for sample.exe, sample.com, sample.bat and sample.cmd to cover all instances of sample - and will that influence the speed considerably?

Don't misunderstand me - I am not against the idea, but if it means having to wait more than max. ½ a sec. I don't think it will be nice to work with.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

I understand delay issue. I've been wondering about this possibility because I'am assigning aliases very rarely, so even 2sec could be acceptable for me.

P.S. How often do You use thumbnails view? How long does it need to generate previews?
P.S.2. "How fast?" I can send You this app if You want to ;)
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

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

Post by *petermad »

I understand delay issue. I've been wondering about this possibility because I'am assigning aliases very rarely, so even 2sec could be acceptable for me.
I see - you only want the alias check performed when assigning an alias - I thought that the check should be done every time a command (like notepad) was executed - to check for new programs with that name that might eventually have been installed after the alias was assigned.

If the check only has to be done during the alias assigning I agree that a bigger delay is tolerable.

How often do You use thumbnails view? How long does it need to generate previews?
I use them regularily. The time it takes generating them really depends on a lot of things, like OS, processor speed, generating method (plugin method, explorer method, viewer method) and the size of the pictures - Here it takes less than ½ sec for 16 96x72 pixels thumbnails (a full panel) of 500k jpeg's using the Explorer method on Win XP SP2 with a 3 GHz CPU
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

petermad wrote:I see - you only want the alias check performed when assigning an alias
Yes.
And there would be always TC alias executed on Enter key. When user press Shift+Enter, TC should try to execute "Windows alias" (maybe using ShellExecute() function).
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

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

Post by *petermad »

When user press Shift+Enter
Shift+Enter already has its own function:
1. Runs command line / program under cursor with preceding command /c and leave the program's window open. Only works if NOCLOSE.PIF is in your Windows directory!
2. With ZIP files: use alternative choice of these (as chosen in Packer config): (Treat archives like directories <-> call associated program, i.e. winzip or quinzip)
3. Inside an archive file: Unpack the file under the cursor and treat it like an archive (zip in zip processing)
4. In the list of last used dirs (History, Ctrl+D), open the directory on a new Tab
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

One of available Enter combinations.
(Ctrl+Alt+Enter or Win+Enter)
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
Post Reply