diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2020-10-23 21:37:20 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-10-23 21:37:20 +0900 |
commit | a4d9b0b468b872180cbfa851be236098756b5e62 (patch) | |
tree | e46a5d679ad68feda614b891c5260546beac2e11 /test | |
parent | e2b87e0d741111fd1f437f8e06f8286d9ef47dff (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-x | test/test_go.rb | 6 |
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 |