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.
I am experiencing an annoyance with Midnight Commander (mc) when run under a root shell in X. (By root shell, I mean opening a terminal and typing 'su -l'.) The issue is that Ctrl+Enter does not put the highlighted item's text onto the command line like it should. It does work correctly under a normal user shell, and it also works under a root shell from a console login, just not under X. It also works if I get a root shell using 'su -lm', but I prefer not to do that. However, this suggests to me that it must be an issue with the environment, but I'm not sure what aspect of the environment I should be checking.
Some more info off the top of my head:
The $TERM variable is the same for both the user and root shell (xterm).
Running mc -V gives the same output under both the user and root shell.
I tried copying the user mc config files to root's mc config directory, but it didn't fix it.
Using Xfce DE, Slackware64 14.2 multilib, in 'su -' or su-l' root shell:
Unconfirmed: Ctrl-Enter Works as expected Xfce's Terminal, set to xterm emulation
Unconfirmed: Ctrl-Enter Works as expected xterm
Unconfirmed: Ctrl-Enter Works as expected rvxt
(I would have tried a few more, but I can't seem to remember how many terminal emulators in in Slackware!)
Perhaps some added details as to which DE/WM (as I doubt you are using bare X) and terminal emulator you are using would help us narror down the issue? Also: wversion of Slackware (full or customer install)?
I'm using Slackware64 14.2, full install except for xfce, most of xap, and some games in kde. For DEs I've tried KDE and Lumina, terminal emulators qterminal, konsole, xterm, and rxvt, and this same behavior happens in all of them. If this helps, here are the differences between printenv run as user and root. Nothing really stuck out to me, but maybe it will to someone else:
I guess if nobody knows of the top of their head, I can go through them one-by-one to find the culprit. Maybe running printenv from an su -l login in console mode (since it works there) would be enlightening as well.
Last edited by montagdude; 08-20-2016 at 10:13 PM.
Alright, well I found out that setting the $HOME environment variable for root to the user's home directory fixes the problem, but I don't want to do that. That seems to be the same reason why it works with 'su -lm'. I also tried looking at the differences between printenv run by root in console mode and under X, and there were only two of them: $TERM and $DISPLAY. Unfortunately, changing those variables to the ones from console mode didn't help. So now I'm out of ideas.
FYI, I can work around it by using Esc+Enter instead of Ctrl+Enter, but I'd still like to know what the problem is.
I just tried mc in 'su -l' bash konsole shell in KDE (full 14.2 qemu VM), and Ctrl-Enter works as expected. I not sure, but I don't think its your env.
I use bash. I don't have a .bashrc in /root, but I do have a bash_profile, which is almost the same as the .bashrc in my user $HOME directory. I just tried temporarily renaming /root/bash_profile, and the problem remained. I think you are right that it is something other than the environment, but I'm not sure what.
Then we are both stumped. The man page does state that ALT-ENTER and CTRL-ENTER are the same and that CTRL-ENTER may not work in some cases. Why it works Ok here and not on yours is a mystery. Maybe try a clean full install in VM?
Last edited by kingbeowulf; 08-20-2016 at 11:00 PM.
Reason: spelling
I find "Ctrl-Enter" as documented:
- Works for normal user in shell without X.
- Works for normal user in terminal emulator under X
- Works for root in shell without X.
- Works for root in terminal emulator under X when started with 'su -m'.
- Does not work for root in terminal emulator under X when started with 'su -' or 'su -l'. 'Ctrl-x t' works as an equivalent.
I find "Ctrl-Enter" as documented:
- Works for normal user in shell without X.
- Works for normal user in terminal emulator under X
- Works for root in shell without X.
- Works for root in terminal emulator under X when started with 'su -m'.
- Does not work for root in terminal emulator under X when started with 'su -' or 'su -l'. 'Ctrl-x t' works as an equivalent.
Distribution: slackware x86_64 , arm , slackware , AlmaLinux
Posts: 83
Rep:
what about the sourcing of the ".Xdefaults" in the root directory ... if there is one ?
i have had some "hard to find" problems with that if these files are different ...
the other way could be to use slogin to become a real root with all its inbuild or sourced shell varibles ...
since slogin is gone - you now could use someting like this for remote and local login shells
where $TARGET is the TARGET system - local or remote - i set this in a script
where $WERBINICH is the loginname - one may get it from whoami or from command line variable in an script
i dont ever use the cli in mc so i can't tell you if it helps to your problem .... sorry
Last edited by Wiser Slacker; 08-24-2016 at 01:09 PM.
Well, I never figured out what the problem was, but I recently reinstalled Slackware because of an error I made (here), and now the problem with mc as root is gone. So I'll mark this as solved. Sorry to anyone reading this with the same problem that I never figured out the cause.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.