Skip to content

Commit a10ae5e

Browse files
committed
patch 8.0.1814: crash with terminal window and with 'lazyredraw' set
Problem: Crash with terminal window and with 'lazyredraw' set. (Antoine) Solution: Check the terminal still exists after update_screen().
1 parent 38623c8 commit a10ae5e

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/terminal.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
* in tl_scrollback are no longer used.
3939
*
4040
* TODO:
41+
* - Win32: Termdebug doesn't work, because gdb does not support mi2. This
42+
* plugin: https://github.com/cpiger/NeoDebug runs gdb as a job, redirecting
43+
* input and output. Command I/O is in gdb window.
4144
* - Win32: Redirecting input does not work, half of Test_terminal_redir_file()
4245
* is disabled.
4346
* - Win32: Redirecting output works but includes escape sequences.
@@ -971,7 +974,10 @@ write_to_term(buf_T *buffer, char_u *msg, channel_T *channel)
971974
if (buffer == curbuf)
972975
{
973976
update_screen(0);
974-
update_cursor(term, TRUE);
977+
/* update_screen() can be slow, check the terminal wasn't closed
978+
* already */
979+
if (buffer == curbuf && curbuf->b_term != NULL)
980+
update_cursor(curbuf->b_term, TRUE);
975981
}
976982
else
977983
redraw_after_callback(TRUE);
@@ -2100,6 +2106,10 @@ terminal_loop(int blocking)
21002106
while (must_redraw != 0)
21012107
if (update_screen(0) == FAIL)
21022108
break;
2109+
if (!term_use_loop_check(TRUE))
2110+
/* job finished while redrawing */
2111+
break;
2112+
21032113
update_cursor(curbuf->b_term, FALSE);
21042114
restore_cursor = TRUE;
21052115

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1814,
764766
/**/
765767
1813,
766768
/**/

0 commit comments

Comments
 (0)