diff src/testdir/test_terminal.vim @ 12240:24abce52ad20 v8.0.1000

patch 8.0.1000: cannot open a terminal without running a job in it commit https://github.com/vim/vim/commit/13ebb03e7520c2c34f93444b0146640ca08e7424 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 26 22:02:51 2017 +0200 patch 8.0.1000: cannot open a terminal without running a job in it Problem: Cannot open a terminal without running a job in it. Solution: Make ":terminal NONE" open a terminal with a pty.
author Christian Brabandt <cb@256bit.org>
date Sat, 26 Aug 2017 22:15:04 +0200
parents 42823852a212
children eddd5ea01116
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -505,3 +505,23 @@ func Test_terminal_write_stdin()
 
   bwipe!
 endfunc
+
+func Test_terminal_no_cmd()
+  " Todo: make this work on all systems.
+  if !has('unix')
+    return
+  endif
+  " Todo: make this work in the GUI
+  if !has('gui_running')
+    return
+  endif
+  let buf = term_start('NONE', {})
+  call assert_notequal(0, buf)
+
+  let pty = job_info(term_getjob(buf))['tty']
+  call assert_notequal('', pty)
+  call system('echo "look here" > ' . pty)
+  call term_wait(buf)
+  call assert_equal('look here', term_getline(buf, 1))
+  bwipe!
+endfunc