-
-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Is there an existing issue for this?
- I have searched the existing issues
Midnight Commander version and build configuration
GNU Midnight Commander 4.8.33
Built with GLib 2.84.4
Built with S-Lang 2.3.3 with terminfo database
Built with libssh2 1.11.1
With builtin editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, shell
Data types:
char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64; uintmax_t: 64;Operating system
Linux 6.12.48-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri, 19 Sep 2025 16:11:04 +0000 x86_64 GNU/LinuxIs this issue reproducible using the latest version of Midnight Commander?
- I confirm the issue is still reproducible with the latest version of Midnight Commander
How to reproduce
❯ lsb_release -a
LSB Version: n/a
Distributor ID: ManjaroLinux
Description: Manjaro Linux
Release: 25.0.9
Codename: Zetar
❯ which file
/usr/bin/file
❯ file --version
file-5.46
magic file from /usr/share/file/misc/magic
seccomp support included
❯ file /tmp/test.jar
/tmp/test.jar: Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified, last modified Sun, Nov 06 2025 13:31:44, uncompressed size 0, method=deflate
In this case the file command from Manjaro reports .jar files as Zip, the current regex will not match.
Disclaimer: My mc installation is with Nix package manager, paths below will reflect that.
For .zip files, we currently have in mc.ext.ini.in:
# line 889
[zip-by-shell]
Shell=.zip
ShellIgnoreCase=true
Open=%cd %p/uzip://
View=%view{ascii} /nix/store/hirfvp1frhsmfsx49p0y6ak5xl94gnxf-mc-4.8.33/libexec/mc/ext.d/archive.sh view zip
# line 1125
[zip-by-type]
Type=\\(Zip archive
Open=%cd %p/uzip://
View=%view{ascii} /nix/store/hirfvp1frhsmfsx49p0y6ak5xl94gnxf-mc-4.8.33/libexec/mc/ext.d/archive.sh view zip
But for .jar files we only have the following, which does not match with the file output that Manjaro Linux reports (see above):
[jar]
Type=\\(Java (Jar file|archive) data \\((zip|JAR)\\)\\)
TypeIgnoreCase=true
Open=%cd %p/uzip://
View=%view{ascii} /nix/store/hirfvp1frhsmfsx49p0y6ak5xl94gnxf-mc-4.8.33/libexec/mc/ext.d/archive.sh view zip
file seems to behave inconsistently between distributions, and we may need to fall back to file extension, creating a handler like [jar-by-shell] - and the same thing for .war files as already uncovered here.
Extra:
I also realized that for some reason, in my case, the [zip-by-type] does not match .zip files either, and the one effectively used is [zip-by-shell] in line 889. To test this I commented .zip handlers (one each time) and the only one that works in my case is zip-by-shell.
Expected behavior
The contents of the compressed .jar files are opened likewise to .zip files.
Actual behavior
JAR files cannot be opened or inspected. They contain source code that can be directly browsed within Midnight Commander, but this is not possible at least in Manjaro Linux due file command output.
Additional context
No response