patch 8.0.0846: cannot get the name of the pty of a job
Problem: Cannot get the name of the pty of a job.
Solution: Add the "tty" entry to the job info. (Ozaki Kiichi, closes #1920)
Add the term_gettty() function.
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 48ee1c4..cc5afc3 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -30,6 +30,12 @@
func Test_terminal_basic()
let buf = Run_shell_in_terminal()
+ if has("unix")
+ call assert_match("^/dev/", job_info(g:job).tty)
+ call assert_match("^/dev/", term_gettty(''))
+ else
+ call assert_equal("", job_info(g:job).tty)
+ endif
call Stop_shell_in_terminal(buf)
call term_wait(buf)