rivo / tview

Terminal UI library with rich, interactive widgets — written in Golang
MIT License
11.11k stars 576 forks source link

Is there an easy way to capture "final" output? #1008

Closed aronchick closed 1 month ago

aronchick commented 4 months ago

When i'm drawing, and then quit, the screen wipes. This is fine, but i'd like to capture the last rendered state, and display it after exiting. I can't seem to find this anywhere - is there guidance how to do it?

rivo commented 3 months ago

This is a property of the tcell package.

I suppose you could supply your own Screen object using SetScreen() and extract the contents after your program exits.

aronchick commented 3 months ago

Oh fascinating - does screen have a string buffer like object that I could use to render to the console?

On Sun, Aug 4, 2024 at 07:03 rivo @.***> wrote:

This is a property of the tcell https://github.com/gdamore/tcell package.

I suppose you could supply your own Screen object using SetScreen() https://pkg.go.dev/github.com/rivo/tview#Application.SetScreen and extract the contents after your program exits.

— Reply to this email directly, view it on GitHub https://github.com/rivo/tview/issues/1008#issuecomment-2267501041, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMQ5P7TRXZ4AB33ASO5XTZPYDBBAVCNFSM6AAAAABK64OAJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGUYDCMBUGE . You are receiving this because you authored the thread.Message ID: @.***>

rivo commented 3 months ago

Check the documentation:

https://pkg.go.dev/github.com/gdamore/tcell/v2#Screen

aronchick commented 1 month ago

I ended up just grabbing the final buffer and printing it.