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 a way to persist the alternate screen on exit #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benbrittain
Copy link

I was looking for a way to get similar behavior to -X with less, where the buffer stays on screen after exit.

src/core/commands.rs Outdated Show resolved Hide resolved
@AMythicDev AMythicDev added O-static Static output displayed O-dynamic Dynamic output I-api Internal API change X-api-add Addition to the external api; No risk of downstream breakage labels Feb 11, 2024
@AMythicDev
Copy link
Owner

Could you please fix the code issues pointed by the CI so that I can further test it?

@benbrittain benbrittain mentioned this pull request Feb 12, 2024
@AMythicDev
Copy link
Owner

AMythicDev commented Feb 21, 2024

@benbrittain So I was busy for a while and I didn't get time to review this properly. Although you did most of the part correctly, you missed the mark in the actual implementation. The change that you did to cleanup() function causes the alternate screen to stay even after the pager is closed.

The alternate screen is meant to show complex UIs on the terminal without polluting the canonical screen whereas shells always run in the canonical screen. Its the sole responsibility of a program to start as well as exit the alternate screen so that the shell can continue running in the canonical screen.

By your approach we are not exiting the alternate screen and hence after quitting, the the shell continues to run in the alternate screen. This is an absolutely weird behavior and just a broken way to achieve the thing that you want. So I am not taking this right now until there's a better way of achieving the same effect or I get some more compelling reason to accept this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-api Internal API change O-dynamic Dynamic output O-static Static output displayed X-api-add Addition to the external api; No risk of downstream breakage
Projects
Status: In Progress ⚒️
Development

Successfully merging this pull request may close these issues.

2 participants