lib/textbringer/commands.rb in textbringer-0.1.0 vs lib/textbringer/commands.rb in textbringer-0.1.1

- old
+ new

@@ -634,11 +634,11 @@ buffer.read_only = false buffer.clear Window.redisplay signals = [:INT, :TERM, :KILL] begin - Open3.popen2e(cmd) do |input, output, wait_thread| + Open3.popen2e(cmd, pgroup: true) do |input, output, wait_thread| input.close loop do status = output.wait_readable(0.5) if status == false break # EOF @@ -658,10 +658,10 @@ if signals.empty? keyboard_quit else sig = signals.shift message("Send #{sig} to #{wait_thread.pid}") - Process.kill(sig, wait_thread.pid) + Process.kill(sig, -wait_thread.pid) end end end status = wait_thread.value pid = status.pid