Handle negative value in padding (#3389)
this might happen depending on the way the $stderr.winsize is defined. If the expression "$stderr.winsize[1] - line.size" in Line 114 gets negative, we will get a "negative argument" exception in the padding calculation
This commit is contained in:
parent
c09b0e0c4c
commit
7745fcf328
|
|
@ -94,7 +94,7 @@ module Whisper
|
|||
end
|
||||
|
||||
def show_progress(current, size)
|
||||
progress_rate_available = size && $stderr.tty?
|
||||
progress_rate_available = size && $stderr.tty? && $stderr.winsize[1] >= line.size
|
||||
|
||||
unless @prev
|
||||
@prev = Time.now
|
||||
|
|
|
|||
Loading…
Reference in New Issue