1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Add Pry.auto_resize! to respond to width changes.

- Opt-in because we aren't sure where it doesn't work
- Not Coolline-aware
- Otherwise a big improvement
This commit is contained in:
☈king 2012-10-27 08:51:51 +00:00 committed by rking@sharpsaw.org
parent fd392b65fb
commit 5b346bc447

View file

@ -257,6 +257,14 @@ class Pry
end
end
def self.auto_resize!
trap :WINCH do
size = `stty size`.split(/\s+/).map &:to_i
Readline.set_screen_size *size
Readline.refresh_line
end
end
def self.set_config_defaults
config.input = Readline
config.output = $stdout