Area does not clear properly when calling `area.update()`
Open
Nobody has claimed this yet.
bug
- Dominant language
- Go
- Stars
- 5.5k
- Forks
- 221
- PR merge metrics
- No merged PRs in 30d
Description
I have this code:
messageArea := pterm.DefaultArea
messageArea.Start()
err = a.chatService.ExecuteChat(
ctx,
activeBranch.ID,
msg,
a.config,
func(s string) {
messageBuffer.Write([]byte(s))
messageArea.Update(messageBuffer.String())
},
)
And when calling the function, messageArea.Update() leaves previous text on the screen when writing the updated content:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the implementation of messageArea.Update() and reproduce the issue with the provided DefaultArea and messageBuffer example. Verify that successive updates remove leftover text from the terminal, including when the new content is shorter than the previous content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100