Refactoring of TTY layer shutdown.
Unification of tty_shutdown() function as for S-Lang as for NCurses. Added do_exit_ca_mode() call to the NCurses-based tty_shutdown(). Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
68468a25ac
Коммит
09123c9fc9
@ -182,7 +182,12 @@ tty_init (gboolean slow, gboolean ugly_lines, gboolean mouse_enable, gboolean is
|
|||||||
void
|
void
|
||||||
tty_shutdown (void)
|
tty_shutdown (void)
|
||||||
{
|
{
|
||||||
endwin ();
|
disable_mouse ();
|
||||||
|
tty_reset_shell_mode ();
|
||||||
|
tty_noraw_mode ();
|
||||||
|
tty_keypad (FALSE);
|
||||||
|
tty_reset_screen ();
|
||||||
|
do_exit_ca_mode ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
@ -327,8 +327,11 @@ tty_shutdown (void)
|
|||||||
{
|
{
|
||||||
char *op_cap;
|
char *op_cap;
|
||||||
|
|
||||||
SLsmg_reset_smg ();
|
disable_mouse ();
|
||||||
tty_reset_shell_mode ();
|
tty_reset_shell_mode ();
|
||||||
|
tty_noraw_mode ();
|
||||||
|
tty_keypad (FALSE);
|
||||||
|
tty_reset_screen ();
|
||||||
do_exit_ca_mode ();
|
do_exit_ca_mode ();
|
||||||
SLang_reset_tty ();
|
SLang_reset_tty ();
|
||||||
|
|
||||||
|
@ -42,8 +42,7 @@
|
|||||||
#include "lib/global.h"
|
#include "lib/global.h"
|
||||||
|
|
||||||
#include "lib/tty/tty.h"
|
#include "lib/tty/tty.h"
|
||||||
#include "lib/tty/mouse.h"
|
#include "lib/tty/key.h" /* KEY_M_* masks */
|
||||||
#include "lib/tty/key.h" /* For init_key() */
|
|
||||||
#include "lib/tty/win.h" /* xterm_flag */
|
#include "lib/tty/win.h" /* xterm_flag */
|
||||||
#include "lib/skin.h"
|
#include "lib/skin.h"
|
||||||
#include "lib/util.h"
|
#include "lib/util.h"
|
||||||
@ -851,37 +850,21 @@ setup_dummy_mc (void)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static void
|
|
||||||
done_screen (void)
|
|
||||||
{
|
|
||||||
if ((quit & SUBSHELL_EXIT) == 0)
|
|
||||||
clr_scr ();
|
|
||||||
tty_reset_shell_mode ();
|
|
||||||
tty_noraw_mode ();
|
|
||||||
tty_keypad (FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
done_mc (void)
|
done_mc (void)
|
||||||
{
|
{
|
||||||
disable_mouse ();
|
|
||||||
|
|
||||||
/* Setup shutdown
|
/* Setup shutdown
|
||||||
*
|
*
|
||||||
* We sync the profiles since the hotlist may have changed, while
|
* We sync the profiles since the hotlist may have changed, while
|
||||||
* we only change the setup data if we have the auto save feature set
|
* we only change the setup data if we have the auto save feature set
|
||||||
*/
|
*/
|
||||||
|
char *curr_dir;
|
||||||
|
|
||||||
save_setup (auto_save_setup, panels_options.auto_save_setup);
|
save_setup (auto_save_setup, panels_options.auto_save_setup);
|
||||||
done_screen ();
|
|
||||||
|
|
||||||
{
|
curr_dir = vfs_get_current_dir ();
|
||||||
char *curr_dir = vfs_get_current_dir ();
|
vfs_stamp_path (curr_dir);
|
||||||
vfs_stamp_path (curr_dir);
|
g_free (curr_dir);
|
||||||
g_free (curr_dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((current_panel != NULL) && (get_current_type () == view_listing))
|
if ((current_panel != NULL) && (get_current_type () == view_listing))
|
||||||
vfs_stamp_path (current_panel->cwd);
|
vfs_stamp_path (current_panel->cwd);
|
||||||
@ -1686,6 +1669,9 @@ do_nc (void)
|
|||||||
#ifdef USE_INTERNAL_EDIT
|
#ifdef USE_INTERNAL_EDIT
|
||||||
edit_stack_free ();
|
edit_stack_free ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ((quit & SUBSHELL_EXIT) == 0)
|
||||||
|
clr_scr ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user