Ticket #3941 (new enhancement)

Opened 4 years ago

Programatically call exit_subshell outside of mc

Reported by: z0rc Owned by:
Priority: minor Milestone: Future Releases
Component: mc-core Version: 4.8.19
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:


I'm looking for ways to gracefully handle attempts of launching second copy of MC when already running in MC subshell.

Initially I was planning to have a shell function in place of mc, it will check whether mc is already running at current tty, get its PID and perform function call that is currently bound to Ctrl+O in mc. Unfortunately as I was able to understand, right now it's possible to exit subshell only via this keybind, and there is no way to call it outside of mc without user input.

My proposal is to bind exit_subshell() to some signal, that isn't used for other purposes within MC, for example SIGUSR2.

Additionally, maybe mc itself would be able to handle situation, when it's launched from subshell of another mc. So instead of issuing a warning, it would call exit_subshell of parent mc instance and quit silently.

Note: See TracTickets for help on using tickets.