0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.0838: buffer hangs around whem terminal window is closed

Problem:    Buffer hangs around whem terminal window is closed.
Solution:   When the job has ended wipe out a terminal buffer when the window
            is closed.
This commit is contained in:
Bram Moolenaar
2017-08-01 21:44:33 +02:00
parent 0792048842
commit 94053a5125
5 changed files with 72 additions and 14 deletions

View File

@@ -468,6 +468,31 @@ close_buffer(
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
int wipe_buf = (action == DOBUF_WIPE);
#ifdef FEAT_TERMINAL
if (bt_terminal(buf))
{
if (term_job_running(buf->b_term))
{
if (wipe_buf)
/* Wiping out a terminal buffer kills the job. */
free_terminal(buf);
else
{
/* The job keeps running, hide the buffer. */
del_buf = FALSE;
unload_buf = FALSE;
}
}
else
{
/* A terminal buffer is wiped out if the job has finished. */
del_buf = TRUE;
unload_buf = TRUE;
wipe_buf = TRUE;
}
}
else
#endif
/*
* Force unloading or deleting when 'bufhidden' says so.
* The caller must take care of NOT deleting/freeing when 'bufhidden' is