patch 8.0.1761: job in terminal window with no output channel is killed
Problem: Job in terminal window with no output channel is killed.
Solution: Keep the job running when the input is a tty. (Ozaki Kiichi,
closes #2734)
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 805fa8d..ec8111e 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1848,3 +1848,14 @@
call assert_match("%s%s", text[2])
call delete('Xlog')
endfunc
+
+func Test_keep_pty_open()
+ if !has('unix')
+ return
+ endif
+
+ let job = job_start(s:python . ' -c "import time;time.sleep(0.2)"', {'out_io': 'null', 'err_io': 'null', 'pty': 1})
+ let elapsed = WaitFor({-> job_status(job) ==# 'dead'})
+ call assert_inrange(200, 1000, elapsed)
+ call job_stop(job)
+endfunc