summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2023-01-05 06:11:14 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2023-01-05 21:59:15 -0300
commitaea8747a2d787ef9954e56b81ce451322e72322e (patch)
tree6e40df9b7254bd123b91004bcf149377a97fc00f
parente0e96cbdce6276b657f2483ec5f8dfd8cf1dfb52 (diff)
downloadhighline-aea8747a2d787ef9954e56b81ce451322e72322e.tar.gz
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/
-rw-r--r--lib/highline/terminal/io_console.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/highline/terminal/io_console.rb b/lib/highline/terminal/io_console.rb
index d28ee0d..9374f09 100644
--- a/lib/highline/terminal/io_console.rb
+++ b/lib/highline/terminal/io_console.rb
@@ -27,7 +27,7 @@ class HighLine
# (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