From 97204e1cef4f922cc1f8e67f8a1f2f695d7da826 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 30 Sep 2016 02:33:50 +0200 Subject: os/shell: Throttle :! output, pulse "..." message. Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly improves responsiveness when :! spams MB or GB of output: :!yes :!while true; do date; done :!git grep '' :grep -r '' * After ~10KB of data is seen from a single :! invocation, output will be skipped for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the behavior alternates at every: * 10KB received * ~1s throttled This also avoids out-of-memory which could happen with large :! outputs. Note: This commit does not change the behavior of execute(':!foo'). execute(':!foo') returns the string ':!foo^M', it captures *only* Vim messages, *not* shell command output. Vim behaves the same way. Use system('foo') for capturing shell command output. Closes #1234 Helped-by: oni-link --- test/functional/terminal/helpers.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'test/functional/terminal/helpers.lua') diff --git a/test/functional/terminal/helpers.lua b/test/functional/terminal/helpers.lua index aacf109f2f..ae5e6d4b1f 100644 --- a/test/functional/terminal/helpers.lua +++ b/test/functional/terminal/helpers.lua @@ -51,6 +51,7 @@ local function screen_setup(extra_height, command) [7] = {foreground = 130}, [8] = {foreground = 15, background = 1}, -- error message [9] = {foreground = 4}, + [10] = {foreground = 2}, -- "Press ENTER" in embedded :terminal session. }) screen:attach({rgb=false}) -- cgit