summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-10-23 21:37:20 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2020-10-23 21:37:20 +0900
commita4d9b0b468b872180cbfa851be236098756b5e62 (patch)
treee46a5d679ad68feda614b891c5260546beac2e11 /test
parente2b87e0d741111fd1f437f8e06f8286d9ef47dff (diff)
Support ANSI escape sequence for clearing display in preview window
fzf --preview 'for i in $(seq 100000); do (( i % 200 == 0 )) && printf "\033[2J" echo "$i" sleep 0.01 done'
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 2861235e..3ff118c1 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -1817,6 +1817,12 @@ class TestGoFZF < TestBase
assert_equal %w[A Á], `#{echoes} | #{FZF} -f A`.lines.map(&:chomp)
assert_equal %w[Á], `#{echoes} | #{FZF} -f Á`.lines.map(&:chomp)
end
+
+ def test_preview_clear_screen
+ tmux.send_keys %{seq 100 | #{FZF} --preview 'for i in $(seq 300); do (( i % 200 == 0 )) && printf "\\033[2J"; echo "[$i]"; sleep 0.001; done'}, :Enter
+ tmux.until { |lines| lines.item_count == 100 }
+ tmux.until { |lines| lines[1]&.include?('[200]') }
+ end
end
module TestShell