[vim/vim] TerminalOpen event (#2422)

121 views
Skip to first unread message

mattn

unread,
Dec 6, 2017, 10:30:13 PM12/6/17
to vim/vim, Subscribed

Current implementation provide way to set options to the :terminal buffer using BufWinEnter.

au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif

But this is bits bothersome. How about add TerminalOpen event which raise only when open :terminal?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Shougo

unread,
Dec 6, 2017, 10:47:19 PM12/6/17
to vim/vim, Subscribed

I think TermOpen name is better.
Because, TermChanged and TermResponse events are already exists.

Bram Moolenaar

unread,
Dec 7, 2017, 4:48:26 PM12/7/17
to vim/vim, Subscribed

Shougo wrote:

> I think `TermOpen` name is better.
> Because, `TermChanged` and `TermResponse` events are already exists.

Those events relate to 'term', so it's actualy better to avoid prefixing
with "Term" and use "Terminal".

--
From "know your smileys":
:-)-O Smiling doctor with stethoscope

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

James McCoy

unread,
Dec 7, 2017, 4:58:42 PM12/7/17
to vim/vim, Subscribed

Neovim also uses TermOpen for this event, so consistency would be nice.

Bram Moolenaar

unread,
Dec 8, 2017, 7:44:41 AM12/8/17
to vim/vim, Subscribed

James McCoy wrote:

> Neovim also uses `TermOpen` for this event, so consistency would be nice.

All terminal window stuff is new, it's best to make it as clear now, we
can't change it later. We already have confusion between "term",
"terminal" and "terminal window". Since the option is called 'term', we
can associate things with that option name. But the new terminal window
feature is clearly called "terminal" and not "term", so let's use that
name. The shortening can only cause confusion.

--
In order for something to become clean, something else must become dirty;
but you can get everything dirty without getting anything clean.


/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Wang Shidong

unread,
Dec 22, 2017, 10:54:51 PM12/22/17
to vim/vim, Subscribed

Still prefer TermOpen,as it is already exist in neovim.

Nikolai Aleksandrovich Pavlov

unread,
Dec 24, 2017, 6:39:30 AM12/24/17
to vim/vim, Subscribed

“Term” is a recognized shortcut for “terminal”, no matter whether you spell it short or long if something like TermFocusLost (i.e. FocusLost controlled by terminal escape sequences; only the example) is implemented to fire on events caused by outside terminal that will cause confusion. If it is not, no confusion in TermOpen. Confusion could only be avoided by adding adjective, not by avoiding shortening.

And do not forget that :terminal can be shortened to :term, and you did exactly that in documentation as well (:h terminal-use, :h term++close), in &termkey and &termsize option names, in all associated function names, in plugin name (termdebug). If you want to stay consistent on that, do rename everything I mentioned.

Wang Shidong

unread,
Dec 24, 2017, 6:43:53 AM12/24/17
to vim/vim, Subscribed

yeah, the first time I know the key word term is in vim8, before this, the terminal is :terminal and :te in neovim, then vim8 add a new command :term instead of using :te.

Nikolai Aleksandrovich Pavlov

unread,
Dec 24, 2017, 6:51:12 AM12/24/17
to vim/vim, Subscribed

@wsdjeg Both Vim and Neovim added command :terminal. But Neovim removed :tearoff as well, so minimal shortcut in Neovim is :te and minimal shortcut in Vim is :ter.

Wang Shidong

unread,
Dec 24, 2017, 6:57:55 AM12/24/17
to vim/vim, Subscribed

oh, I got it, sorry for my previous comment

Christian Brabandt

unread,
Jan 2, 2018, 9:26:16 AM1/2/18
to vim/vim, Subscribed

closing for #2487

Christian Brabandt

unread,
Jan 2, 2018, 9:26:18 AM1/2/18
to vim/vim, Subscribed

Closed #2422.

Reply all
Reply to author
Forward
0 new messages