This happens due to rev 369133 incorrectly updates the files/patch-lib__tty__win patch. Commit message says this patch file is changed by upstream, but the truth is removed part is actually vital for sub-shell screen save/restore to work properly. The following patch reverts the change and fixes the problem for me: Index: misc/mc/files/patch-lib__tty__win.c =================================================================== --- misc/mc/files/patch-lib__tty__win.c (revision 370042) +++ misc/mc/files/patch-lib__tty__win.c (working copy) @@ -1,5 +1,14 @@ --- lib/tty/win.c.orig 2014-09-02 09:23:58 UTC +++ lib/tty/win.c +@@ -95,7 +95,7 @@ + void + do_enter_ca_mode (void) + { +- if (mc_global.tty.xterm_flag && smcup != NULL) ++ if (mc_global.tty.xterm_flag) + { + fprintf (stdout, /* ESC_STR ")0" */ ESC_STR "7" ESC_STR "[?47h"); + fflush (stdout); @@ -107,7 +107,7 @@ void do_exit_ca_mode (void)
Maintainers CC'd
Thanks it works. I have tested the patch on FreeBSD 11.0-CURRENT #0 r274845 and FreeBSD 9.3-STABLE #0 r271760.
A commit references this bug: Author: pi Date: Tue Dec 9 12:03:14 UTC 2014 New revision: 374372 URL: https://svnweb.freebsd.org/changeset/ports/374372 Log: misc/mc: re-add small patch that was deleted in r369133 Change: save/restore the sub-shell's screen on Ctrl+O and/or command execution PR: 194627 Submitted by: andriys@gmail.com Changes: head/misc/mc/Makefile head/misc/mc/files/patch-lib__tty__win.c
Committed, thanks.
A commit references this bug: Author: pi Date: Tue Dec 9 15:58:51 UTC 2014 New revision: 374403 URL: https://svnweb.freebsd.org/changeset/ports/374403 Log: misc/mc: really re-add small patch that was deleted in r369133 Thanks to tijl: patch syntax was bogus and was ignored. PR: 194627 Changes: head/misc/mc/Makefile head/misc/mc/files/patch-lib__tty__win.c