When using midnight commander in console, I cannot "toggle" the window (using CTRL-o

Not an xterm or Linux console;
the panels cannot be toggled

however, my $TERM is set to linux.

After some googling, I have found suggestions that the problem might be in missing files in /dev/pts. I have /dev/pts mounted dynamically as devpts but it's empty. When I try to copy /dev/pts/0 from another machine, I get an error:

cannot create special file /dev/pts/0
Operation not permitted

Somewhere I found the suggestion to check sysctl -a | grep pty. This gives me:

# sysctl -a | grep pty
kernel.pty.max = 4096
kernel.pty.nr = 0
kernel.pty.reserve = 1024

On another machine, where /dev/pts/ works, I get:

# sysctl -a | grep pty
kernel.pty.max = 4096
kernel.pty.nr = 8
kernel.pty.reserve = 1024

I don't know exactly what that means, but it looks like the problem is this:

kernel.pty.nr = 0

Any suggestions how to fix this?

Note : I am not using udev. My /dev/ is static (with static dev files with /dev/pts mounted as devpts

CORRECTION: My /dev/pts is mounted as devpts (not as tmpfs, as stated in my original question).


# ls -ld /dev/pt* /dev/pts/*
ls: cannot access /dev/pts/*: No such file or directory
crw-rw-rwT 1 root root   5, 2 Oct  2 00:57 /dev/ptmx
drwxr-xr-x 2 root root      0 Sep 30 17:31 /dev/pts

# grep /dev /proc/mounts
/dev/root / ext2 rw,relatime 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0
  • kernel.pty.nr is the number of currently-existing terminals. That's a symptom, not a cause. Please post the output of ls -ld /dev/pt* /dev/pts/* and grep /dev /proc/mounts. Is this a home-compiled kernel? If so, are you absolutely sure you included the necessary options for ptys? Commented Oct 1, 2014 at 22:53
  • @Gilles - I have added the output. My kernel is custom, but I know that it works OK on other machines. Commented Oct 1, 2014 at 23:05
  • Can you run any program that uses ptys? screen? script? xterm? ssh localhost? If those are working then the slave pty devices should appear in /dev/pts while they are active.
    – user41515
    Commented Oct 4, 2014 at 2:23
  • @Wumpus Q. Wumbley - I can run dtach and that works fine. When I run it, a device /dev/pts/0 is created. But midnight commander still gives me the same error as before. Commented Oct 5, 2014 at 9:47
  • So you should probably give up the idea that your devpts is the cause of the problem and go back to researching the original error message.
    – user41515
    Commented Oct 5, 2014 at 13:33

1 Answer 1


Check if your version of mc is compiled with subshell feature. You can check this by running:

$ mc -V
With subshell support as default

A quick Google search returns the following 2 results:

On my laptop, when I hit ctrl+o, I can see in the strace output that the following command is invoked:

execve("/usr/lib/mc/cons.saver", ["cons.saver", "/dev/pts/8"], [/* 136 vars */]) = 0

The terminal from where I invoked mc was /dev/pts/8. So as the second link mentions, make sure cons.saver has access to your terminal device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .