LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-20-2016, 09:13 PM   #1
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
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:
  • 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.
Any ideas?
 
Old 08-20-2016, 09:49 PM   #2
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,262
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
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)?
 
Old 08-20-2016, 10:05 PM   #3
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Original Poster
Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
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 
2a3
> HZ=100
4,5d4
< DM_CONTROL=/var/run/xdmctl
< XDG_DATA_HOME=/home/dan/.local/share
8,11d6
< XDG_SESSION_COOKIE=Thinkpad-T430-1471748202.976540-1396038595
< XDM_MANAGED=method=classic
< WINDOWID=33554434
< OLDPWD=/home/dan
14,15c9,10
< USER=dan
< LS_COLORS=<snip>
---
> USER=root
> LS_COLORS=<snip>
21,22c16,17
< DESKTOP_SESSION=Lumina
< PATH=/usr/local/krb5/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/kde4/libexec:/usr/lib64/qt/bin:/usr/lib64/qt5/bin
---
> MAIL=/var/spool/mail/root
> PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/kde4/libexec:/usr/lib64/qt/bin:/usr/lib64/qt5/bin
25c20
< PWD=/home/dan/Desktop
---
> PWD=/root
29d23
< KDEDIRS=/usr
31,35c25,29
< HOME=/home/dan
< COLORFGBG=15;0
< SHLVL=2
< XDG_CONFIG_HOME=/home/dan/.config
< LANGUAGE=
---
> KDEDIRS=/usr
> PS1=\u@\h:\w\$ 
> PS2=> 
> SHLVL=1
> HOME=/root
37,38d30
< XDG_CACHE_HOME=/home/dan/.cache
< PYTHONPATH=/home/dan/python_tools/lib:
40,41c32
< LOGNAME=dan
< XDG_DATA_DIRS=/usr/local/share:/usr/share
---
> LOGNAME=root
44d34
< WINDOWPATH=7
46d35
< XDG_CURRENT_DESKTOP=Lumina
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.
 
Old 08-20-2016, 10:33 PM   #4
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Original Poster
Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
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.
 
Old 08-20-2016, 10:47 PM   #5
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,262
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
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.
 
Old 08-20-2016, 10:50 PM   #6
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Original Poster
Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
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.
 
Old 08-20-2016, 10:59 PM   #7
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,262
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
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
 
Old 08-21-2016, 08:33 AM   #8
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,357

Rep: Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739
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
 
Old 08-21-2016, 09:16 AM   #9
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 1,253

Rep: Reputation: 220Reputation: 220Reputation: 220
Quote:
Originally Posted by montagdude View Post
I'm using Slackware64 14.2, full install except for xfce, most of xap, and some games in kde.
Are you using mc included in Slackware, or a newer one compiled by you ?

.
 
Old 08-21-2016, 12:25 PM   #10
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Original Poster
Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by allend View Post
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
Sounds like the same behavior as me then.

Quote:
Originally Posted by zk1234 View Post
Are you using mc included in Slackware, or a newer one compiled by you ?

.
I'm using the version included in Slackware.
 
Old 08-24-2016, 01:07 PM   #11
Wiser Slacker
Member
 
Registered: May 2014
Location: germany
Distribution: slackware x86_64 , arm , slackware , AlmaLinux
Posts: 83

Rep: Reputation: Disabled
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 $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.
 
Old 02-09-2017, 08:22 AM   #12
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Original Poster
Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
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.
 
Old 02-09-2017, 09:23 AM   #13
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
Why not use *kdesu* instead ?
Code:
$ kdesu Terminal &>/dev/null &
(Or make a shortcut)...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Problem Solved] Accidentally changed root user to nonexistent shell and more and more acetonitrile Debian 3 11-09-2011 02:55 PM
[SOLVED] emDebian on mini2440 + problem to get a root shell jerem02 Linux - Embedded & Single-board computer 16 03-28-2011 05:54 AM
How to run a shell script as root (when user is not root) taylorkh Linux - Newbie 10 09-12-2008 06:05 PM
How to run root privileged Linux command as normal user via shell shell tcegrid Linux - Newbie 1 06-23-2008 03:38 PM
Problem with root shell automata Linux - General 17 07-09-2007 01:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration