comparison src/terminal.c @ 17186:278583ff5e44 v8.1.1592

patch 8.1.1592: may start file dialog while exiting commit https://github.com/vim/vim/commit/5c381eb9e72990e4153045f4911c59b9b2194edd Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 25 06:50:31 2019 +0200 patch 8.1.1592: may start file dialog while exiting Problem: May start file dialog while exiting. Solution: Ignore the "browse" modifier when exiting. (Ozaki Kiichi, closes #4582
author Bram Moolenaar <Bram@vim.org>
date Tue, 25 Jun 2019 07:00:04 +0200
parents ebe9aab81898
children ff097edaae89
comparison
equal deleted inserted replaced
17185:bb5e800dda4a 17186:278583ff5e44
353 opt->jo_pty = TRUE; 353 opt->jo_pty = TRUE;
354 if ((opt->jo_set2 & JO2_TERM_ROWS) == 0) 354 if ((opt->jo_set2 & JO2_TERM_ROWS) == 0)
355 opt->jo_term_rows = rows; 355 opt->jo_term_rows = rows;
356 if ((opt->jo_set2 & JO2_TERM_COLS) == 0) 356 if ((opt->jo_set2 & JO2_TERM_COLS) == 0)
357 opt->jo_term_cols = cols; 357 opt->jo_term_cols = cols;
358 }
359
360 /*
361 * Flush messages on channels.
362 */
363 static void
364 term_flush_messages()
365 {
366 mch_check_messages();
367 parse_queued_messages();
358 } 368 }
359 369
360 /* 370 /*
361 * Close a terminal buffer (and its window). Used when creating the terminal 371 * Close a terminal buffer (and its window). Used when creating the terminal
362 * fails. 372 * fails.
1453 job_status(job); 1463 job_status(job);
1454 if (job->jv_status >= JOB_ENDED) 1464 if (job->jv_status >= JOB_ENDED)
1455 return OK; 1465 return OK;
1456 1466
1457 ui_delay(10L, FALSE); 1467 ui_delay(10L, FALSE);
1458 mch_check_messages(); 1468 term_flush_messages();
1459 parse_queued_messages();
1460 } 1469 }
1461 return FAIL; 1470 return FAIL;
1462 } 1471 }
1463 1472
1464 /* 1473 /*
3062 int did_one = FALSE; 3071 int did_one = FALSE;
3063 3072
3064 for (term = first_term; term != NULL; term = next_term) 3073 for (term = first_term; term != NULL; term = next_term)
3065 { 3074 {
3066 next_term = term->tl_next; 3075 next_term = term->tl_next;
3067 if (term->tl_job == ch->ch_job) 3076 if (term->tl_job == ch->ch_job && !term->tl_channel_closed)
3068 { 3077 {
3069 term->tl_channel_closed = TRUE; 3078 term->tl_channel_closed = TRUE;
3070 did_one = TRUE; 3079 did_one = TRUE;
3071 3080
3072 VIM_CLEAR(term->tl_title); 3081 VIM_CLEAR(term->tl_title);
5626 * closed. buf->b_term may become NULL if the terminal was closed while 5635 * closed. buf->b_term may become NULL if the terminal was closed while
5627 * waiting. */ 5636 * waiting. */
5628 ch_log(NULL, "term_wait(): waiting for channel to close"); 5637 ch_log(NULL, "term_wait(): waiting for channel to close");
5629 while (buf->b_term != NULL && !buf->b_term->tl_channel_closed) 5638 while (buf->b_term != NULL && !buf->b_term->tl_channel_closed)
5630 { 5639 {
5631 mch_check_messages(); 5640 term_flush_messages();
5632 parse_queued_messages(); 5641
5633 ui_delay(10L, FALSE); 5642 ui_delay(10L, FALSE);
5634 if (!buf_valid(buf)) 5643 if (!buf_valid(buf))
5635 /* If the terminal is closed when the channel is closed the 5644 /* If the terminal is closed when the channel is closed the
5636 * buffer disappears. */ 5645 * buffer disappears. */
5637 break; 5646 break;
5638 } 5647 }
5639 mch_check_messages(); 5648
5640 parse_queued_messages(); 5649 term_flush_messages();
5641 } 5650 }
5642 else 5651 else
5643 { 5652 {
5644 long wait = 10L; 5653 long wait = 10L;
5645 5654
5646 mch_check_messages(); 5655 term_flush_messages();
5647 parse_queued_messages();
5648 5656
5649 /* Wait for some time for any channel I/O. */ 5657 /* Wait for some time for any channel I/O. */
5650 if (argvars[1].v_type != VAR_UNKNOWN) 5658 if (argvars[1].v_type != VAR_UNKNOWN)
5651 wait = tv_get_number(&argvars[1]); 5659 wait = tv_get_number(&argvars[1]);
5652 ui_delay(wait, TRUE); 5660 ui_delay(wait, TRUE);
5653 mch_check_messages();
5654 5661
5655 /* Flushing messages on channels is hopefully sufficient. 5662 /* Flushing messages on channels is hopefully sufficient.
5656 * TODO: is there a better way? */ 5663 * TODO: is there a better way? */
5657 parse_queued_messages(); 5664 term_flush_messages();
5658 } 5665 }
5659 } 5666 }
5660 5667
5661 /* 5668 /*
5662 * Called when a channel has sent all the lines to a terminal. 5669 * Called when a channel has sent all the lines to a terminal.