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:
parent
fd392b65fb
commit
5b346bc447
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue