Skip to content
Myr

Fix #494 - _fzf_complete hangs on zsh when not using tmux pane

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent e57182c · Browse files · 2 files+45 added−17 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+45 added−17 removed

  • tests:+34 added−15 removed
  • other:+11 added−2 removed

2 files+45 added−17 removed

modified:shell/completion.zsh+11 added-2 removed
modified:test/test_go.rb+34 added-15 removed
1138 unmodified lines
11391140private1141 def writelines path, lines1142 File.unlink path while File.exists? path1143 File.open(path, 'w') { |f| f << lines.join($/) }1143 File.open(path, 'w') { |f| f << lines.join($/) + $/ }1144 end1145end11461147module TestShell
206 unmodified lines
1354 tmux.until do |lines|1355 tmux.send_keys 'C-L'1356 lines[-1] == "kill #{pid}"1357 end13581359 def test_custom_completion1360 tmux.send_keys '_fzf_compgen_path() { echo "\$1"; seq 10; }', :Enter1361 tmux.prepare1362 tmux.send_keys 'ls /tmp/**', :Tab, pane: 01363 tmux.until(1) { |lines| lines.item_count == 11 }1364 tmux.send_keys :BTab, :BTab, :BTab1365 tmux.until(1) { |lines| lines[-2].include? '(3)' }1366 tmux.send_keys :Enter1367 tmux.until do |lines|1368 tmux.send_keys 'C-L'1369 lines[-1] == "ls /tmp 1 2"1370 end1371 end1358 ensure1359 Process.kill 'KILL', pid.to_i rescue nil if pid1360 end13611362 def test_custom_completion1363 tmux.send_keys '_fzf_compgen_path() { echo "\$1"; seq 10; }', :Enter1364 tmux.prepare1365 tmux.send_keys 'ls /tmp/**', :Tab, pane: 01366 tmux.until(1) { |lines| lines.item_count == 11 }1367 tmux.send_keys :BTab, :BTab, :BTab1368 tmux.until(1) { |lines| lines[-2].include? '(3)' }1369 tmux.send_keys :Enter1370 tmux.until do |lines|1371 tmux.send_keys 'C-L'1372 lines[-1] == "ls /tmp 1 2"1373 end1374 end13751376 def test_unset_completion1377 tmux.send_keys 'export FOO=BAR', :Enter1378 tmux.prepare13791380 # Using tmux1381 tmux.send_keys 'unset FOO**', :Tab, pane: 01382 tmux.until(1) { |lines| lines[-2].include? ' 1/' }1383 tmux.send_keys :Enter1384 tmux.until { |lines| lines[-1] == 'unset FOO' }1385 tmux.send_keys 'C-c'13861387 # FZF_TMUX=01388 new_shell1389 tmux.send_keys 'unset FOO**', :Tab1390 tmux.until { |lines| lines[-2].include? ' 1/' }1391 tmux.send_keys :Enter1392 tmux.until { |lines| lines[-1] == 'unset FOO' }1393 end1394end13951396class TestBash < TestBase1397 include TestShell
50 unmodified lines