1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0302
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.0302
Problem: Crash when using :suspend and "fg".
Solution: Undo patch 8.1.244.
Files: src/os_unix.c, src/term.c, src/proto/term.pro
*** ../vim-8.1.0301/src/os_unix.c 2018-08-19 22:20:11.628993678 +0200
--- src/os_unix.c 2018-08-20 21:54:06.847128443 +0200
***************
*** 1228,1251 ****
SIGRETURN;
}
! static void
! after_sigcont(void)
! {
! # ifdef FEAT_TITLE
! // Don't change "oldtitle" in a signal handler, set a flag to obtain it
! // again later.
! oldtitle_outdated = TRUE;
! # endif
! settmode(TMODE_RAW);
! need_check_timestamps = TRUE;
! did_check_timestamps = FALSE;
! }
!
! #if defined(SIGCONT)
! static RETSIGTYPE sigcont_handler SIGPROTOARG;
! static int in_mch_suspend = FALSE;
!
! # if defined(_REENTRANT) && defined(SIGCONT)
/*
* On Solaris with multi-threading, suspending might not work immediately.
* Catch the SIGCONT signal, which will be used as an indication whether the
--- 1228,1234 ----
SIGRETURN;
}
! #if defined(_REENTRANT) && defined(SIGCONT)
/*
* On Solaris with multi-threading, suspending might not work immediately.
* Catch the SIGCONT signal, which will be used as an indication whether the
***************
*** 1257,1263 ****
* volatile because it is used in signal handler sigcont_handler().
*/
static volatile int sigcont_received;
! # endif
/*
* signal handler for SIGCONT
--- 1240,1246 ----
* volatile because it is used in signal handler sigcont_handler().
*/
static volatile int sigcont_received;
! static RETSIGTYPE sigcont_handler SIGPROTOARG;
/*
* signal handler for SIGCONT
***************
*** 1265,1302 ****
static RETSIGTYPE
sigcont_handler SIGDEFARG(sigarg)
{
! if (in_mch_suspend)
! {
! # if defined(_REENTRANT) && defined(SIGCONT)
! sigcont_received = TRUE;
! # endif
! }
! else
! {
! // We didn't suspend ourselves, assume we were stopped by a SIGSTOP
! // signal (which can't be intercepted) and get a SIGCONT. Need to get
! // back to a sane mode and redraw.
! after_sigcont();
!
! update_screen(CLEAR);
! if (State & CMDLINE)
! redrawcmdline();
! else if (State == HITRETURN || State == SETWSIZE || State == ASKMORE
! || State == EXTERNCMD || State == CONFIRM || exmode_active)
! repeat_message();
! else if (redrawing())
! setcursor();
! #if defined(FEAT_INS_EXPAND)
! if (pum_visible())
! {
! redraw_later(NOT_VALID);
! ins_compl_show_pum();
! }
! #endif
! cursor_on_force();
! out_flush();
! }
!
SIGRETURN;
}
#endif
--- 1248,1254 ----
static RETSIGTYPE
sigcont_handler SIGDEFARG(sigarg)
{
! sigcont_received = TRUE;
SIGRETURN;
}
#endif
***************
*** 1379,1386 ****
{
/* BeOS does have SIGTSTP, but it doesn't work. */
#if defined(SIGTSTP) && !defined(__BEOS__)
- in_mch_suspend = TRUE;
-
out_flush(); /* needed to make cursor visible on some systems */
settmode(TMODE_COOK);
out_flush(); /* needed to disable mouse on some systems */
--- 1331,1336 ----
***************
*** 1412,1420 ****
mch_delay(wait_time, FALSE);
}
# endif
- in_mch_suspend = FALSE;
! after_sigcont();
#else
suspend_shell();
#endif
--- 1362,1377 ----
mch_delay(wait_time, FALSE);
}
# endif
! # ifdef FEAT_TITLE
! /*
! * Set oldtitle to NULL, so the current title is obtained again.
! */
! VIM_CLEAR(oldtitle);
! # endif
! settmode(TMODE_RAW);
! need_check_timestamps = TRUE;
! did_check_timestamps = FALSE;
#else
suspend_shell();
#endif
***************
*** 1454,1460 ****
#ifdef SIGTSTP
signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
#endif
! #if defined(SIGCONT)
signal(SIGCONT, sigcont_handler);
#endif
--- 1411,1417 ----
#ifdef SIGTSTP
signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
#endif
! #if defined(_REENTRANT) && defined(SIGCONT)
signal(SIGCONT, sigcont_handler);
#endif
*** ../vim-8.1.0301/src/term.c 2018-08-07 22:30:26.666240863 +0200
--- src/term.c 2018-08-20 21:47:17.833581580 +0200
***************
*** 3834,3856 ****
static int cursor_is_off = FALSE;
/*
- * Enable the cursor without checking if it's already enabled.
- */
- void
- cursor_on_force(void)
- {
- out_str(T_VE);
- cursor_is_off = FALSE;
- }
-
- /*
* Enable the cursor.
*/
void
cursor_on(void)
{
if (cursor_is_off)
! cursor_on_force();
}
/*
--- 3834,3849 ----
static int cursor_is_off = FALSE;
/*
* Enable the cursor.
*/
void
cursor_on(void)
{
if (cursor_is_off)
! {
! out_str(T_VE);
! cursor_is_off = FALSE;
! }
}
/*
*** ../vim-8.1.0301/src/proto/term.pro 2018-08-07 22:30:26.666240863 +0200
--- src/proto/term.pro 2018-08-20 21:47:24.961538793 +0200
***************
*** 52,58 ****
int mouse_has(int c);
int mouse_model_popup(void);
void scroll_start(void);
- void cursor_on_force(void);
void cursor_on(void);
void cursor_off(void);
void term_cursor_mode(int forced);
--- 52,57 ----
*** ../vim-8.1.0301/src/version.c 2018-08-19 22:58:39.783568118 +0200
--- src/version.c 2018-08-20 21:49:38.956734730 +0200
***************
*** 796,797 ****
--- 796,799 ----
{ /* Add new patch number below this line */
+ /**/
+ 302,
/**/
--
SOLDIER: What? A swallow carrying a coconut?
ARTHUR: It could grip it by the husk ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|