Yomguithereal / react-blessed

A react renderer for blessed.
MIT License
4.45k stars 177 forks source link

Keep the screen content after exit #109

Closed TiagoGouvea closed 4 years ago

TiagoGouvea commented 4 years ago

React Blessed is a such amazing lib! Thank you for that! 💪

I want to draw some content during a build process, that will not stop to interact with the app. For that I need keep the content "printed" on screen after the process.exit, other than clear the screen.

Is it possible?

Thanks, any help would be greatlly appreciated

Yomguithereal commented 4 years ago

Hello @TiagoGouvea, interesting question. I think a solution can be found on the blessed side. I think you need to find a way to "dump" or "draw" the blessed UI to stdout when you detect that the process will exit or when you know it will do so by closing the UI yourself and dumping its content. Sorry to be of little help but I don't remember the internal of blessed enough to help you more but I'd wager it is doable even when using react-blessed without requiring any addition. Tell me if you find the solution as I'd be interested to know how you did it.

TiagoGouvea commented 4 years ago

Thanks @Yomguithereal for the fast reply.

I thought it, use the log or some like that to printout the results, but I guess I would lose colors and some formating.

I will investigate more, and if I find a solution I will bring it here.

Thanks

Yomguithereal commented 4 years ago

I guess you could also try to monkeypatch the screen.destroy method and such but writing it it certainly looks like a perilous idea :)

TiagoGouvea commented 4 years ago

I changed my mind. The user will see the information (rendered) and press enter. This way I don't need to print and keep it on stdout.

Thanks @Yomguithereal