Midnight Commander MC

I have a weird problem with mc. I installed it normal with “pkg install mc”. It runs fine, but only in the root account (!)
As a normal user I get the following error message:
Code:
common.c: unimplemented subshell type 1
read (subshell_pty...): No error: 0 (0)
I run FreeBSD 12-RELEASE
I have never seen this before on any Linux machine. When I run “sudo mc” it works, but I want to run it as a normal user too, without root privileges.

Any ideas how I can solve this problem?
 
The user has the standard sh shell. I searched the forums (I know, I should have done that in the first place, sorry) and found out that the somewhat outdated sh shell is the culprit. I changed my user account to bash with chpass -s /usr/local/bin/bash dick and the problem is solved. At the same time i looked up a lot of information on all the different shells out there and came to the conclusion that ‘sh’ in fact is very outdated. In my opinion it would be a good thing if FreeBSD would ship with bash as the default shell. I have no idea why they hang on to this very old shell.
 
I have also installed misc/mc from packages on my desktop and have the same issue.
But when you run it with -u switch, it is working fine with current user.

mc -u

Code:
-u, --nosubshell
Disable use of the concurrent shell (only makes sense if
Midnight Commander has been built with concurrent shell
support).

looks like it was compiled with such option into package binary and causes issues when starting up on regular user.

Regards,
Krzysztof
 
pkg info mc

gives the output:

Code:
$ pkg info mc
mc-4.8.22_1
Name           : mc
Version        : 4.8.22_1
Installed on   : Sun Apr 14 14:13:22 2019 CEST
Origin         : misc/mc
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : misc shells
Licenses       : GPLv3+
Maintainer     : woodsb02@FreeBSD.org
WWW            : https://midnight-commander.org/
Comment        : Midnight Commander, a free Norton Commander Clone
Options        :
DOCS           : on
EDITOR         : on
ICONV          : on
NCURSES        : off
NLS            : on
SFTP           : on
SLANG          : on
SMB            : on
SUBSHELL       : on
X11            : on

so yes, it is compiled with subshell option by default.

SUBSHELL : on

I do not have access to old FreeBSD versions now, but I will check that later if this is the case on them too.
 
At the same time i looked up a lot of information on all the different shells out there and came to the conclusion that ‘sh’ in fact is very outdated.
Seriously not the case, I'm pretty much using this on a daily basis (through self-made shell scripts) and there's nothing that I can't do with it. Don't forget that most of the work you do is powered by external commands anyway... ls, date, cp? The shell doesn't have to do that much and /bin/sh supports all the basic features.

Another aspect: size. 164k (sh) vs. 1.1Mb (!) (bash). That's plain out bloated from a scripting point of view. Especially if you take into consideration that /bin/csh which is much more interactive than sh is a meagre 414k.

Sure, personal taste is just that but I'd rather have a shell of which I use more than half of its features than having a shell which can do a ton of stuff but I only end up using 20% or so of that. But that's personal preference obviously.
 
Put it this way, you’re absolutely right. I also like minimal, so i changed my user shell back to the default ‘sh’. I run mc with the -u option and it works just fine.
 
Sure, personal taste is just that but I'd rather have a shell of which I use more than half of its features than having a shell which can do a ton of stuff but I only end up using 20% or so of that. But that's personal preference obviously.
In 2022 shells/zsh (+ shells/zsh-autosuggestions, shells/zsh-syntax-highlighting, shells/ohmyzsh) in conjunction with misc/mc and editors/nano pretending to be great toolset.

looks like more flexible, powerful, easy to switch on, and with a ton of features if You wish...
 
Almost perfect choice, but... Replace nano with micro - and it will be really perfect! ;)
Thank You!

Micro looks great. ;) Could You be so please to take a little time to describe main advantages of micro vs nano ?

Thank You again !

P.S. Hm... For some unknown reason “pkg install micro” or “pkg install editors/micro”, even “pkg install micro-2.0.10_2” not working, - exit with:
The most recent versions of packages are already installed
BUT nothing really by “pkg info micro” or “pkg info | grep editor”...
 
Could You be so please to take a little time to describe main advantages of micro vs nano ?

- The hotkeys are more intuitive for me, they are the same as those in mcedit with additional 'traditional' Ctrl-C, Ctrl-V, Ctrl-X, Ctrl-Z...
- Syntax highlighting
- No dependencies, one executable file

As about install - search for the executable micro in /usr/local/bin. To check if the package is installed - pkg info | grep micro
 
- The hotkeys are more intuitive for me, they are the same as those in mcedit with additional 'traditional' Ctrl-C, Ctrl-V, Ctrl-X, Ctrl-Z...
Thank You!
The same for me. Speed up any work. And BIG advantage that learning new hotkeys (from macOS) not needed.

- Syntax highlighting
The same as above.

In addition to what a You wrote, in my needs:
- screen split between 2-4 files or the parts of same code file
- spellcheck for most common languages & config file formats
- useful find/replace and copy/paste
- useful comment/uncomment for blocks of code
- several clipboards
- cursor position, file coding format (ascii, utf-8, etc...)

For remote work I use iTerm2 + code snippets library tool (with tagging system, search and embedded languages documentation library) and this is excellent pair of tool.

So I just try to upgrade from bundle nano + zsh to more advanced with a lot of useful features bundle.

Is zsh + micro (with plugins) - best choice for working with local console?

- No dependencies, one executable file
 
- The hotkeys are more intuitive for me, they are the same as those in mcedit with additional 'traditional' Ctrl-C, Ctrl-V, Ctrl-X, Ctrl-Z...
- Syntax highlighting
- No dependencies, one executable file

As about install - search for the executable micro in /usr/local/bin. To check if the package is installed - pkg info | grep micro
Also I find that
- filemanager plugin (
View: https://youtu.be/rgPS8U4puXY);

- vertical/horizontal screen splitting are just wonderful;)
 
Back
Top