Ticket #4294 (new enhancement)

Opened 2 years ago

Last modified 2 years ago

Start a subshell in background

Reported by: slajerek Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: subshell Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

This is related to ticket #3580, not sure how to re-open tickets so I created a new one.

I have a similar problem, but it is not related to the solution described there and was not able to solve that problem. I see on other forums that people have similar problem so I suggest to anyway think about possible fix for this once for all and init subshell in background as described in ticket #3580 (copying here for a reference):

It might worth to start the subshell on a background thread to be able to show the main UI faster. Then a rotating dash would be displayed in the command prompt and in Ctrl-O until the subshell is ready.

In my case on macOS 10.15.7 when transitioned to ZSH the MC starts in around 6 seconds. This is totally not acceptable. The ZSH on its own starts in less than one second. The mc --nosubshell starts MC instantly, but there's no subshell which is also not acceptable. Thus, there's something fishy with instantiation of subshell in the MC, may be related to the configuration - but actually, that is not the problem of the fact that subshell init takes long, but that it is not done in the background at startup.

Change History

comment:1 Changed 2 years ago by jhls

I can confirm this. When running mc from a zsh shell, there is a delay of about 1–2 seconds (on my machine) before the panes are displayed. When running without a subshell (mc -u), mc starts with no noticeable delay. When run as

$ SHELL=/bin/bash mc

mc starts immediately; same with csh and tcsh. I have tried removing all zsh config files, including the ones under /etc, but the delay remains the same. My .zsh_history is just 28k.

Some more info:

OS version: MacOS 11.6 (running on a Macbook Air M1)
Output of zsh --version:

zsh 5.8 (x86_64-apple-darwin20.0)

Output of mc --version:

GNU Midnight Commander 4.8.27
Built with GLib 2.68.3
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

comment:2 Changed 2 years ago by redtux

Hi everybody,

I can confirm this issue on Ubuntu 20.04.4 LTS (focal):

  • mc --version
GNU Midnight Commander 4.8.24
  • zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)

Using an alias as suggested is working fine:

alias mc="SHELL=/bin/bash TERM=xterm-256color /usr/bin/mc"

(For GNU Screen I also have to override TERM as mc does not understand screen-256color-bce.)

Note: See TracTickets for help on using tickets.