Skip to content

Commit 7ba3b91

Browse files
committed
patch 8.2.0237: crash when setting 'wincolor' on finished terminal window
Problem: Crash when setting 'wincolor' on finished terminal window. (Bakudankun) Solution: Check that the vterm is not NULL. (Yasuhiro Matsumoto, closes #5607, closes #5610)
1 parent 57ea292 commit 7ba3b91

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/terminal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4276,6 +4276,8 @@ term_update_colors(void)
42764276
{
42774277
term_T *term = curwin->w_buffer->b_term;
42784278

4279+
if (term->tl_vterm == NULL)
4280+
return;
42794281
init_default_colors(term, curwin);
42804282
vterm_state_set_default_colors(
42814283
vterm_obtain_state(term->tl_vterm),

src/testdir/test_terminal.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,3 +2370,18 @@ func Test_terminal_in_popup()
23702370
call StopVimInTerminal(buf)
23712371
call delete('XtermPopup')
23722372
endfunc
2373+
2374+
func Test_issue_5607()
2375+
let wincount = winnr('$')
2376+
exe 'terminal' &shell &shellcmdflag 'exit'
2377+
let job = term_getjob(bufnr())
2378+
call WaitForAssert({-> assert_equal("dead", job_status(job))})
2379+
2380+
let old_wincolor = &wincolor
2381+
try
2382+
set wincolor=
2383+
finally
2384+
let &wincolor = old_wincolor
2385+
bw!
2386+
endtry
2387+
endfunc

src/version.c

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

743743
static int included_patches[] =
744744
{ /* Add new patch number below this line */
745+
/**/
746+
237,
745747
/**/
746748
236,
747749
/**/

0 commit comments

Comments
 (0)