fractaledmind / prompts

Beautiful and user-friendly forms for your command-line Ruby applications.
MIT License
112 stars 4 forks source link

Is there a way to persist the console? #5

Closed KonnorRogers closed 3 weeks ago

KonnorRogers commented 2 months ago

Its quite jarring the way it clears the console on every input. Is there a way to disable clearing the console between responses?

fractaledmind commented 2 months ago

What are you imagining? Simply appending "screens"? Scrolling the "screen" to the top, but allowing to scroll back up? Something else?

KonnorRogers commented 2 months ago

What are you imagining? Simply appending "screens"? Scrolling the "screen" to the top, but allowing to scroll back up? Something else?

In my head, appending screens like a typical CLI so I can scroll up and see my previous responses.

I hadn't thought about scrolling the current view to the top of the viewport, but still allow a user to scroll up and see previous screens but that could be reasonable.

fractaledmind commented 3 weeks ago

I can do this by changing erase_down in the Content class from OUTPUT.print "\e[J" to OUTPUT.print "\e[2J\e[H". I much prefer scrolling the current view to the top of the viewport, such that the user experience is the same, but I can see why allowing you to scroll up to see past screens is useful. I will make this change.