Skip to content
Discussion options

You must be logged in to vote

This is a known quirk of how ExecProcess hands off to the external process. When bubbletea suspends its renderer and passes control to the child process, the terminal still has whatever was last drawn in it — the new process hasn't written anything yet, so for a few milliseconds you see the stale content.

tea.Sequence(tea.ClearScreen, diffCmd) doesn't reliably fix this because the clear is queued through bubbletea's renderer and may not be flushed to the terminal before the handoff happens.

The straightforward workaround is to clear the screen inside the command itself:

func openDiff(sha string) tea.Cmd {
    c := exec.Command("bash", "-c", "printf '\\033[2J\\033[H' && git show "+sha+" | …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by flaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants