Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Midnight Commander fails to respect changes it makes to .config/mc/mc.ext.ini #22943

Open
foo4thought opened this issue Jan 16, 2025 · 2 comments
Labels
bug report Something is not working properly untriaged

Comments

@foo4thought
Copy link

Problem description

mods made by user in the application to handle its actions for "View" and "Open" based on file extensions are not respected by the application.
Research of bug reports for midnight commander show that this kind of thing has been addressed before, and is related to its genesis when compiled with older GLib libraries.
For comparison, mc performs properly on another host (Mac); differences of note:

  • works: GNU Midnight Commander 4.8.32 Built with GLib 2.82.4
  • fails: same version, Built with GLib 2.80.4

What steps will reproduce the bug?

Modify extension file like this:

[Include/image]
Open=(/data/data/com.termux/files/usr/bin/gimp %s)
View=(/data/data/com.termux/files/usr/bin/feh %s)
# Open=/data/data/com.termux/files/usr/libexec/mc/ext.d/image.sh open ALL_FORMATS
# View=%view{ascii} /data/data/com.termux/files/usr/libexec/mc/ext.d/image.sh view ALL_FORMATS

Select PNG file in mc and press [enter] or F3 to produce a screen full of lucky charms in vi instead of a nice image in feh

What is the expected behavior?

Modify extension file to handle PNG (and all extensions declared as image) with external program feh
Select PNG file in mc and press [enter] or F3 to produce of a nice image in a window produced by feh

System information

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=1220
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
x86_64
Subscribed repositories:
# sources.list
deb https://mirror.mwt.me/termux/main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://mirror.mwt.me/termux/x11 x11 main
Updatable packages:
firefox/x11 134.0.1-1 x86_64 [upgradable from: 134.0.1]
libsoup3/stable 3.6.3 x86_64 [upgradable from: 3.6.1]
termux-tools version:
1.44.6
Android version:
13
Kernel build information:
Linux localhost 5.10.223-997504-ga008d597f5eb #1 SMP PREEMPT Wed, 9 Oct 2024 16:18:23 +0900 x86_64 Android
Device manufacturer:
Google
Device model:
zork
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.boot versionCode:1000
com.termux.x11 versionCode:15
com.termux.api versionCode:51
@fornwall
Copy link
Member

The mc package was just rebuilt with version 4.8.32-1 - does that fix the problem if you update to it with pkg up?

@foo4thought
Copy link
Author

The mc package was just rebuilt with version 4.8.32-1 - does that fix the problem if you update to it with pkg up?

Thank you for trying that; but view & open actions for files, based on filename extensions, remain broken. It's so weird that it works okay on my Mac (installed via brew)

There was another "fix" for this misbehavior posted on the midnight commander dev boards; it did not work and still does not help to escape each backslash on lines like this:
Regex=\\.(rexx?|cmd)$
to become
Regex=\\\\.(rexx?|cmd)$

Given that, plus another issue (typographical error "Ciew") cited with the file 'mc.ext.ini' - supposedly fixed in subsequent releases, yet still present, I wonder about their versioning/QA process over there...

Line 420:
Ciew=%view{ascii} /data/data/com.termux/files/usr/libexec/mc/ext.d/package.sh view deba

mc --version
GNU Midnight Commander 4.8.32
Built with GLib 2.82.4
Built with ncurses 6.5
Built with libssh2 1.11.1
With builtin editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With multiple codepages 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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly untriaged
Projects
None yet
Development

No branches or pull requests

2 participants