Skip to content

RadioButton unicode circle display has a line through it #5721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
presstab opened this issue Apr 8, 2025 · 6 comments
Open

RadioButton unicode circle display has a line through it #5721

presstab opened this issue Apr 8, 2025 · 6 comments

Comments

@presstab
Copy link

presstab commented Apr 8, 2025

The bug

Issue: When using RadioButton in a RadioSet, the toggle glyph (●) renders with a visible horizontal line through it, making it appear broken or misaligned.

Image

Environment: Ubuntu 22.04.5 LTS using the default GNOME Terminal.

textual diagnose

Textual Diagnostics

Versions

Name Value
Textual 2.1.2
Rich 13.9.4

Python

Name Value
Version 3.10.12
Implementation CPython
Compiler GCC 11.4.0
Executable /usr/bin/python3

Operating System

Name Value
System Linux
Release 6.8.0-52-generic
Version #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2

Terminal

Name Value
Terminal Application GNOME Terminal
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=123, height=50
legacy_windows False
min_width 1
max_width 123
is_terminal True
encoding utf-8
max_height 50
justify None
overflow None
no_wrap False
highlight None
markup None
height None
Copy link

github-actions bot commented Apr 8, 2025

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@TomJGooding
Copy link
Contributor

TomJGooding commented Apr 8, 2025

The problem is that the circle glyph used for the radio button is missing in your terminal font - see #3091

Try a different terminal emulator or changing your terminal font to something with better Unicode support, such as DejaVu Sans Mono.

@presstab
Copy link
Author

presstab commented Apr 8, 2025

It renders the circle glyph with no issue when BUTTON_RIGHT is set to "" instead of its default of "▌" which causes the issue. This issue happens with other characters as well, for example changing BUTTON_INNER to "\u2794" shows the same issue, which is fixed by setting BUTTON_RIGHT to an empty string. See #5722

Image

Image

Image

Image

@presstab
Copy link
Author

presstab commented Apr 8, 2025

closing this, I suppose its a Ubuntu feature not a bug

@presstab presstab closed this as completed Apr 8, 2025
@willmcgugan willmcgugan reopened this Apr 9, 2025
@Textualize Textualize deleted a comment from github-actions bot Apr 9, 2025
@willmcgugan
Copy link
Collaborator

The issue seems to be that Gnome terminal is rendering that glyph too wide. Having one cell overlap with a subsequent cell just shouldn't happen. So I think the fault lies with GT.

But I don't like to pass the buck with such things. Even if Gnome fix it, it will be a long time before every user gets the update. So finding a workaround is desirable.

Unfortunately we can't make that change, as it would break the output on other terminals. Here are some alternative options as I see it.

Find an alternative glyph that happens to work across all terminals, and looks good.
Sniff the terminal and change only affected terminals. I generally don't like to do that, as it can be brittle. But it is an option.
I'm going to open the original issue, as it is still valid. We can move the discussion there.

@TomJGooding
Copy link
Contributor

TomJGooding commented Apr 10, 2025

The problem is there isn't any glyph that will work across all terminals. It really depends on the terminal font and the font fallback for missing glyphs. For example, there's countless issues about how Textual looks in the old Windows conhost, because it doesn't have any font fallback. The problem with the GNOME Terminal in Ubuntu is that its default monospace font (Ubuntu Mono) has limited Unicode support and its font fallback causes glyphs to overlap. If you change the terminal font to something with better Unicode support like DejaVu Sans Mono (which I think is the default terminal font in Fedora), then Textual will render much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants