Ticket #373 (closed enhancement: wontfix)

Opened 16 years ago

Last modified 2 weeks ago

Support plain POSIX /bin/sh (Bourne shell) as subshell

Reported by: slyfox Owned by:
Priority: major Milestone:
Component: mc-core Version: 4.6.2
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by zaytsev) (diff)

Many environments provide POSIX compliant /bin/sh shell symlinking to:

  • busybox: ash, hush
  • debian: dash

(passwd entry usually contains /bin/sh for them)

  • They are mostly supported via symlink resolution (see #2742)
  • Maybe even better support is possible by interacting with shell (see #3692)

Some systems provide "real" plain Bourne shell, like FreeBSD or Solaris.

These shells are not supported at the moment. Whether support is possible at all with some sort of precmd emulation via PS1 tricks is to be investigated.

The current state of the art is that due to missing variable expansion it's not possible. Please reopen if you have new research and/or patches.

Attachments

main.c.patch (491 bytes) - added by Snelius 23 months ago.
Fix patch

Change History

comment:1 Changed 13 years ago by andrew_b

  • Branch state set to no branch
  • Milestone changed from 4.7 to Future Releases

comment:2 Changed 8 years ago by andrew_b

Ticket #3658 has been marked as a duplicate of this ticket.

comment:3 Changed 8 years ago by zaytsev

  • Blocked By 3692 added

comment:4 Changed 7 years ago by sorin

This bug is still valid and prevents use of mc on lost of system. Another entire set is FreeBSD and pfSense where starting mc works only with "mc -u" which is real PITA.

At least this fatal error should be converted into a warning that does not prevent the app from starting.

comment:5 Changed 5 years ago by enerccio

again 11 years and no fix :x still present on many embedded devices that use busybox shell

Changed 23 months ago by Snelius

Fix patch

comment:6 Changed 23 months ago by Snelius

I've added the patch to fix this misbehaviour. It disables a subshell to allow mc start.
This patch against master branch.
GH PR: https://github.com/MidnightCommander/mc/pull/183

comment:7 Changed 21 months ago by zaytsev

From e2d7ee06bc32c40f119372d15df362913efbcbfd Mon Sep 17 00:00:00 2001
From: Anatoly Y <anatoly@box64.top>
Date: Thu, 13 Apr 2023 22:24:16 +0700
Subject: [PATCH] Workaround. Fix. #373

---
 src/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index c18e069c68..3564876d07 100644
--- a/src/main.c
+++ b/src/main.c
@@ -362,7 +362,7 @@ main (int argc, char *argv[])
 
 #ifdef ENABLE_SUBSHELL
     /* Disallow subshell when invoked as standalone viewer or editor from running mc */
-    if (mc_global.mc_run_mode != MC_RUN_FULL && mc_global.run_from_parent_mc)
+    if (mc_global.shell->type == SHELL_SH || (mc_global.mc_run_mode != MC_RUN_FULL && mc_global.run_from_parent_mc))
         mc_global.tty.use_subshell = FALSE;
 
     if (mc_global.tty.use_subshell)

comment:8 Changed 11 months ago by andrew_b

Ticket #4531 has been marked as a duplicate of this ticket.

comment:9 Changed 5 months ago by zaytsev

  • Status changed from new to closed
  • Resolution set to duplicate
  • Blocked By 3692 removed
  • Milestone Future Releases deleted

Closed as duplicate of #3692.

comment:10 Changed 2 weeks ago by zaytsev

  • Status changed from closed to reopened
  • Resolution duplicate deleted
  • Summary changed from git master: support for SHELL=/bin/sh in subshell to Support plain POSIX /bin/sh (Bourne shell) as subshell

comment:11 Changed 2 weeks ago by zaytsev

  • Status changed from reopened to closed
  • Resolution set to wontfix
  • Description modified (diff)
Note: See TracTickets for help on using tickets.