Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programatically call exit_subshell outside of mc #3941

Open
mc-butler opened this issue Oct 12, 2018 · 0 comments
Open

Programatically call exit_subshell outside of mc #3941

mc-butler opened this issue Oct 12, 2018 · 0 comments
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around ver: 4.8.19 Reproducible in version 4.8.19

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3941
Reporter z0rc (z0rc3r@….com)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around ver: 4.8.19 Reproducible in version 4.8.19
Development

No branches or pull requests

1 participant