mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #520] Use of "[-:-:-]" resets to the terminal's background colour not TextView's background colour #377
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#377
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 @berrange on GitHub (Nov 4, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/520
Consider the following code snippet:
I was expecting this to display "Hello" and "again" using the default TextView colour scheme producing white text on black backround, and "world" using red text, green background.
What actually happens though is that "again" is displayed white text, light gray background. The "white" text is the TextView colour scheme, but the "light gray" appears to be my terminal's default background colour.
Am I misunderstanding what "-" means? I was expecting it t reset to TextView's default background colour, not my terminal's default background colour.
@rivo commented on GitHub (Nov 18, 2020):
I cannot reproduce this:
Is this with the latest version of
tview?@berrange commented on GitHub (Nov 18, 2020):
Yes, same scenario as my other issue #521, I'm using latst tview git as of right now, with Fedora 33, x86_64, with GNOME Terminal (gnome-terminal-3.38.1-1.fc33.x86_64).
Normally I'm using a white-ish background, and black text, but for this screenshot I've set my terminal background to pink, to make it obvious that the borders are inheriting the terminal's default background colour instead of any tview colour theme:

@rivo commented on GitHub (Mar 12, 2021):
It turns out that the definition of
tcell.ColorDefaulthas changed. It used to mean "transparent". So when you used this as a background colour somewhere, it would not change the existing background colour. Now it's different: It means "the terminal's default background colour". So it will always overwrite the background colour on screen.So the assumptions made in
tviewwere now wrong, especially when I instantiated a newtcell.Styleobject (it getstcell.ColorDefaultas its default colours and it doesn't mean "transparent" anymore).The latest commit should get rid of all the side effects of this
tcellchange. Please upgrade and let me know if it works as expected now.@mevdschee commented on GitHub (Mar 12, 2021):
This seems fixed to me. See: https://github.com/rivo/tview/issues/519#issuecomment-797680773
@rivo commented on GitHub (Mar 12, 2021):
Sounds good, thank you.