mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.0.0858: can exit while a terminal is still running a job
Problem: Can exit while a terminal is still running a job. Solution: Consider a buffer with a running job like a changed file.
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
* that buffer, attributes come from the scrollback buffer tl_scrollback.
|
||||
*
|
||||
* TODO:
|
||||
* - don't allow exiting Vim when a terminal is still running a job
|
||||
* - MS-Windows: no redraw for 'updatetime' #1915
|
||||
* - in bash mouse clicks are inserting characters.
|
||||
* - mouse scroll: when over other window, scroll that window.
|
||||
@@ -284,11 +283,16 @@ term_start(char_u *cmd, jobopt_T *opt)
|
||||
}
|
||||
curbuf->b_fname = curbuf->b_ffname;
|
||||
|
||||
set_string_option_direct((char_u *)"buftype", -1,
|
||||
(char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0);
|
||||
|
||||
/* Mark the buffer as not modifiable. It can only be made modifiable after
|
||||
* the job finished. */
|
||||
curbuf->b_p_ma = FALSE;
|
||||
set_string_option_direct((char_u *)"buftype", -1,
|
||||
(char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0);
|
||||
|
||||
/* Set 'bufhidden' to "hide": allow closing the window. */
|
||||
set_string_option_direct((char_u *)"bufhidden", -1,
|
||||
(char_u *)"hide", OPT_FREE|OPT_LOCAL, 0);
|
||||
|
||||
set_term_and_win_size(term);
|
||||
setup_job_options(opt, term->tl_rows, term->tl_cols);
|
||||
|
Reference in New Issue
Block a user