aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline/line_editor.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-08-29 14:36:45 +0900
committeraycabta <aycabta@gmail.com>2019-08-29 14:37:19 +0900
commit0f405541bfe5186c068c4521d815b64b82e1ae5e (patch)
treee4b9e665c0bb7ad2c0cf747fb2690044588cf2c1 /lib/reline/line_editor.rb
parent682aaf6af5ff345897a9128bb19e0b17b71426a6 (diff)
downloadruby-0f405541bfe5186c068c4521d815b64b82e1ae5e.tar.gz
Support SIGWINCH
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r--lib/reline/line_editor.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 16736e025a..a1ec01d3c1 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -69,6 +69,10 @@ class Reline::LineEditor
Reline::IOGate.move_cursor_column(0)
@old_trap.call if @old_trap.respond_to?(:call) # can also be string, ex: "DEFAULT"
}
+ Reline::IOGate.set_winch_handler do
+ @rest_height = (Reline::IOGate.get_screen_size.first - 1) - Reline::IOGate.cursor_pos.y
+ @screen_size = Reline::IOGate.get_screen_size
+ end
end
def finalize