Lines Matching refs:buf
23 let buf = RunVimInTerminal('Xwinsize', {})
24 let win = bufwinid(buf)
25 call assert_equal([6, 40], term_getsize(buf))
32 call assert_equal([6, 40], term_getsize(buf))
36 call StopVimInTerminal(buf)
48 let buf = Run_shell_in_terminal({})
49 let win = bufwinid(buf)
50 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
51 call StopShellInTerminal(buf)
52 call TermWait(buf)
53 exe buf . 'bwipe'
56 let buf = Run_shell_in_terminal({})
57 let win = bufwinid(buf)
58 call assert_equal([7, winwidth(win)], term_getsize(buf))
59 call StopShellInTerminal(buf)
60 call TermWait(buf)
61 exe buf . 'bwipe'
64 let buf = Run_shell_in_terminal({})
65 let win = bufwinid(buf)
66 call assert_equal([winheight(win), 33], term_getsize(buf))
67 call StopShellInTerminal(buf)
68 call TermWait(buf)
69 exe buf . 'bwipe'
77 let buf = Run_shell_in_terminal({})
78 let win = bufwinid(buf)
81 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
86 call assert_equal([15, 60], term_getsize(buf))
93 call assert_equal([10, 50], term_getsize(buf))
97 call StopShellInTerminal(buf)
98 call TermWait(buf)
99 exe buf . 'bwipe'
102 let buf = Run_shell_in_terminal({})
103 let win = bufwinid(buf)
104 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
105 call StopShellInTerminal(buf)
106 call TermWait(buf)
107 exe buf . 'bwipe'
115 let buf = term_start(cmd, #{term_rows: 7, term_cols: 50})
116 call TermWait(buf)
117 call assert_equal([7, 50], term_getsize(buf))
118 exe "bwipe! " .. buf
120 let buf = term_start(cmd, #{term_cols: 50})
121 call TermWait(buf)
122 call assert_equal([5, 50], term_getsize(buf))
123 exe "bwipe! " .. buf
125 let buf = term_start(cmd, #{term_rows: 7})
126 call TermWait(buf)
127 call assert_equal([7, 43], term_getsize(buf))
128 exe "bwipe! " .. buf
137 let buf = term_start(cmd, #{hidden: 1, term_rows: 10})
139 call assert_equal([10, &columns], term_getsize(buf))
140 exe "bwipe! " .. buf
153 let buf = Run_shell_in_terminal({})
154 let termwin = bufwinid(buf)
182 let job = term_getjob(buf)
204 let buf = term_start(['./Xechoerrout.sh'], {'out_io': 'file', 'out_name': outfile})
206 call WaitFor({-> !empty(readfile(outfile)) && !empty(term_getline(buf, 1))})
208 call assert_equal('this is standard error', term_getline(buf, 1))
210 call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
211 exe buf . 'bwipe'
225 let buf = term_start('/bin/sh')
228 call WaitForAssert({-> assert_match(string(i), term_getline(buf, term_getcursor(buf)[0] - 1))})
241 exe buf . 'bwipe!'
250 let buf = bufnr()
253 call WaitForAssert({-> assert_notequal('', term_getline(buf, 1))})
262 call WaitForAssert({-> assert_notequal('', term_getline(buf, 3))})
274 call TermWait(buf)
288 let buf = Run_shell_in_terminal({'term_finish': 'close'})
289 call StopShellInTerminal(buf)
290 call TermWait(buf)
294 call assert_equal("", bufname(buf))
382 let buf = RunVimInTerminal('-S XtermNormal', {'rows': 8})
383 call TermWait(buf)
385 call term_sendkeys(buf, "\<C-W>N")
386 call term_sendkeys(buf, ":set number cursorline culopt=both\r")
387 call VerifyScreenDump(buf, 'Test_terminal_normal_1', {})
389 call term_sendkeys(buf, ":set culopt=number\r")
390 call VerifyScreenDump(buf, 'Test_terminal_normal_2', {})
392 call term_sendkeys(buf, ":set culopt=line\r")
393 call VerifyScreenDump(buf, 'Test_terminal_normal_3', {})
395 call assert_fails('call term_sendkeys(buf, [])', 'E730:')
396 call term_sendkeys(buf, "a:q!\<CR>:q\<CR>:q\<CR>")
397 call StopVimInTerminal(buf)
459 let buf = Run_shell_in_terminal({})
462 call WaitForAssert({-> assert_notequal('', term_getline(buf, 1))})
465 call term_sendkeys(buf, "echo -e '\\033[?25l'\r")
466 call WaitForAssert({-> assert_equal(0, term_getcursor(buf)[2].visible)})
469 call term_sendkeys(buf, "echo -e '\\033[?25h'\r")
470 call WaitForAssert({-> assert_equal(1, buf->term_getcursor()[2].visible)})
473 call WaitForAssert({-> assert_equal('', term_getcursor(buf)[2].color)})
474 call term_sendkeys(buf, "echo -e '\\033]12;blue\\007'\r")
475 call WaitForAssert({-> assert_equal('blue', term_getcursor(buf)[2].color)})
476 call term_sendkeys(buf, "echo -e '\\033]12;green\\007'\r")
477 call WaitForAssert({-> assert_equal('green', term_getcursor(buf)[2].color)})
480 call term_sendkeys(buf, "echo -e '\\033[1 q'\r")
482 \ [term_getcursor(buf)[2].blink, term_getcursor(buf)[2].shape])})
485 call term_sendkeys(buf, "echo -e '\\033[2 q'\r")
487 \ [term_getcursor(buf)[2].blink, term_getcursor(buf)[2].shape])})
490 call term_sendkeys(buf, "echo -e '\\033[3 q'\r")
492 \ [term_getcursor(buf)[2].blink, term_getcursor(buf)[2].shape])})
495 call term_sendkeys(buf, "echo -e '\\033[4 q'\r")
497 \ [term_getcursor(buf)[2].blink, term_getcursor(buf)[2].shape])})
500 call term_sendkeys(buf, "echo -e '\\033[5 q'\r")
502 \ [term_getcursor(buf)[2].blink, term_getcursor(buf)[2].shape])})
505 call term_sendkeys(buf, "echo -e '\\033[6 q'\r")
507 \ [term_getcursor(buf)[2].blink, term_getcursor(buf)[2].shape])})
509 call StopShellInTerminal(buf)
541 let buf = Run_shell_in_terminal({})
542 let gettty = term_gettty(buf)
546 call WaitForAssert({-> assert_notequal('', term_getline(buf, 1))})
547 call term_sendkeys(buf, "tty\r")
548 call WaitForAssert({-> assert_notequal('', term_getline(buf, 3))})
549 let tty = term_getline(buf, 2)
553 let gettty0 = term_gettty(buf, 0)
554 let gettty1 = term_gettty(buf, 1)
573 call assert_fails('call term_gettty(buf, 2)', 'E475:')
574 call assert_fails('call term_gettty(buf, -1)', 'E475:')
576 call assert_equal('', term_gettty(buf + 1))
578 call StopShellInTerminal(buf)
579 call TermWait(buf)
580 exe buf . 'bwipe'