Skip to content

Commit 23f0fc4

Browse files
committed
Fix #93 lag after exiting debug
1 parent 02f7586 commit 23f0fc4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/capybara/cuprite/driver.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def pause
330330
# In jRuby - STDIN returns immediately from select
331331
# see https://github.com/jruby/jruby/issues/1783
332332
read, write = IO.pipe
333-
Thread.new { IO.copy_stream(STDIN, write); write.close }
333+
thread = Thread.new { IO.copy_stream(STDIN, write); write.close }
334334

335335
STDERR.puts "Cuprite execution paused. Press enter (or run 'kill -CONT #{Process.pid}') to continue."
336336

@@ -346,6 +346,8 @@ def pause
346346
end
347347
end
348348
ensure
349+
thread.kill
350+
read.close
349351
trap("SIGCONT", old_trap) # Restore the previous signal handler, if there was one.
350352
STDERR.puts "Continuing"
351353
end

0 commit comments

Comments
 (0)