[GH-ISSUE #603] want a way to invalidate the screen #444

Closed
opened 2026-03-04 01:05:03 +03:00 by kerem · 2 comments
Owner

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!)

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!)
kerem closed this issue 2026-03-04 01:05:04 +03:00
Author
Owner

@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 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.)

<!-- gh-comment-id:850607028 --> @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 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 <kbd>Ctrl-L</kbd> in `bash` but it simply clears the screen instead of syncing it.)
Author
Owner

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

<!-- gh-comment-id:850845382 --> @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 Outlook<https://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 @rivo<https://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 GitHub<https://github.com/rivo/tview/issues/603#issuecomment-850607028>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAJ4G7I33P7I4SHEEY6ZZCTTP7RRTANCNFSM45FTZUDQ>.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#444
No description provided.