mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #603] want a way to invalidate the screen #444
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#444
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gdamore on GitHub (May 19, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/603
It's common to be able to force a redraw of the screen in apps with "Control-L" (this is a UNIXism). The reason for this is that you might have other programs that have written to the screen in the background, and you want to clear the "damage".
Tcell offers an invalidation function for this (screen.Sync()) which basically tells tcell to ignore it's cached idea of the screen and assume it has to redraw everything from scratch. (Obviously you don't want to do this often.)
I'd like this to be exposed -- ideally something like Application.Refresh() or ForceRefresh() or something.
For now I can hack around it by calling Suspend() with an empty function.
(Btw, so far I'm finding tview is pretty nice -- I'm using it to build some other apps, so thanks for making it!)
@rivo commented on GitHub (May 28, 2021):
Thanks! Glad you like it. (Now you know where all these weird requests of that @rivo guy are coming from, hehe.)
I had forgotten about
Screen.Sync()and to be honest, in my tests, the screen was never corrupted. But it surely makes sense. I've included anApplication.Sync()function now. I don't bind it to any key by default as I feel that's up to the users of the package to decide for themselves. (I'm familiar with Ctrl-L inbashbut it simply clears the screen instead of syncing it.)@gdamore commented on GitHub (May 29, 2021):
Thanks. CTRL- L is used my many many curses applications for this purpose. Including vi. It has a long history of this usage. Bash doesn’t do more because it isn’t screen oriented.
Get Outlookhttps://aka.ms/qtex0l for iOS
From: rivo @.>
Sent: Friday, May 28, 2021 11:57:29 AM
To: rivo/tview @.>
Cc: gdamore @.>; Author @.>
Subject: Re: [rivo/tview] want a way to invalidate the screen (#603)
Thanks! Glad you like it. (Now you know where all these weird requests of that @rivohttps://github.com/rivo guy are coming from, hehe.)
I had forgotten about Screen.Sync() and to be honest, in my tests, the screen was never corrupted. But it surely makes sense. I've included an Application.Sync() function now. I don't bind it to any key by default as I feel that's up to the users of the package to decide for themselves. (I'm familiar with Ctrl-L in bash but it simply clears the screen instead of syncing it.)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/rivo/tview/issues/603#issuecomment-850607028, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJ4G7I33P7I4SHEEY6ZZCTTP7RRTANCNFSM45FTZUDQ.