From b5b1fab2f1d2beaff4c06f7776e4d8318dbfd3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Fri, 10 May 2024 04:06:40 -0500 Subject: [PATCH 1/2] Catches exceptions Errno::ENODEV and Errno::EBADF in get_screen_size. Closes #690 --- lib/reline/ansi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index 45a475a787..b7bbe50a2c 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -235,7 +235,7 @@ def self.get_screen_size s = [ENV["LINES"].to_i, ENV["COLUMNS"].to_i] return s if s[0] > 0 && s[1] > 0 [24, 80] - rescue Errno::ENOTTY + rescue Errno::ENOTTY, Errno::ENODEV, Errno::EBADF [24, 80] end From eb4bf7eeb2434ee9620bcc4d3cf30e6a207ca7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Sun, 19 May 2024 13:59:35 -0500 Subject: [PATCH 2/2] Just catching Errno::ENOTTY and Errno::ENODEV --- lib/reline/ansi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index b7bbe50a2c..fa9feb2630 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -235,7 +235,7 @@ def self.get_screen_size s = [ENV["LINES"].to_i, ENV["COLUMNS"].to_i] return s if s[0] > 0 && s[1] > 0 [24, 80] - rescue Errno::ENOTTY, Errno::ENODEV, Errno::EBADF + rescue Errno::ENOTTY, Errno::ENODEV [24, 80] end