ruby / irb

interactive Ruby
BSD 2-Clause "Simplified" License
392 stars 119 forks source link

Always use alternate sceen on alt-d #988

Closed tompng closed 1 month ago

tompng commented 3 months ago

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.

irb_with_pager_eq_more To reproduce: PAGER=more irb (make sure more is not aliased to less) PAGER="sh -c 'cat;sleep 1'" irb

tompng commented 1 month ago

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.