comparison src/terminal.c @ 13444:9f06f7aca74c v8.0.1596

patch 8.0.1596: no autocommand specifically for opening a terminal window commit https://github.com/vim/vim/commit/b852c3e64d319d6ec47dd780c8654ae095e1d8c2 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 11 16:55:36 2018 +0100 patch 8.0.1596: no autocommand specifically for opening a terminal window Problem: No autocommand specifically for opening a terminal window. Solution: Add TerminalOpen. (?, closes https://github.com/vim/vim/issues/2484)
author Christian Brabandt <cb@256bit.org>
date Sun, 11 Mar 2018 17:00:08 +0100
parents 33eea5ce5415
children a62b0bbc8834
comparison
equal deleted inserted replaced
13443:b8e5a0ebfcbd 13444:9f06f7aca74c
36 * that buffer, attributes come from the scrollback buffer tl_scrollback. 36 * that buffer, attributes come from the scrollback buffer tl_scrollback.
37 * When the buffer is changed it is turned into a normal buffer, the attributes 37 * When the buffer is changed it is turned into a normal buffer, the attributes
38 * in tl_scrollback are no longer used. 38 * in tl_scrollback are no longer used.
39 * 39 *
40 * TODO: 40 * TODO:
41 * - Add a flag to kill the job when Vim is exiting. Useful when it's showing 41 * - if the job in the terminal does not support the mouse, we can use the
42 * a logfile. Or send keys there to make it quit: "exit\r" for a shell. 42 * mouse in the Terminal window for copy/paste and scrolling.
43 * - When using 'termguicolors' still use the 16 ANSI colors as-is. Helps for 43 * - When using 'termguicolors' still use the 16 ANSI colors as-is. Helps for
44 * - In the GUI use a terminal emulator for :!cmd. Make the height the same as
45 * the window and position it higher up when it gets filled, so it looks like
46 * the text scrolls up.
47 * - implement term_setsize()
48 * - Copy text in the vterm to the Vim buffer once in a while, so that
49 * completion works.
44 * - Adding WinBar to terminal window doesn't display, text isn't shifted down. 50 * - Adding WinBar to terminal window doesn't display, text isn't shifted down.
45 * a job that uses 16 colors while Vim is using > 256. 51 * a job that uses 16 colors while Vim is using > 256.
46 * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito 52 * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
47 * Higashi, 2017 Sep 19) 53 * Higashi, 2017 Sep 19)
48 * - Trigger TerminalOpen event? #2422 patch in #2484
49 * - after resizing windows overlap. (Boris Staletic, #2164) 54 * - after resizing windows overlap. (Boris Staletic, #2164)
50 * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file() 55 * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
51 * is disabled. 56 * is disabled.
52 * - if the job in the terminal does not support the mouse, we can use the
53 * mouse in the Terminal window for copy/paste and scrolling.
54 * - cursor blinks in terminal on widows with a timer. (xtal8, #2142) 57 * - cursor blinks in terminal on widows with a timer. (xtal8, #2142)
55 * - When closing gvim with an active terminal buffer, the dialog suggests
56 * saving the buffer. Should say something else. (Manas Thakur, #2215)
57 * Also: #2223
58 * - Termdebug does not work when Vim build with mzscheme. gdb hangs. 58 * - Termdebug does not work when Vim build with mzscheme. gdb hangs.
59 * - MS-Windows GUI: WinBar has tearoff item 59 * - MS-Windows GUI: WinBar has tearoff item
60 * - MS-Windows GUI: still need to type a key after shell exits? #1924 60 * - MS-Windows GUI: still need to type a key after shell exits? #1924
61 * - After executing a shell command the status line isn't redraw. 61 * - After executing a shell command the status line isn't redraw.
62 * - implement term_setsize()
63 * - add test for giving error for invalid 'termsize' value. 62 * - add test for giving error for invalid 'termsize' value.
64 * - support minimal size when 'termsize' is "rows*cols". 63 * - support minimal size when 'termsize' is "rows*cols".
65 * - support minimal size when 'termsize' is empty? 64 * - support minimal size when 'termsize' is empty?
66 * - GUI: when using tabs, focus in terminal, click on tab does not work. 65 * - GUI: when using tabs, focus in terminal, click on tab does not work.
67 * - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
68 * changes to "!shell".
69 * (justrajdeep, 2017 Aug 22)
70 * - Redrawing is slow with Athena and Motif. Also other GUI? (Ramel Eshed) 66 * - Redrawing is slow with Athena and Motif. Also other GUI? (Ramel Eshed)
71 * - For the GUI fill termios with default values, perhaps like pangoterm: 67 * - For the GUI fill termios with default values, perhaps like pangoterm:
72 * http://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/head:/main.c#L134 68 * http://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/head:/main.c#L134
73 * - when 'encoding' is not utf-8, or the job is using another encoding, setup 69 * - when 'encoding' is not utf-8, or the job is using another encoding, setup
74 * conversions. 70 * conversions.
75 * - In the GUI use a terminal emulator for :!cmd. Make the height the same as
76 * the window and position it higher up when it gets filled, so it looks like
77 * the text scrolls up.
78 * - Copy text in the vterm to the Vim buffer once in a while, so that
79 * completion works.
80 * - add an optional limit for the scrollback size. When reaching it remove 71 * - add an optional limit for the scrollback size. When reaching it remove
81 * 10% at the start. 72 * 10% at the start.
82 */ 73 */
83 74
84 #include "vim.h" 75 #include "vim.h"
580 else 571 else
581 { 572 {
582 term_close_buffer(curbuf, old_curbuf); 573 term_close_buffer(curbuf, old_curbuf);
583 return NULL; 574 return NULL;
584 } 575 }
576
577 apply_autocmds(EVENT_TERMINALOPEN, NULL, NULL, FALSE, curbuf);
585 return newbuf; 578 return newbuf;
586 } 579 }
587 580
588 /* 581 /*
589 * ":terminal": open a terminal window and execute a job in it. 582 * ":terminal": open a terminal window and execute a job in it.