comparison src/terminal.c @ 11917:00836eb177cb v8.0.0838

patch 8.0.0838: buffer hangs around whem terminal window is closed commit https://github.com/vim/vim/commit/94053a51255121713f51c122eb0dbb46c120e6d4 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 1 21:44:33 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Tue, 01 Aug 2017 21:45:04 +0200
parents 22658e33203f
children cca097489de5
comparison
equal deleted inserted replaced
11916:de8aede995aa 11917:00836eb177cb
34 * 34 *
35 * When the job ends the text is put in a buffer. Redrawing then happens from 35 * When the job ends the text is put in a buffer. Redrawing then happens from
36 * that buffer, attributes come from the scrollback buffer tl_scrollback. 36 * that buffer, attributes come from the scrollback buffer tl_scrollback.
37 * 37 *
38 * TODO: 38 * TODO:
39 * - When closing a window with a terminal buffer where the job has ended, wipe 39 * - don't allow exiting Vim when a terminal is still running a job
40 * out the buffer. Like 'bufhidden' is "wipe".
41 * - When a buffer with a terminal is wiped out, kill the job and close the
42 * channel.
43 * - in bash mouse clicks are inserting characters. 40 * - in bash mouse clicks are inserting characters.
44 * - mouse scroll: when over other window, scroll that window. 41 * - mouse scroll: when over other window, scroll that window.
45 * - typing CTRL-C is not sent to the terminal. need to setup controlling tty? 42 * - typing CTRL-C is not sent to the terminal. need to setup controlling tty?
46 * #1910 43 * #1910
47 * - For the scrollback buffer store lines in the buffer, only attributes in 44 * - For the scrollback buffer store lines in the buffer, only attributes in
57 * attributes (color, blink, etc.) 54 * attributes (color, blink, etc.)
58 * - To set BS correctly, check get_stty(); Pass the fd of the pty. 55 * - To set BS correctly, check get_stty(); Pass the fd of the pty.
59 * - do not store terminal window in viminfo. Or prefix term:// ? 56 * - do not store terminal window in viminfo. Or prefix term:// ?
60 * - add a character in :ls output 57 * - add a character in :ls output
61 * - add 't' to mode() 58 * - add 't' to mode()
62 * - When making a change after the job has ended, make the buffer a normal
63 * buffer; needs to be written.
64 * - when closing window and job has not ended, make terminal hidden?
65 * - when closing window and job has ended, make buffer hidden?
66 * - don't allow exiting Vim when a terminal is still running a job
67 * - use win_del_lines() to make scroll-up efficient. 59 * - use win_del_lines() to make scroll-up efficient.
60 * - implement term_setsize()
68 * - add test for giving error for invalid 'termsize' value. 61 * - add test for giving error for invalid 'termsize' value.
69 * - support minimal size when 'termsize' is "rows*cols". 62 * - support minimal size when 'termsize' is "rows*cols".
70 * - support minimal size when 'termsize' is empty? 63 * - support minimal size when 'termsize' is empty?
71 * - implement "term" for job_start(): more job options when starting a 64 * - implement "term" for job_start(): more job options when starting a
72 * terminal. 65 * terminal.
571 } 564 }
572 565
573 /* 566 /*
574 * Return TRUE if the job for "term" is still running. 567 * Return TRUE if the job for "term" is still running.
575 */ 568 */
576 static int 569 int
577 term_job_running(term_T *term) 570 term_job_running(term_T *term)
578 { 571 {
579 /* Also consider the job finished when the channel is closed, to avoid a 572 /* Also consider the job finished when the channel is closed, to avoid a
580 * race condition when updating the title. */ 573 * race condition when updating the title. */
581 return term->tl_job != NULL 574 return term->tl_job != NULL