0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.0.0957: a terminal job can deadlock when sending many keys

Problem:    When term_sendkeys() sends many keys it may get stuck in writing
            to the job.
Solution:   Make the write non-blocking, buffer keys to be sent.
This commit is contained in:
Bram Moolenaar
2017-08-18 20:50:30 +02:00
parent cfce71710b
commit 97bd5e6527
6 changed files with 217 additions and 39 deletions

View File

@@ -400,6 +400,10 @@ term_start(typval_T *argvar, jobopt_T *opt, int forceit)
vterm_get_size(term->tl_vterm, &term->tl_rows, &term->tl_cols);
term_report_winsize(term, term->tl_rows, term->tl_cols);
/* Make sure we don't get stuck on sending keys to the job, it leads to
* a deadlock if the job is waiting for Vim to read. */
channel_set_nonblock(term->tl_job->jv_channel, PART_IN);
if (old_curbuf != NULL)
{
--curbuf->b_nwindows;