# Midnight Commander MC



## Terpentijn (Aug 27, 2019)

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:

```
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?


----------



## SirDice (Aug 28, 2019)

Which shell does the user account have?


----------



## Terpentijn (Aug 28, 2019)

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.


----------



## iSiek (Aug 28, 2019)

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`


```
-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


----------



## SirDice (Aug 28, 2019)

Terpentijn said:


> came to the conclusion that ‘sh’ in fact is very outdated.


It's not 'outdated'. It's spartan for interactive use, yes. But it's definitely not outdated. 



> In my opinion it would be a good thing if FreeBSD would ship with bash as the default shell.


Can't. Bash is GPL and cannot be added to the base OS.


----------



## iSiek (Aug 28, 2019)

`pkg info mc`

gives the output:


```
$ 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.


----------



## T-Daemon (Aug 28, 2019)

iSiek said:


> 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.


No need to, misc/mc uses specific subshells, which doesn't include sh. Link


----------



## ShelLuser (Aug 28, 2019)

Terpentijn said:


> 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.


----------



## Terpentijn (Aug 28, 2019)

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.


----------



## Sergei_Shablovsky (May 27, 2022)

ShelLuser said:


> 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...


----------



## Peter2121 (Jun 18, 2022)

Sergei_Shablovsky said:


> 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.


Almost perfect choice, but... Replace nano with micro - and it will be _really_ perfect!


----------



## Menelkir (Jun 19, 2022)

SirDice said:


> Can't. Bash is GPL and cannot be added to the base OS.


I would be really happy with shells/mksh instead.


----------



## Sergei_Shablovsky (Jun 29, 2022)

Peter2121 said:


> 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”...


----------



## Peter2121 (Jun 30, 2022)

Sergei_Shablovsky said:


> 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`


----------



## Sergei_Shablovsky (Jun 30, 2022)

Peter2121 said:


> - 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*.



Peter2121 said:


> - 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*?



Peter2121 said:


> - No dependencies, one executable file


----------



## Sergei_Shablovsky (Jul 1, 2022)

Peter2121 said:


> - 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


----------

