Skip to content

Add a way to persist the alternate screen on exit - #128

Closed
benbrittain wants to merge 1 commit into
AMythicDev:mainfrom
benbrittain:persist-alternate
Closed

Add a way to persist the alternate screen on exit#128
benbrittain wants to merge 1 commit into
AMythicDev:mainfrom
benbrittain:persist-alternate

Conversation

@benbrittain

Copy link
Copy Markdown

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

Comment threadsrc/core/commands.rs Outdated
@AMythicDevAMythicDev 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
Copy Markdown
Owner

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

@benbrittainbenbrittain mentioned this pull request Feb 12, 2024
@AMythicDev

AMythicDev commented Feb 21, 2024

Copy link
Copy Markdown
Owner

@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.

@AMythicDev

Copy link
Copy Markdown
Owner

Closed for being stale

@github-project-automationgithub-project-automationBot moved this from In Progress ⚒️ to Done ✅ in minus RoadmapMay 9, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-apiInternal API changeO-dynamicDynamic outputO-staticStatic output displayedX-api-addAddition to the external api; No risk of downstream breakage

Projects

Status: Done ✅

Development

Successfully merging this pull request may close these issues.

2 participants

@benbrittain@AMythicDev