[SOLVED] mc not opening html files ? (black screen)
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, both Slackware systems I tested on are full installs without the KDE&KDEI package series. Maybe it's in some of these packages where you get a system wide default mime.types
Well, I don't know then. It works for me, possibly because I already have the necessary mime.types file on my system. I don't think that disabling xdg-open completely is the right fix. Maybe fora user who doesn't want to bother with it, but not for upstream. If they did want to do away with xdg-open, the right way to do it would be to remove it from the libexec scripts.
You need to integrate xdg-utils (xdg-open included) properly and I agree with you on this. Apparently it's not and I don't know who can do it (who "they" could be). I don't have the knowledge/patience/interest to put up with freedesktop.org and I don't understand why xdg-open is needed for a text console file manager, why would you need X support for such an application and BTW, since when is konqueror the default web browser in Slackware?
You need to integrate xdg-utils (xdg-open included) properly and I agree with you on this. Apparently it's not and I don't know who can do it (who "they" could be). I don't have the knowledge/patience/interest to put up with freedesktop.org and I don't understand why xdg-open is needed for a text console file manager, why would you need X support for such an application and BTW, since when is konqueror the default web browser in Slackware?
A lot of people, myself included, use it commonly within an X session. If you look at the scripts, it's supposed to skip the xdg-open stuff if $DISPLAY is not set, like would be the case in a non-X session (I think). As an aside, I use it at work too, on Red Hat with Gnome, and it works correctly with xdg-open there too. I think maybe there's only a problem if you are running within an X session with xdg-open present but not configured. Maybe there needs to be some better error checking, either in xdg-open or the mc libexec scripts, to detect when xdg-open is not able to find an application to open the file.
A lot of people, myself included, use it commonly within an X session. If you look at the scripts, it's supposed to skip the xdg-open stuff if $DISPLAY is not set, like would be the case in a non-X session (I think). As an aside, I use it at work too, on Red Hat with Gnome, and it works correctly with xdg-open there too. I think maybe there's only a problem if you are running within an X session with xdg-open present but not configured. Maybe there needs to be some better error checking, either in xdg-open or the mc libexec scripts, to detect when xdg-open is not able to find an application to open the file.
I don't want to disagree with you about "a lot of people", but when I see that statement I always ask myself how many?
Now, leaving jokes aside, you can check in other distros, as you said you use, what environmental settings are configured for helping xdg-uils. Don't enter X, just use console and check if mc is doing fine there.
I'm not interested in spending (wasting) time on most of freedesktop.org projects because I'm looking for a finality in my approaches/interests and these projects are far from being well designed and documented. Just for a check, I did run a man xdg-open:
Code:
xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root.
All my questions are answered now, xdg-open has no place in console mode and especially bundled with mc, which "a lot of people" are using as root.
I don't want to disagree with you about "a lot of people", but when I see that statement I always ask myself how many?
Now, leaving jokes aside, you can check in other distros, as you said you use, what environmental settings are configured for helping xdg-uils. Don't enter X, just use console and check if mc is doing fine there.
I'm not interested in spending (wasting) time on most of freedesktop.org projects because I'm looking for a finality in my approaches/interests and these projects are far from being well designed and documented. Just for a check, I did run a man xdg-open:
Code:
xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root.
All my questions are answered now, xdg-open has no place in console mode and especially bundled with mc, which "a lot of people" are using as root.
Not to come across as rude, but this isn't really the place for this discussion. You would have to take it up with the Midnight Commander developers. I don't really care either way.
Not to come across as rude, but this isn't really the place for this discussion. You would have to take it up with the Midnight Commander developers. I don't really care either way.
Nothing to be rude about here. It is the place for the discussion, because it's here I provided a very simple fix and suggested to andrixnet to ask for a change request to ditch that xdg-open from mc, if he feels so, and you opposed. Nothing to discuss with the MC developers either, they did discuss this rather uninspired modification (development driven by boredom - as I call it) in this ticket: https://midnight-commander.org/ticket/2118
As a Slacker, I believe that Slackware took all these Midnight Commander modifications from upstream and ended up now with a faulty mc. I also believe that there are plenty of graphical file managers under X and mc should be and stay functional in console mode.
Nothing to be rude about here. It is the place for the discussion, because it's here I provided a very simple fix and suggested to andrixnet to ask for a change request to ditch that xdg-open from mc, if he feels so, and you opposed. Nothing to discuss with the MC developers either, they did discuss this rather uninspired modification (development driven by boredom - as I call it) in this ticket: https://midnight-commander.org/ticket/2118
As a Slacker, I believe that Slackware took all these Midnight Commander modifications from upstream and ended up now with a faulty mc. I also believe that there are plenty of graphical file managers under X and mc should be and stay functional in console mode.
Having looked at this yesterday, my memory was apparently faulty. I thought I had seen that mc was doing some sort of checking to see if the $DISPLAY environment variable was set, and only running xdg-open if it was. If that were the case, it would in theory work correctly for both graphical and console sessions. Looking back into the mc libexec scripts again, I can see that this is not the case. So I'm going to change my mind and agree with you that the implementation is broken for console sessions. Someone can bring it up in the Requests for -current thread, but I still think that it would be better to report it upstream.
A quick test confirms that this change works to skip xdg-open in console sessions without disabling it in graphical sessions:
Similar changes would have to be made to all the other scripts in /usr/libexec/mc/ext.d. I think this is a much better general solution than disabling xdg-open altogether.
I was also considering such a conditional check, but not confident enough that by only verifying if $DISPLAY is not null will suffice to know if I'm in text console or under X, and if xdg-open is only needing X to be launched.
However, again, I can't follow you with your approach in modifying 9 files instead of only adding the conditional check to the already existing "general" mc wrapper. I tested the following modifications and mc is now happy on both console, not using xdg-open, and X, using xdg-open. While modifying the wrappers I mistakenly disabled xdg-open under X and noticed that konqueror (yes, I installed KDE )was still launched from within /usr/libexec/mc/ext.d/web.sh, which led me to ask myself what's the purpose of xdg-open at all ?
Anyways, here are the tested patches for the mc wrappers found in /usr/share/mc/bin :
However, again, I can't follow you with your approach in modifying 9 files instead of only adding the conditional check to the already existing "general" mc wrapper.
Because it is the scripts that are broken, and therefore it is the scripts that need to be fixed. Changing the wrapper is perfectly fine as a workaround, but it is not a fix. Not everyone uses the wrapper anyway; if you just install Midnight Commander and type 'mc,' the wrapper is not invoked. You have to manually set up an alias to use it.
My responses are in the context of reporting this upstream, and what approach I would recommend to fix the issue. Making the same modification to 9 files is trivially easy.
Last edited by montagdude; 09-29-2018 at 07:40 PM.
Not everyone uses the wrapper anyway; if you just install Midnight Commander and type 'mc,' the wrapper is not invoked. You have to manually set up an alias to use it.
Sorry, I only care about Slackware and the wrapper together with the alias (/etc/profile.d/mc.(c)sh) are part of the mc package that everyone on Slackware uses. Check for yourself: https://mirror.de.leaseweb.net/slack...6-x86_64-2.txz
Quote:
Originally Posted by montagdude
My responses are in the context of reporting this upstream, and what approach I would recommend to fix the issue. Making the same modification to 9 files is trivially easy.
If you need my support, please ask them first if they still want to keep mc as a console file manager, if positive, send them my appreciations and ask them on my behalf to shove xdg-open up their arses. Nothing personal, just technical.
Last edited by abga; 09-29-2018 at 08:38 PM.
Reason: typo
What are the steps to integrate this upstream?
And by that I mean at least in Slackware as distro?
AFAIK, there are no official steps to report a bug, but only to raise/resolve/discuss it here in the forum.
In one of my previous posts I advised you to post a change request in the request-for-current thread, at least for -current: https://www.linuxquestions.org/quest...-a-4175620463/
With the latest developments, point it to my post #23, where I presented the patches for the mc-wrappers. I tested those patches, and mc is happy now in both Slackware 14.2 stable & current, checking before launching xdg-open, if it's executed in a text console & under X, individually and in parallel. The only issue I encountered was patching the csh script, as I'm not savvy with csh and didn't know how to handle the situation in which $DISPLAY is not defined at all, thus the nested if statements, but it's working fine.
This problem also affects the Slackware stable release and I hope Patrick has seen this thread, it was in the top of the threads list for some days due to my exchange with montagdude, and maybe considering to patch the stable too.
Even if montagdude is pursuing a bug report/resolution with the Midnight Commander devs to patch all their handlers in /usr/libexec/mc/ext.d/, not sure if it'll ever materialize, I believe Slackware should handle this issue on its own.
Last edited by abga; 10-02-2018 at 02:31 PM.
Reason: chs=csh +h
Even if montagdude is pursuing a bug report/resolution with the Midnight Commander devs to patch all their handlers in /usr/libexec/mc/ext.d/, not sure if it'll ever materialize, I believe Slackware should handle this issue on its own.
I should, but it's not high on my list of things to do. I will try to get to it sometime, but report away on the Requests for -current thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.