diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c
index 7481a3e..6a66342 100644
a
|
b
|
static int mc_curs_row, mc_curs_col; |
81 | 81 | /*** file scope functions ************************************************************************/ |
82 | 82 | /* --------------------------------------------------------------------------------------------- */ |
83 | 83 | |
84 | | /* --------------------------------------------------------------------------------------------- */ |
85 | | |
86 | | static void |
87 | | tty_setup_sigwinch (void (*handler) (int)) |
88 | | { |
89 | | #if (NCURSES_VERSION_MAJOR >= 4) && defined (SIGWINCH) |
90 | | struct sigaction act, oact; |
91 | | act.sa_handler = handler; |
92 | | sigemptyset (&act.sa_mask); |
93 | | act.sa_flags = 0; |
94 | | #ifdef SA_RESTART |
95 | | act.sa_flags |= SA_RESTART; |
96 | | #endif /* SA_RESTART */ |
97 | | sigaction (SIGWINCH, &act, &oact); |
98 | | #endif /* SIGWINCH */ |
99 | | } |
100 | | |
101 | | /* --------------------------------------------------------------------------------------------- */ |
102 | | |
103 | 84 | static void |
104 | 85 | sigwinch_handler (int dummy) |
105 | 86 | { |
… |
… |
tty_init (gboolean mouse_enable, gboolean is_xterm) |
205 | 186 | noecho (); |
206 | 187 | keypad (stdscr, TRUE); |
207 | 188 | nodelay (stdscr, FALSE); |
208 | | |
209 | | tty_setup_sigwinch (sigwinch_handler); |
210 | 189 | } |
211 | 190 | |
212 | 191 | /* --------------------------------------------------------------------------------------------- */ |
… |
… |
tty_beep (void) |
630 | 609 | } |
631 | 610 | |
632 | 611 | /* --------------------------------------------------------------------------------------------- */ |
| 612 | |
| 613 | void |
| 614 | tty_setup_sigwinch (void) |
| 615 | { |
| 616 | #if (NCURSES_VERSION_MAJOR >= 4) && defined (SIGWINCH) |
| 617 | struct sigaction act, oact; |
| 618 | |
| 619 | act.sa_handler = sigwinch_handler; |
| 620 | sigemptyset (&act.sa_mask); |
| 621 | act.sa_flags = 0; |
| 622 | #ifdef SA_RESTART |
| 623 | act.sa_flags |= SA_RESTART; |
| 624 | #endif /* SA_RESTART */ |
| 625 | sigaction (SIGWINCH, &act, &oact); |
| 626 | #endif /* SIGWINCH */ |
| 627 | } |
| 628 | |
| 629 | /* --------------------------------------------------------------------------------------------- */ |
diff --git a/lib/tty/tty-slang.c b/lib/tty/tty-slang.c
index 6b7fd32..cae30c7 100644
a
|
b
|
static const struct |
132 | 132 | /* --------------------------------------------------------------------------------------------- */ |
133 | 133 | |
134 | 134 | static void |
135 | | tty_setup_sigwinch (void (*handler) (int)) |
136 | | { |
137 | | #ifdef SIGWINCH |
138 | | struct sigaction act, oact; |
139 | | act.sa_handler = handler; |
140 | | sigemptyset (&act.sa_mask); |
141 | | act.sa_flags = 0; |
142 | | #ifdef SA_RESTART |
143 | | act.sa_flags |= SA_RESTART; |
144 | | #endif /* SA_RESTART */ |
145 | | sigaction (SIGWINCH, &act, &oact); |
146 | | #endif /* SIGWINCH */ |
147 | | } |
148 | | |
149 | | /* --------------------------------------------------------------------------------------------- */ |
150 | | |
151 | | static void |
152 | 135 | sigwinch_handler (int dummy) |
153 | 136 | { |
154 | 137 | (void) dummy; |
… |
… |
tty_init (gboolean mouse_enable, gboolean is_xterm) |
342 | 325 | do_enter_ca_mode (); |
343 | 326 | tty_keypad (TRUE); |
344 | 327 | tty_nodelay (FALSE); |
345 | | |
346 | | tty_setup_sigwinch (sigwinch_handler); |
347 | 328 | } |
348 | 329 | |
349 | 330 | /* --------------------------------------------------------------------------------------------- */ |
… |
… |
tty_beep (void) |
737 | 718 | } |
738 | 719 | |
739 | 720 | /* --------------------------------------------------------------------------------------------- */ |
| 721 | |
| 722 | void |
| 723 | tty_setup_sigwinch (void) |
| 724 | { |
| 725 | #ifdef SIGWINCH |
| 726 | struct sigaction act, oact; |
| 727 | |
| 728 | act.sa_handler = sigwinch_handler; |
| 729 | sigemptyset (&act.sa_mask); |
| 730 | act.sa_flags = 0; |
| 731 | #ifdef SA_RESTART |
| 732 | act.sa_flags |= SA_RESTART; |
| 733 | #endif /* SA_RESTART */ |
| 734 | sigaction (SIGWINCH, &act, &oact); |
| 735 | #endif /* SIGWINCH */ |
| 736 | } |
| 737 | |
| 738 | /* --------------------------------------------------------------------------------------------- */ |
diff --git a/lib/tty/tty.h b/lib/tty/tty.h
index 0450208..5df0ff4 100644
a
|
b
|
extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch) |
130 | 130 | extern int tty_resize (int fd); |
131 | 131 | extern void tty_refresh (void); |
132 | 132 | extern void tty_change_screen_size (void); |
| 133 | extern void tty_setup_sigwinch (void); |
133 | 134 | |
134 | 135 | extern int mc_tty_normalize_lines_char (const char *); |
135 | 136 | |
diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c
index 0ba2fd8..0ed4f04 100644
a
|
b
|
setup_mc (void) |
877 | 877 | add_select_channel (mc_global.tty.subshell_pty, load_prompt, 0); |
878 | 878 | #endif /* !HAVE_SUBSHELL_SUPPORT */ |
879 | 879 | |
| 880 | tty_setup_sigwinch (); |
| 881 | |
880 | 882 | if ((tty_baudrate () < 9600) || mc_global.tty.slow_terminal) |
881 | 883 | verbose = 0; |
882 | 884 | } |