Skip to content

Commit

Permalink
MFH: r456522
Browse files Browse the repository at this point in the history
misc/mc: Fix SUBSHELL blank terminal upon opening in xterm with Slang

Note: Unfortunately this does not fix this issue on the FreeBSD console.

PR:		217758
Submitted by:	Alexander Moisseev <moiseev@mezonplus.ru>
Reported by:	Dron <dron_2@ua.fm>
Reported by:	danfe

Approved by:	ports-secteam (delphij)
  • Loading branch information
woodsb02 committed Dec 18, 2017
1 parent 59840eb commit ef77859
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions misc/mc/Makefile
Expand Up @@ -4,6 +4,7 @@
PORTNAME= mc
PORTVERSION= 4.8.19
PORTREVISION= 3
PORTREVISION= 1
CATEGORIES= misc shells
MASTER_SITES= http://ftp.midnight-commander.org/ \
http://ftp.osuosl.org/pub/midnightcommander/
Expand Down
28 changes: 28 additions & 0 deletions misc/mc/files/patch-lib_tty_tty-slang.c
@@ -0,0 +1,28 @@
--- lib/tty/tty-slang.c.orig 2017-03-04 17:51:38 UTC
+++ lib/tty/tty-slang.c
@@ -373,7 +373,11 @@ tty_shutdown (void)
void
tty_enter_ca_mode (void)
{
- /* S-Lang handles alternate screen switching and cursor position saving */
+ if (mc_global.tty.xterm_flag)
+ {
+ fprintf (stdout, /* ESC_STR ")0" */ ESC_STR "7" ESC_STR "[?47h");
+ fflush (stdout);
+ }
}

/* --------------------------------------------------------------------------------------------- */
@@ -381,7 +385,11 @@ tty_enter_ca_mode (void)
void
tty_exit_ca_mode (void)
{
- /* S-Lang handles alternate screen switching and cursor position restoring */
+ if (mc_global.tty.xterm_flag)
+ {
+ fprintf (stdout, ESC_STR "[?47l" ESC_STR "8" ESC_STR "[m");
+ fflush (stdout);
+ }
}

/* --------------------------------------------------------------------------------------------- */

0 comments on commit ef77859

Please sign in to comment.