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 #2484)
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 0178e3b..d8e40d1 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -908,3 +908,37 @@
" close the terminal window where Vim was running
quit
endfunc
+
+func Test_terminalopen_autocmd()
+ augroup repro
+ au!
+ au TerminalOpen * let s:called += 1
+ augroup END
+
+ let s:called = 0
+
+ " Open a terminal window with :terminal
+ terminal
+ call assert_equal(1, s:called)
+ bwipe!
+
+ " Open a terminal window with term_start()
+ call term_start(&shell)
+ call assert_equal(2, s:called)
+ bwipe!
+
+ " Open a hidden terminal buffer with :terminal
+ terminal ++hidden
+ call assert_equal(3, s:called)
+ for buf in term_list()
+ exe buf . "bwipe!"
+ endfor
+
+ " Open a hidden terminal buffer with term_start()
+ let buf = term_start(&shell, {'hidden': 1})
+ call assert_equal(4, s:called)
+ exe buf . "bwipe!"
+
+ unlet s:called
+ au! repro
+endfunction