No parameters passed on %P %L for ".." item

Please report only one bug per message!

Moderators: Stefan2, white, sheep, Hacker

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8273
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

No parameters passed on %P %L for ".." item

Post by *MVV » 2013-07-03, 05:46 UTC

Test simple button:

Code: Select all

Command: cmd.exe /k
Parameters: "echo %P %L"
It prints both current path and path to list if some file is focused or there is a selection. But it does nothing if ".." item is focused and there is no selection. As I see TC doesn't pass any parameters from Parameters line at all.

I think it would be more correct if TC would pass parameters in such case (maybe path to empty file or just empty parameter "" as %L).

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2013-07-04, 13:35 UTC

Total Commander cannot "know" whether the command makes any sense when there are no selected files, but the user has defined parameters for selected files.
Author of Total Commander
http://www.ghisler.com

User avatar
MVV
Power Member
Power Member
Posts: 8273
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-07-04, 14:36 UTC

Why TC starts program then w/o parameters? I doubt that someone will expect that in some cases program won't receive any parameters at all...

User avatar
Horst.Epp
Power Member
Power Member
Posts: 3355
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp » 2013-07-04, 15:59 UTC

MVV wrote:Why TC starts program then w/o parameters? I doubt that someone will expect that in some cases program won't receive any parameters at all...
Why not ?
A program may have defaults if no arguments are given.

User avatar
MVV
Power Member
Power Member
Posts: 8273
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-07-04, 17:28 UTC

Sometimes it is necessary to pass some arguments like current path etc. (especially for file processing tools). And TC passes them all perfectly when some file is focused, but if ".." is focused TC just passes nothing... There is no need to start such tools at all with no arguments.

Empty filelist would be much better alternative for %L in such cases (it is still filelist but with no files).

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2013-07-08, 13:31 UTC

We would probably need multiple parameter options, for
- no files selected, cursor on [..]
- no files selected, cursor on a file
- one file selected
- multiple files selected

But most users wouldn't understand that and would be confused by that many options. So the only solution in your case would be to have two buttons...
Author of Total Commander
http://www.ghisler.com

Hurdet
Senior Member
Senior Member
Posts: 431
Joined: 2003-05-10, 18:02 UTC

Post by *Hurdet » 2013-07-08, 14:02 UTC

I think it would be enough: List files or nothing

User avatar
MVV
Power Member
Power Member
Posts: 8273
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-07-08, 15:14 UTC

ghisler(Author),
Traditionally in TC cases 2-4 of give some selection (if no files are selected focused one is treated as selected).
So I agree with Hurdet that two cases would be enough: List (pass empty filelist's path) or Nothing (as is). And it is enough wincmd.ini setting so only advanced users will edit it.

User avatar
Dzondu
Junior Member
Junior Member
Posts: 9
Joined: 2010-01-22, 14:29 UTC

Post by *Dzondu » 2014-01-30, 16:23 UTC

ghisler(Author) wrote:...
- no files selected, cursor on [..]
- no files selected, cursor on a file
As a user, at first I always assumed these two to be equivalent - if my cursor is on [...] (and there is no selection), the action I'm trying to call should be passed to the directory I'm in.

I always found it weird that the right click works like this, but other features do not. So, when using the keyboard, I can press the menu key on [...] and get the directory's drop-down menu, but can't, for instance, press F5 and copy the entire directory to the other panel.

TC behaves the same with custom commands: currently, if you want to use the same command to call something on a file OR on the directory you're in, you have to go a level up. :(

I'd love to see this changed.

Post Reply