shell-x
shell-x copied to clipboard
Is it possible to implement context menu for the same type of files?
For example, if you configure an [Image] folder, you can use the context menu as long as it is an image format file.
Or can a folder support multiple suffixes at the same time? For example, if you configure the "jpg/tif/png" folder, files in *.jpg *.tif *.png format can use the context menu.
Yes, it is possible already.
You just need to name the folder containing the handler for your image files with a special name that indicates all the extensions the image file can have. In your case, the folder name should be [jpg,tif,png]
.
Apologies for not reflecting it in the documentation. I just overlooked it when was preparing the documentation. Addressed now: https://github.com/oleg-shilo/shell-x/tree/master?tab=readme-ov-file#how-it-works
I tried setting the folder name to [jpg,tif,png] but this resulted in the context menu being available for all files.
Let me check.
No, it's not what I observe if I use a standard config folder (just initialized during the install). A
I assume when you say "all files", you mean "any file" not "all image files". Am I right
You can share your config folder content here and I can repeat a local test.
Your understanding is correct, but I didn't express it clearly. I have now configured a folder named [jpg, tif, png], but this folder has the same effect as the [file] folder, allowing any file to use the context menu.
I found the problem, I reinstalled shell-x and restarted the explorer, and now it works normally. Thanks for your reply.
At the same time, I discovered a bug, that is, when setting the folder name to [png], the context menu does not take effect for files with the suffix ".PNG". You need to configure a name in uppercase format at the same time, such as [png, PNG] for normal use.
Thank you. I will lcheck.
Ah, I see the problem.
For a single file extension, you need to use the file extension as is:
txt
file extension => txt
folder name
txt
and md
file extensions => [txt,md]
folder name
The only allowed content between square brackets is: any
, folder
and comma-delimited list of multiple files.
Thus in your case you need to name your folder png
not [png]
. And adding extra extension as you did solve the problem for you. [png,png]
would also do the trick.
Nevertheless, I will consider allowing a single extension in square brackets option in the next release.
To make it easier I have added the corresponding section to the CLI help and this site readme (https://github.com/oleg-shilo/shell-x/blob/master/README.md#naming-convention)
Sorry, I couldn't express myself clearly, So I made two images. My computer seems to be case sensitive about file extension.
Picture 1: When I configure the [txt,jpg] folder, the context menu cannot be used for files with the suffix ".TXT".
Picture 2: I have to configure the [txt, jpg, TXT] folder so that files with the ".TXT" suffix can use the context menu normally.
I tested it in Windows 11 and it works, but not in Windows 10.
You are right. Indeed somehow it is case-sensitive. It's not your computer problem but the problem with the way [txt,jpg]
is handled. It works correctly for both upper and lower case extensions if the config folder is for one extension only - txt
. But becomes case sensitive for config folders for multiple extensions like yours [txt,jpg]
. There is a mistake somewhere in my code.
I will start working on it right away.
Thank you for reporting it.
Done. Release can be found here: https://github.com/oleg-shilo/shell-x/releases/tag/v1.5.6.0
It will take a little time before it hits Chocolatey