From aea8747a2d787ef9954e56b81ce451322e72322e Mon Sep 17 00:00:00 2001 From: "Abinoam P. Marques Jr" Date: Thu, 5 Jan 2023 06:11:14 -0300 Subject: [PATCH] Handle interrupts directly at io/console Added to io/console at commit at 24, September, 2019 * https://github.com/ruby/io-console/commit/7cba76561a39722fbcee3a65d4d6b8bc6f15df67 Released in Ruby 2.7.0, released at 25, December, 2019 * https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/ Documented at 17, February, 2020 * https://github.com/ruby/io-console/commit/82b630cd79594339d4b05ebe211f47d62dbe1fc5 Documented in Ruby 2.7.1, released at 31, March, 2020 * https://ruby-doc.org/stdlib-2.7.1/libdoc/io/console/rdoc/IO.html#method-i-getch * https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-7-1-released/ --- lib/highline/terminal/io_console.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/highline/terminal/io_console.rb b/lib/highline/terminal/io_console.rb index d28ee0d2..9374f091 100644 --- a/lib/highline/terminal/io_console.rb +++ b/lib/highline/terminal/io_console.rb @@ -27,7 +27,7 @@ def restore_mode # (see Terminal#get_character) def get_character - input.getch # from ruby io/console + input.getch(intr: true) # from ruby io/console rescue Errno::ENOTTY input.getc end