comparison src/terminal.c @ 13886:bbf5bdba4a80 v8.0.1814

patch 8.0.1814: crash with terminal window and with 'lazyredraw' set commit https://github.com/vim/vim/commit/a10ae5e323f4ebe6620869f4f9b0812b78090915 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 11 20:48:29 2018 +0200 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().
author Christian Brabandt <cb@256bit.org>
date Fri, 11 May 2018 21:00:06 +0200
parents a590029f16a0
children 81e8e6181aeb
comparison
equal deleted inserted replaced
13885:d1c816cee4d2 13886:bbf5bdba4a80
36 * that buffer, attributes come from the scrollback buffer tl_scrollback. 36 * that buffer, attributes come from the scrollback buffer tl_scrollback.
37 * When the buffer is changed it is turned into a normal buffer, the attributes 37 * When the buffer is changed it is turned into a normal buffer, the attributes
38 * in tl_scrollback are no longer used. 38 * in tl_scrollback are no longer used.
39 * 39 *
40 * TODO: 40 * 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.
41 * - Win32: Redirecting input does not work, half of Test_terminal_redir_file() 44 * - Win32: Redirecting input does not work, half of Test_terminal_redir_file()
42 * is disabled. 45 * is disabled.
43 * - Win32: Redirecting output works but includes escape sequences. 46 * - Win32: Redirecting output works but includes escape sequences.
44 * - Win32: Make terminal used for :!cmd in the GUI work better. Allow for 47 * - Win32: Make terminal used for :!cmd in the GUI work better. Allow for
45 * redirection. 48 * redirection.
969 /* TODO: only update once in a while. */ 972 /* TODO: only update once in a while. */
970 ch_log(term->tl_job->jv_channel, "updating screen"); 973 ch_log(term->tl_job->jv_channel, "updating screen");
971 if (buffer == curbuf) 974 if (buffer == curbuf)
972 { 975 {
973 update_screen(0); 976 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);
975 } 981 }
976 else 982 else
977 redraw_after_callback(TRUE); 983 redraw_after_callback(TRUE);
978 } 984 }
979 } 985 }
2098 /* Repeat redrawing in case a message is received while redrawing. 2104 /* Repeat redrawing in case a message is received while redrawing.
2099 */ 2105 */
2100 while (must_redraw != 0) 2106 while (must_redraw != 0)
2101 if (update_screen(0) == FAIL) 2107 if (update_screen(0) == FAIL)
2102 break; 2108 break;
2109 if (!term_use_loop_check(TRUE))
2110 /* job finished while redrawing */
2111 break;
2112
2103 update_cursor(curbuf->b_term, FALSE); 2113 update_cursor(curbuf->b_term, FALSE);
2104 restore_cursor = TRUE; 2114 restore_cursor = TRUE;
2105 2115
2106 c = term_vgetc(); 2116 c = term_vgetc();
2107 if (!term_use_loop_check(TRUE)) 2117 if (!term_use_loop_check(TRUE))