Bug 194627

Summary: misc/mc 4.8.13 does not save/restore the sub-shell's screen on Ctrl+O and/or command execution
Product: Ports & Packages Reporter: andriys
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Some People CC: 214748mv, kot, pi
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description andriys 2014-10-27 11:16:53 UTC
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)
Comment 1 Bugzilla Automation freebsd_committer 2014-10-27 11:16:53 UTC
Maintainers CC'd
Comment 2 214748mv 2014-11-23 15:39:46 UTC
Thanks it works. I have tested the patch on FreeBSD 11.0-CURRENT #0 r274845 and FreeBSD 9.3-STABLE #0 r271760.
Comment 3 commit-hook freebsd_committer 2014-12-09 12:03:58 UTC
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
Comment 4 Kurt Jaeger freebsd_committer 2014-12-09 12:04:42 UTC
Committed, thanks.
Comment 5 commit-hook freebsd_committer 2014-12-09 15:59:26 UTC
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