From 451c48a0926540fe42a307d222c733210551b1d0 Mon Sep 17 00:00:00 2001 From: 林千里 Date: Wed, 6 Jun 2018 14:36:19 +1000 Subject: terminal: flush vterm output buffer on pty output #8486 Fixes #4151 libvterm uses an "output buffer" for terminal reporting (e.g. \e[6n to report cursor position) Flush it in on_channel_output() not just terminal_send_key() See also this line from pangoterm: https://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/607/pangoterm.c#L2159 --- test/functional/terminal/ex_terminal_spec.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index 4f22f7385d..f98add41a0 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -47,6 +47,16 @@ describe(':terminal', function() ]]) end) + it("reads output buffer on terminal reporting #4151", function() + if helpers.pending_win32(pending) then return end + if iswin() then + feed_command([[terminal powershell -NoProfile -NoLogo -Command Write-Host -NoNewline "\"$([char]27)[6n\""; Start-Sleep -Milliseconds 500 ]]) + else + feed_command([[terminal printf '\e[6n'; sleep 0.5 ]]) + end + screen:expect('%^%[%[1;1R', nil, nil, nil, true) + end) + it("in normal-mode :split does not move cursor", function() if iswin() then feed_command([[terminal for /L \\%I in (1,0,2) do ( echo foo & ping -w 100 -n 1 127.0.0.1 > nul )]]) -- cgit