Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to display less on alternate screen #2171

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thomaswuensche
Copy link

Currently, Pry passes the -X option to less in the class SystemPager, which 'Disables sending the termcap initialization and deinitialization strings to the terminal'. This means that paging happens on the main screen and its contents will stay there after quitting less.

For me, having less displayed on the alternate screen of the terminal is very useful, because it de-clutters my main screen. For example, if I look at an API response in a Pry session, I often page through a lot of data and then return to the REPL, but whatever I was looking at before is now overwritten by the contents of the API response. By displaying less on the alternate screen, I can quickly return to the previous context.

However, I don't want to change any existing behaviour or already established workflows, so this PR adds a config option.
This way, one can just set Pry.config.less_alt_screen = true in .pryrc and less will be displayed on the alternate screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant