mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #127] Question: dealing with textviews and terminal colors #99
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#99
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 @zaquestion on GitHub (Jun 1, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/127
I've got some code like this:
Printing to the
TextViewworks great, thanks for making it support theio.Writerinterface!That produces this, but the output (coming directly from an api call) is filled with these terminal color tags. I'm not sure where to even start on converting that to tview syntax, any thoughts would be appreciated. I could probably strip the color, but keeping it would be ideal.
@rivo commented on GitHub (Jun 1, 2018):
You'll want to create a new Writer with the
ANSIIWriter()function which wraps yourTextView. Then you write to that new Writer instead. Seehttps://godoc.org/github.com/rivo/tview#ANSIIWriter
for more information.
@zaquestion commented on GitHub (Jun 2, 2018):
THANK YOU, truly this is a great library and you are very helpful. ❤️
@JulienBreux commented on GitHub (Dec 26, 2025):
Same question in 2025
@ossenthusiast commented on GitHub (Dec 26, 2025):
It has already been answered.