WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Midnight Commander Subshell  (Read 3660 times)

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Midnight Commander Subshell
« on: September 30, 2011, 01:57:55 AM »
As there are MC users around here I am hoping someone may have a tip or trick to offer.

Switching between the MC normal interface and the subshell works fine using the keystroke CTL+o.  Extensive use is made of personally created entries in the MC "User Menu" to run tasks.  These automatically open the MC subshell and display the task progress, then automatically close it upon task completion. 

In 90% of cases this behaviour is exactly what I want and have set it up this way in Options-->Configuration-->Pause after run-->Never.

For the remaining 10% of cases it would be convenient to have the subshell display remain open once the task has completed, awaiting a keystroke (i.e. the usual CTL+o) before returning to the usual MC interface diaplay.

Does anyone know a way of doing this?


Note:
I have found an impractical, clumsy way of delaying the closing of the subshell display, by appending a sleep X command at the end of the task entry in the "User Menu".  This is not really suitable as:
  • The subshell automatically closes on expiry of the sleep period rather than remaining open pending a manual keystroke
  • Manually switching to the MC interface (CTL+o) during the sleep period suspends the sleep countdown, which resumes upon switching back to the subshell display.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Midnight Commander Subshell
« Reply #1 on: September 30, 2011, 04:00:25 AM »
Stock shell doesn't support subshell. Try bash.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Midnight Commander Subshell
« Reply #2 on: September 30, 2011, 05:54:17 AM »
I just enter 'sh' on the command line and 'exit' when through.
Can't switch back and forth though.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11220
Re: Midnight Commander Subshell
« Reply #3 on: September 30, 2011, 06:29:25 AM »
Hi SamK
Can you use the busybox  nc  command to listen to some port, then hit  Ctrl-c  when you want
to resume?
nc -l -p 2222

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Midnight Commander Subshell
« Reply #4 on: October 01, 2011, 12:12:09 AM »
As so often seems to be the case, shortly after posting the question I stumbled on to an answer.  It turns out to be exactly the same as the idea from gerald_clark, which works just fine.

Thanks to each of you for your suggestions.