diff --git a/CHANGELOG.md b/CHANGELOG.md index c3feb3e..c1ed162 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log +## [Unreleased] + +### Fixed +* Fix "can't alloc thread" error in Command#run from non-main thread's rescue/ensure block + ## [v0.10.1] - 2021-02-14 ### Fixed diff --git a/lib/tty/command/process_runner.rb b/lib/tty/command/process_runner.rb index 0b6622f..454d25b 100644 --- a/lib/tty/command/process_runner.rb +++ b/lib/tty/command/process_runner.rb @@ -163,7 +163,7 @@ def read_streams(stdout, stderr) # # @api private def read_stream(stream, handler) - Thread.new do + Thread.start do if Thread.current.respond_to?(:report_on_exception) Thread.current.report_on_exception = false end