irb
irb copied to clipboard
Always use alternate sceen on alt-d
Fixes screen corruption when PAGER=more is used.
When ALT+D is pressed while showing document dialog, document in shown in full screen using pager. IRB assumes that the pager switches to alternate screen, turns off alternate screen at exit, and restore IRB's screen.
Some pager like more does not do that. Screen corrupts. We need to switch to alternate screen manually.
To reproduce:
PAGER=more irb (make sure more is not aliased to less)
PAGER="sh -c 'cat;sleep 1'" irb