You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in #5862, the footer descriptions are unreadable when ansi_colors=True in the app. Unfortunately it looks like the footer colors were broken in Textual v3.1.0.
Having just learned about ansi_colors=True recently, I had assumed this was always a problem. If this is a new issue then I would also really like to see it fixed
@willmcgugan I did spend a fair while looking into this, but unless I'm missing something obvious, this isn't easy to track down. I'm happy to have another crack at it, but I'm afraid I'll need a hint!
so I did some digging into this myself. I found a kind of related solution, I believe. Which is that in my opinion, if there is a footer in the app then it shouldn't be affected by transparency. My guess would be that most people would expect that the footer will stay opaque. So, in my own testing I have done this
Now I have no idea if this would be acceptable, I'm just brainstorming. From what I can tell, most of Textual does not change when ansi_color is set to True? Most widgets retain their colors, its not dropping the entire app immediately down to 16 colors or anything like that.
So what I'm wondering here is, can we possibly just prevent the Footer from changing the background as I've done above? In my own testing in Windows Terminal, this basically solves the problem. Like I said I would expect that the footer stays opaque.
Ah, no I had not tried that. I was setting the ansi_color = True variable on the app. Either when creating an app with TextualApp(ansi_color=True).run() or by setting self.ansi_color = True on the app class.
It seems that using the ansi_color=True variable works and looks great, because its not dropping every color in the app down to 16 colors. Whereas setting self.theme = "textual-ansi" actually forces the entire app down to 16 colors. You should also try it out if you have not already to see the difference.
At this point I would like to recommend thinking of this as two different problems. Transparency with ansi_color=True looks great, because all its doing is enabling transparency without forcing the entire app down to 16 colors. self.theme = "textual-ansi" is doing the latter and creates and entirely new set of problems. It should be possible to enable transparency without forcing the app into 16 colors. I think a proper solution might need to account for both situations.
I deleted my previous post as it didn't really explain the problem.
Regardless of the theme, previously background: ansi_default worked the same in the Footer as all other widgets that set this in the :ansi pseudo class.
Activity
github-actions commentedon Jun 15, 2025
We found the following entries in the FAQ which you may find helpful:
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.
This is an automated reply, generated by FAQtory
brent-lidstone commentedon Jun 15, 2025
Having just learned about ansi_colors=True recently, I had assumed this was always a problem. If this is a new issue then I would also really like to see it fixed
willmcgugan commentedon Jun 16, 2025
Would either of you like to tackle this one? Ping me if you need any assistance.
TomJGooding commentedon Jun 24, 2025
@willmcgugan I did spend a fair while looking into this, but unless I'm missing something obvious, this isn't easy to track down. I'm happy to have another crack at it, but I'm afraid I'll need a hint!
brent-lidstone commentedon Jun 24, 2025
so I did some digging into this myself. I found a kind of related solution, I believe. Which is that in my opinion, if there is a footer in the app then it shouldn't be affected by transparency. My guess would be that most people would expect that the footer will stay opaque. So, in my own testing I have done this
Replacing at widgets/_footer.py line 144
textual/src/textual/widgets/_footer.py
Line 144 in 6e4f77b
Now I have no idea if this would be acceptable, I'm just brainstorming. From what I can tell, most of Textual does not change when ansi_color is set to True? Most widgets retain their colors, its not dropping the entire app immediately down to 16 colors or anything like that.
So what I'm wondering here is, can we possibly just prevent the Footer from changing the background as I've done above? In my own testing in Windows Terminal, this basically solves the problem. Like I said I would expect that the footer stays opaque.
TomJGooding commentedon Jun 24, 2025
@edward-jazzhands I don't think this is the fix I'm afraid. Have you tried also setting the theme to
textual-ansi?brent-lidstone commentedon Jun 24, 2025
Ah, no I had not tried that. I was setting the
ansi_color = Truevariable on the app. Either when creating an app withTextualApp(ansi_color=True).run()or by settingself.ansi_color = Trueon the app class.It seems that using the
ansi_color=Truevariable works and looks great, because its not dropping every color in the app down to 16 colors. Whereas settingself.theme = "textual-ansi"actually forces the entire app down to 16 colors. You should also try it out if you have not already to see the difference.At this point I would like to recommend thinking of this as two different problems. Transparency with ansi_color=True looks great, because all its doing is enabling transparency without forcing the entire app down to 16 colors.
self.theme = "textual-ansi"is doing the latter and creates and entirely new set of problems. It should be possible to enable transparency without forcing the app into 16 colors. I think a proper solution might need to account for both situations.TomJGooding commentedon Jun 24, 2025
I deleted my previous post as it didn't really explain the problem.
Regardless of the theme, previously
background: ansi_defaultworked the same in theFooteras all other widgets that set this in the:ansipseudo class.This ANSI theming isn't really documented (and according to the FAQ doesn't even exist!), so perhaps I have just misunderstood how this is supposed to work.
TomJGooding commentedon Sep 12, 2025
I've had another crack at this, but I'm afraid I still don't know how to fix it.
The
Footeris composed ofFooterKeywidgets. These render RichTextwhich gets converted to TextualContentobjects.The problem is that this converts the background
Color('default', ColorType.DEFAULT)toColor(217, 217, 217).Following the code path from
visual.py->content.py->style.py->color.py:textual/src/textual/color.py
Line 195 in 11580e9
The problem is that this will return the theme foreground color:
rich/color.py
When
background: ansi_default, presumably we don't actually want any background color?