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
1 changed files with 8 additions and 0 deletions

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