mc problem under root shell in X
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:
|
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:
Code:
diff user_environment root_environment |
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. |
what shell? bash? Do you have a .bashrc in /root?
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?
|
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. Seems that this has been a source of friction in the past. https://www.midnight-commander.org/ticket/2150 |
Quote:
. |
Quote:
Quote:
|
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 Code:
rxvt -name $TARGET -ls -sb -sl 1500 -font 6x13 -T $WERBINICH@$TARGET -e ssh -l $WERBINICH -X -C $TARGET & 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 |
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.
|
Why not use *kdesu* instead ?
Code:
$ kdesu Terminal &>/dev/null & |
All times are GMT -5. The time now is 12:04 AM. |