Do not duplicate alternate screen switching.

S-Lang already handles that in SLsmg_init_smg() and SLsmg_reset_smg().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Yuri Khan 2016-05-03 16:08:01 +06:00 committed by Andrew Borodin
parent abb4996589
commit c1975a3a35
6 changed files with 43 additions and 31 deletions

View File

@ -230,6 +230,30 @@ tty_shutdown (void)
/* --------------------------------------------------------------------------------------------- */
void
tty_enter_ca_mode (void)
{
if (mc_global.tty.xterm_flag && smcup != NULL)
{
fprintf (stdout, /* ESC_STR ")0" */ ESC_STR "7" ESC_STR "[?47h");
fflush (stdout);
}
}
/* --------------------------------------------------------------------------------------------- */
void
tty_exit_ca_mode (void)
{
if (mc_global.tty.xterm_flag && rmcup != NULL)
{
fprintf (stdout, ESC_STR "[?47l" ESC_STR "8" ESC_STR "[m");
fflush (stdout);
}
}
/* --------------------------------------------------------------------------------------------- */
void
tty_change_screen_size (void)
{

View File

@ -363,6 +363,22 @@ tty_shutdown (void)
/* --------------------------------------------------------------------------------------------- */
void
tty_enter_ca_mode (void)
{
/* S-Lang handles alternate screen switching and cursor position saving */
}
/* --------------------------------------------------------------------------------------------- */
void
tty_exit_ca_mode (void)
{
/* S-Lang handles alternate screen switching and cursor position restoring */
}
/* --------------------------------------------------------------------------------------------- */
void
tty_change_screen_size (void)
{

View File

@ -137,5 +137,8 @@ extern void tty_change_screen_size (void);
extern int mc_tty_normalize_lines_char (const char *);
extern void tty_enter_ca_mode (void);
extern void tty_exit_ca_mode (void);
/*** inline functions ****************************************************************************/
#endif /* MC_TTY_H */

View File

@ -92,30 +92,6 @@ anything_ready (void)
/*** public functions ****************************************************************************/
/* --------------------------------------------------------------------------------------------- */
void
tty_enter_ca_mode (void)
{
if (mc_global.tty.xterm_flag && smcup != NULL)
{
fprintf (stdout, /* ESC_STR ")0" */ ESC_STR "7" ESC_STR "[?47h");
fflush (stdout);
}
}
/* --------------------------------------------------------------------------------------------- */
void
tty_exit_ca_mode (void)
{
if (mc_global.tty.xterm_flag && rmcup != NULL)
{
fprintf (stdout, ESC_STR "[?47l" ESC_STR "8" ESC_STR "[m");
fflush (stdout);
}
}
/* --------------------------------------------------------------------------------------------- */
void
show_rxvt_contents (int starty, unsigned char y1, unsigned char y2)
{

View File

@ -17,9 +17,6 @@
/*** declarations of public functions ************************************************************/
void tty_enter_ca_mode (void);
void tty_exit_ca_mode (void);
void show_rxvt_contents (int starty, unsigned char y1, unsigned char y2);
gboolean look_for_rxvt_extensions (void);

View File

@ -35,9 +35,6 @@
#include "lib/global.h"
#include "lib/tty/tty.h" /* LINES, COLS */
#include "lib/tty/color.h" /* tty_set_normal_attrs() */
#ifdef HAVE_SLANG
#include "lib/tty/win.h" /* tty_enter_ca_mode() */
#endif
#include "lib/widget.h"
#include "lib/event.h"
@ -372,7 +369,6 @@ dialog_change_screen_size (void)
tty_change_screen_size ();
#ifdef HAVE_SLANG
tty_enter_ca_mode ();
tty_keypad (TRUE);
tty_nodelay (FALSE);
#endif