From 7745fcf32846006128f16de429cfe1677c963b30 Mon Sep 17 00:00:00 2001 From: Treboko <159072184+Treboko@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:34:23 +0200 Subject: [PATCH] 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 --- bindings/ruby/lib/whisper/model/uri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/ruby/lib/whisper/model/uri.rb b/bindings/ruby/lib/whisper/model/uri.rb index 5bf5a098..d8a98699 100644 --- a/bindings/ruby/lib/whisper/model/uri.rb +++ b/bindings/ruby/lib/whisper/model/uri.rb @@ -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