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
IRB's pager and in ri command, I think we don't need to use this escape sequence.
The situation that needs force enable alternate screen mode and restore screen only happens when called from show_doc_dialog_proc.
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 suremore
is not aliased toless
)PAGER="sh -c 'cat;sleep 1'" irb