diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-26 22:02:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-26 22:02:51 +0200 |
commit | 13ebb03e7520c2c34f93444b0146640ca08e7424 (patch) | |
tree | 6a56af98898e32e5aa48fb80fb5fce1248e1ec24 /src/testdir | |
parent | dde81312b031211752d1fcb8539d79f90f324a2e (diff) | |
download | vim-13ebb03e7520c2c34f93444b0146640ca08e7424.zip |
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.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_terminal.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 2356f2c53..d651d0bba 100644 --- 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 |