Inconsistency in internal associations context menu: an extra space between the entry name and the (Internal) text

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

Moderators: petermad, Stefan2, white, Hacker

User avatar
beb
Power Member
Power Member
Posts: 729
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Inconsistency in internal associations context menu: an extra space between the entry name and the (Internal) text

Post by *beb »

Example:
The weird example entry name |Open in Something ' '| is deliberately chosen as such for comparing purposes.

Code: Select all

[Associations]
Filter1=*.*
Filter1_Open in Something '  '=""path to something" "%1""
Issue description:
In the context menu, an extra space is added in between the TC Internal Association entry name and the followin "(Internal)" text.
In the given example, it is seen as the space interval within |Something '| is explicitly a half as wide as one within |' '| (a deliberately double space) and within |' (Internal)|.
At the same time, the interval within |View (Lister)| is OK-ish.

Visualization:
Image: https://i.imgur.com/vB1Q5Kh.png (plain view)
Image: https://i.imgur.com/knq09g4.png (explanatory view)

Note:
Even on this board, the consecutive spaces (outside of the </> code tags) are being reduced to a single one.
While in the context menu, the issue is resulting in the TC Internal Association being a unique entry featuring the double spaces.
Last edited by beb on 2026-05-10, 07:00 UTC, edited 2 times in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
User avatar
petermad
Power Member
Power Member
Posts: 17309
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *petermad »

Even on this board, the consecutive spaces (outside of the </> code tags) are being reduced to a single one.
That is normal HTML behaviour - repeated spaces and linebreaks are not rendered.

Anyway I like the extra space in the context menu - it makes it easier to distinguish the extension(s) from the opener.verb.
License #524 1994
Danish TC Translator
TC 11.57 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1413b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52918
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *ghisler(Author) »

Hmm, I don't see anything wrong here.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 17309
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *petermad »

Neither do ,I but I think beb refers to the extra space you see before (Images) in this screenshot: https://tcmd.madsenworld.dk/contexextraspace.png
License #524 1994
Danish TC Translator
TC 11.57 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1413b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
beb
Power Member
Power Member
Posts: 729
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *beb »

petermad wrote: 2026-05-08, 16:05 UTC ...I think beb refers to the extra space you see before (Images) in this screenshot:...
Yes, you're right.
Also, I made another visualization now with "measurements" to make it "instrumentally" clearer what I mean:
Image: https://i.imgur.com/knq09g4.png
ghisler(Author) wrote: 2026-05-08, 15:17 UTC Hmm, I don't see anything wrong here.
Maybe there are no especially wrongful wrongs, but definitely a certain inconsistency that catches the eye.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
User avatar
beb
Power Member
Power Member
Posts: 729
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *beb »

petermad wrote: 2026-05-08, 11:59 UTC Anyway I like the extra space in the context menu...
Glad for you. You're a lucky one.
However, you have another option to maintain the desired extended gap there, for instance, by adding as many non-breaking spaces before the equal sign as you want, like this:

Code: Select all

[Associations]
Filter1=*.*
Filter1_Open in Something            =""path to something" "%1""
Visualisation of the gap made with non-breaking spaces:
Image: https://i.imgur.com/0PPewUX.png

Meanwhile, currently, I have no option to get rid of that extra space at all.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
User avatar
white
Power Member
Power Member
Posts: 6885
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *white »

beb wrote: 2026-05-08, 18:53 UTC Meanwhile, currently, I have no option to get rid of that extra space at all.
Define a custom command and associate with the custom command?
User avatar
beb
Power Member
Power Member
Posts: 729
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *beb »

white wrote: 2026-05-08, 19:57 UTC Define a custom command and associate with the custom command?
Funnily, that is exactly what I was trying to achieve for the last couple of days, but couldn't find a way.
Can you give an example?
I mean, the end result has to be the Windows context menu entry that is invoked when I right-click a file in the TC.

Currently:
  1. I have a custom command that does something with files of a certain type and works from the TC button bar, from the TC menu, and can work as a standalone (without TC at all, since it is a PowerShell script-based).
    This command takes %WL as a primary input parameter, and if it gets a valid one, it works with it; also, depending on the %WL existence and/or its contents, it gets the secondary input via the internal means using the active panel directory path; additionally, it takes the clipboard contents as another data source.
    Then it sums up all the inputs, analyzes data to extract valid and unique entries (if any) to work with further.
  2. Now, for the sake of usability, I'd want that command entry also to appear in the Windows context menu in the TC upon right-click.
  3. So I teach my command to accept %1 as another input, put it into the TC Internal Associations, and it works (only, with the minor visual inconsistency in the Menu layout that I tried to describe here).
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
User avatar
white
Power Member
Power Member
Posts: 6885
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *white »

beb wrote: 2026-05-08, 21:20 UTC Can you give an example?
I beb so ;)
An example internal association for *.BEB files:

wincmd.ini:

Code: Select all

[Associations]
Filter2=*.BEB
Filter2_beb=***em_beb "%1"
usercmd.ini:

Code: Select all

[em_beb]
button=
cmd=cmd.exe /k echo
param=%A1
User avatar
beb
Power Member
Power Member
Posts: 729
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *beb »

2white
Nice, to say the least. It works great. Thank you very much!
Google showed me nothing like that.
[Associations], [em_beb], pwsh, %WL
[Associations]
Filter2=*.beb
Filter2_beb=***em_beb %WL

[em_beb]
cmd=pwsh -c "%beb%\beb.ps1"
param=%WL
I've even had time to be happy with the double space exorcised for a while: this approach is leaving the extra space nowhere to live, since the command entry in the context menu goes without the "(Internal)" suffix. However, unfortunately, that naughty space resurrects and shows up in its full beauty again in another place as soon as I put AssociationMultiVerbs=1 in the settings.
:)
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
User avatar
white
Power Member
Power Member
Posts: 6885
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *white »

beb wrote: 2026-05-09, 01:57 UTC

Code: Select all

Filter2_beb=***em_beb %WL
Why pass the literal text "%WL" to the em_beb command that ignores it? I feel you missed an opportunity here. Since you do nothing with the parameter, you could have done something like this:

Code: Select all

Filter2_beb=***em_beb BEB (*.BEB)
Notice the neat single space here ;)
beb wrote: 2026-05-09, 01:57 UTC However, unfortunately, that naughty space resurrects and shows up in its full beauty again in another place as soon as I put AssociationMultiVerbs=1 in the settings.
:)
At least you can disable the option "Load extra commands from all matching types" from time to time, and enjoy some time without the cruel and hostile extra space environment. ;)
User avatar
beb
Power Member
Power Member
Posts: 729
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *beb »

white wrote: 2026-05-09, 10:03 UTC Why pass the literal text "%WL" to the em_beb command that ignores it?...
With [***em_beb] in the associations, the [%WL] alone as the [em_beb] command input parameter is enough for the command/script to work, being much better than ["%1"] argument; the latter becomes meaningless and no longer required in the context menu scenario, so I removed its processing block from the code.
Then, I don't know, I just put it there by analogy: [%WL] in [Filter2_beb=***em_beb %WL] instead of ["%1"] in [Filter2_beb=***em_beb "%1"] from your example:
white wrote: 2026-05-08, 22:08 UTC wincmd.ini:

Code: Select all

Filter2_beb=***em_beb "%1"
Even if I felt that [%WL] in [Filter2_beb=***em_beb %WL] was a bit off, I couldn't process the new information properly, leaving that for the day.
And with the current update from you, I just removed [%WL] from the associations, and it works great:

Code: Select all

[em_beb]
cmd=pwsh -c "%beb%\beb.ps1"
param=%WL

[Associations]
Filter2=*.beb
Filter2_beb=***em_beb
Thank you a lot!
white wrote: 2026-05-09, 10:03 UTC Since you do nothing with the parameter, you could have done something like this:

Code: Select all

Filter2_beb=***em_beb BEB (*.BEB)
Honestly, I didn't understand that part. %WL is a protagonist of the story, and the command/script definitely uses/relies on it.
Still, I've tried it, but when [Filter2_beb=***em_beb] is followed by anything other than %WL or "%1" (the actual possible parameters, expected to define the real file/files), PowerShell takes it (the [BEB (*.BEB)] part) as a part of the input and throws reasonable errors of different kinds ("Could not find file '... BEB'.", "*.BEB is not recognized as...").
It looks like this part is not for my current case, so I prefer to leave it as simple as [Filter2_beb=***em_beb], keeping it sound and running.
:)
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
User avatar
white
Power Member
Power Member
Posts: 6885
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] internal associations context menu adds an extra white space between the entry name and the (Internal) te

Post by *white »

beb wrote: 2026-05-09, 14:20 UTC Even if I felt that [%WL] in [Filter2_beb=***em_beb %WL] was a bit off, I couldn't process the new information properly, leaving that for the day.
And with the current update from you, I just removed [%WL] from the associations, and it works great:

Code: Select all

[em_beb]
cmd=pwsh -c "%beb%\beb.ps1"
param=%WL

[Associations]
Filter2=*.beb
Filter2_beb=***em_beb
Thank you a lot!
white wrote: 2026-05-09, 10:03 UTC Since you do nothing with the parameter, you could have done something like this:

Code: Select all

Filter2_beb=***em_beb BEB (*.BEB)
Honestly, I didn't understand that part. %WL is a protagonist of the story, and the command/script definitely uses/relies on it.
Yeah, I made a mistake. I should have given these examples:

Only use passed parameter 9 for the powershell command:

Code: Select all

[em_beb]
cmd=pwsh -c "%beb%\beb.ps1"
param=%WL%A9

[Associations]
Filter2=*.beb
Filter2_beb=***em_beb BEB (*.BEB)
Replace the parameter field for the powershell command with passed parameters (the literal text "%WL"):

Code: Select all

[em_beb]
cmd=pwsh -c "%beb%\beb.ps1"
param=BEB (*.BEB)

[Associations]
Filter2=*.beb
Filter2_beb=***em_beb %WL
Information:
HISTORY.TXT wrote: 14.05.23 Added: Internal commands which do not start with cm_ or em_ now support placeholders like %P%N in internal associations and user-defined hotkeys, e.g. OPENBARMENU (32/64)
So for for em_ commands placeholders are not supported and just passed as text.
But then:
[Help - Dialog box: Configuration - Change button bar] wrote: Commands with prefix em_ handle parameters in a special way: When not using the "Parameters" field, the parameters behind the command name are passed unchanged to the inner command and then parsed, e.g. em_notepad %P%N (defined as notepad.exe) will be handled as Command: notepad.exe, Parameters: %P%N.
But this is not the case when the Paramaters field of the em_ command contains %A placeholders.

Example:

Code: Select all

[em_beb]
cmd=cmd.exe /k echo
param=Passed parameter: %A1

[Associations]
Filter2=*.beb
Filter2_beb=***em_beb %WL
Result on screen:
Passed parameter: %WL
User avatar
beb
Power Member
Power Member
Posts: 729
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Inconsistency in internal associations context menu: an extra space between the entry name and the (Internal) text

Post by *beb »

2white
Thank you for the explanation and examples!

Note.
Since it looks like no one is bothered by the extra space in the context menu but me, this topic becomes an alien in the bugs forum.
At the same time, thanks to the white's detailed instructions, it can be pretty useful for users exploring the internal association methods.
Therefore, please move the topic to the English forum.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52918
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Inconsistency in internal associations context menu: an extra space between the entry name and the (Internal) text

Post by *ghisler(Author) »

I have checked the sources - Total Commander intentionally adds TWO spaces before the string "(internal)"! It does this always, even if the description doesn't end with ' '.
I think I did this to make sure that the user clearly sees that the "(internal)" string isn't part of the internal association description itself, but gives a hint that it's an internal association and not coming from Windows. This also makes it easier to read when setting the option "Load extra commands from all matching types", where you get the wildcards of the matching type instead, e.g.
Open in something ' ' (*.*)
Do you think that it should be changed to only one space?
Author of Total Commander
https://www.ghisler.com
Post Reply