# Midnight Commander not working



## proton1234 (Jul 1, 2021)

11.4-RELEASE-p12

mc 4.8.26_2 installed via

```
pkg install mc
```


I don't know when it happened or after what but MC always was Ok and stable.

But now first time I lauch it is Ok but if I quit from it by pressing F10 and try to run it again from cli I get an error shown on mc-1.png and if I click mouse buttons I got some symbols in command line as in mc-2.png until I press "Control + C".

reinstalling MC via ports ends with same result

```
cd /usr/ports/misc/mc && make && make install
```

Any suggestions? Putty is used as a terminal.


----------



## Alain De Vos (Jul 1, 2021)

What if you install it from the packages.
pkg install mc


----------



## proton1234 (Jul 1, 2021)

Alain De Vos said:


> What if you install it from the packages.
> pkg install mc


same result

reinstalling glib has no effect

seems like the only way to make it working is run with -u key that means no subshell

```
#>mc -u
```


----------



## Menelkir (Jul 1, 2021)

proton1234 said:


> same result
> 
> reinstalling glib has no effect
> 
> ...


What shell are you using when you got this error? Do you have the same error with tcsh or bash?


----------



## proton1234 (Jul 1, 2021)

Menelkir said:


> What shell are you using when you got this error? Do you have the same error with tcsh or bash?


\bin\sh

and

```
#>bash
#>mc
```
accomplishes nothing


----------



## mr8ash (Jul 1, 2021)

i have been using mc -u for about 3 yrs. i thought it was something wrong with my system.


----------



## proton1234 (Jul 1, 2021)

As appeared problem is in shell type. If bash not a default shell MC should be run as

```
env SHELL=/usr/local/bin/bash mc
```


----------



## mtu (Jul 1, 2021)

People regularly report problems concerning mc's subshell feature. I've always compiled mc without this feature. Maybe it's time to disable it by default for binary pkgs as well.

You could open a bug report and suggest this. To support your suggestion, you can link to this forum thread in the bug report, as well as these:









						History file gibberish
					

Hi,  why the content of my /root/.history is full of gibberish like this? I guess I am doing something wrong ...Thanks!




					forums.freebsd.org
				












						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:  common.c: unimplemented subshell type 1 read (subshell_pty...): No error: 0 (0)  I run FreeBSD 12-RELEASE I have never...




					forums.freebsd.org
				












						Solved - Unable to start midnight commander
					

Hi, Midnight Commander doesn't seem to run properly since the "pkg upgrade" yesterday. It starts to run only after a few attempts. And before it starts, it hangs for 5 seconds or so... It used to start within a second before the upgrade. Anyone else experienced this issue ? All suggestions are...




					forums.freebsd.org
				












						mc (Midnight Commander) failing at launch
					

Greetings all.  After a recent update, I've seen that mc no longer works correctly when launched from a non-root account.  I get this error:  $ mc No protocol specified common.c: unimplemented subshell type 1 read (subshell_pty...): No error: 0 (0)  When I use mc --nosubshell it does starts up...




					forums.freebsd.org
				












						Solved - MidnightCommander and .history
					

I have an odd problem with MC that I can't find any information on. I haven't used Linux in a while so not sure if I had this issue in Linux. So, using tcsh and mc. I try to re-use commands by using up-arrow (too lazy to type), however mc adds crazy entries to my .history file for both my normal...




					forums.freebsd.org
				












						Solved - [Solved] mc-light subshell doesn't work in FreeBSD 10
					

Good day  misc/mc-light subshell doesn't work in FreeBSD 10.  [root@o-xxx /usr/ports/misc/mc-light]# uname -a FreeBSD o-xxx 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64  [root@o-xxx...




					forums.freebsd.org


----------



## proton1234 (Jul 1, 2021)

> People regularly report problems concerning mc's subshell feature. I've always compiled mc without this feature. Maybe it's time to disable it by default for binary pkgs as well.
> 
> You could open a bug report and suggest this. To support your suggestion, you can link to this forum thread in the bug report, as well as these:


On my opinion they should show a kind of a warning and ask to use "env SHELL=/usr/local/bin/bash mc" if default shell is other than bash.


----------



## SirDice (Jul 1, 2021)

```
root@molly:/usr/ports # pkg info -D mc
mc-4.8.26_2:
On install:
Midnight Commander was built with subshell support, which works with most
popular shells, e.g. bash(1), dash(1), tcsh(1), zsh(1), but not sh(1) due
to its lack of "precmd" or equivalent hooks which mc(1) needs to read the
subshell's current directory.

  $ env SHELL=/bin/sh mc
  common.c: unimplemented subshell type 1
  read (subshell_pty...): No such file or directory (2)

Please either use more advanced interactive shell, or start mc(1) with -u
(--nosubshell) switch if you're confined to /bin/sh for some reason.
```



proton1234 said:


> \bin\sh


You're not on Windows, on Unix filesystems we use a forward slash; /bin/sh. 

And I would suggest setting your user's shell to tcsh(1) or install shells/bash or shells/zsh. The sh(1) shell is really spartan for interactive use.


----------



## proton1234 (Jul 1, 2021)

SirDice said:


> You're not on Windows, on Unix filesystems we use a forward slash; /bin/sh.


Edited message but in this case it's not important.


```
#>pkg info -D mc
```
outputs "mc-4.8.24:" and nothing more


----------



## SirDice (Jul 1, 2021)

Quarterly seems to have an older package that doesn't have this message. It was added because many people had issues with it. Short answer, change your user's shell to tcsh(1), bash(1), dash(1) or zsh(1) (everything except tcsh(1) needs to be installed separately).


----------



## proton1234 (Jul 1, 2021)

SirDice said:


> Quarterly seems to have an older package that doesn't have this message. It was added because many people had issues with it. Short answer, change your user's shell to tcsh(1), bash(1), dash(1) or zsh(1) (everything except tcsh(1) needs to be installed separately).


On my opinion MC should output this message during the install.
By the way what's your opinion the best way to change locale to prevent garbled output of MC in Putty? I did that by editing .loader.conf (me:\) in home directory. Changed default "C" encoding to "UTF-8".


----------



## SirDice (Jul 1, 2021)

proton1234 said:


> On my opinion MC should output this message during the install.


That's exactly what the newer package does.


----------



## grahamperrin@ (Jul 3, 2021)

<https://www.freshports.org/misc/mc/#message>


----------



## proton1234 (Aug 11, 2021)

SirDice said:


> That's exactly what the newer package does.


Actually it says nothing even the newest one for BSD 11.4


----------



## SirDice (Aug 11, 2021)

```
dice@molly:~ % pkg info -D mc
mc-4.8.26_2:
On install:
Midnight Commander was built with subshell support, which works with most
popular shells, e.g. bash(1), dash(1), tcsh(1), zsh(1), but not sh(1) due
to its lack of "precmd" or equivalent hooks which mc(1) needs to read the
subshell's current directory.

  $ env SHELL=/bin/sh mc
  common.c: unimplemented subshell type 1
  read (subshell_pty...): No such file or directory (2)

Please either use more advanced interactive shell, or start mc(1) with -u
(--nosubshell) switch if you're confined to /bin/sh for some reason.
```


----------

