tview icon indicating copy to clipboard operation
tview copied to clipboard

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

Open aronchick opened this issue 1 year ago • 3 comments

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?

aronchick avatar Jul 16 '24 15:07 aronchick

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.

rivo avatar Aug 04 '24 11:08 rivo

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

aronchick avatar Aug 04 '24 11:08 aronchick

Check the documentation:

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

rivo avatar Aug 06 '24 11:08 rivo

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

aronchick avatar Oct 16 '24 02:10 aronchick