patch 8.1.2219: no autocommand for open window with terminal
Problem: No autocommand for open window with terminal.
Solution: Add TerminalWinOpen. (Christian Brabandt)
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index f506a39..212a15f 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -68,6 +68,23 @@
unlet g:job
endfunc
+func Test_terminal_TerminalWinOpen()
+ au TerminalWinOpen * let b:done = 'yes'
+ let buf = Run_shell_in_terminal({})
+ call assert_equal('yes', b:done)
+ call StopShellInTerminal(buf)
+ " closing window wipes out the terminal buffer with the finished job
+ close
+
+ if has("unix")
+ terminal ++hidden ++open sleep 1
+ sleep 1
+ call assert_fails("echo b:done", 'E121:')
+ endif
+
+ au! TerminalWinOpen
+endfunc
+
func Test_terminal_make_change()
let buf = Run_shell_in_terminal({})
call StopShellInTerminal(buf)