-
Notifications
You must be signed in to change notification settings - Fork 826
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
Checkbox and RadioButton does not work with the latest version of Windows Terminal #1934
Comments
What appears to be happening is that the state is indeed changing, its just that Windows Terminal is displaying the cross and bullet characters as images rather than monochrome, which means the on and off state don't look any different. I think we can force the text version with a unicode trick. If we can't, we will have to pick different characters for Windows. |
So, testing here... given OS version Radio buttons are more or less as shown in the above screenshots. On the other hand checkboxes are perfectly fine and work just as they do in iTerm under macOS (although of course there's any number of font issues to worry about there too I would imagine). Now, taking this:
as an idea, which I take to mean this, it didn't fix anything for me with the radio buttons on Windows 11, instead making the layout of the screen have showing/hiding text artefacts on mouse hover. As a comparison I also tested HyperTerm on Windows 11 and without the "trick" it showed the same character problem, with the "trick" it totally threw off the composition of the whole of the app, with every line being off by one character. To be clear (admittedly quick and dirty) test I tried was this: diff --git a/src/textual/widgets/_toggle_button.py b/src/textual/widgets/_toggle_button.py
index 40be4e61..4a10827f 100644
--- a/src/textual/widgets/_toggle_button.py
+++ b/src/textual/widgets/_toggle_button.py
@@ -170,7 +170,7 @@ class ToggleButton(Static, can_focus=True):
return Text.assemble(
(self.BUTTON_LEFT, side_style),
- (self.BUTTON_INNER, button_style),
+ (self.BUTTON_INNER + "\ufe0e", button_style),
(self.BUTTON_RIGHT, side_style),
) on macOS in iTerm, with the above applied, it works just as before; that is it works as planned and adding this "trick" makes no difference (which is what we'd expect). I didn't test any other terminals on macOS (yet). Long story short: it looks like Windows Terminal on Windows 10 and 11 doesn't even behave the same, and the "trick" (assuming I did the quick test correctly) causes even further problems for Windows Terminal (or at least causes further problems for Textual on Windows Terminal). More testing to be done, of course. This was just a Saturday night idle curiosity quick test. |
That's correct I'm on Windows 10 |
Maybe related? microsoft/terminal#13110 (comment) |
Confirmed locally: using Windows Terminal:
We'll look for alternative characters first that are supported by Windows 10 and 11, in Windows Terminal (and of course which display fine on other operating systems and in the main terminals). |
See Textualize#1934. Simply put: the character that we were doesn't render well at all in Windows Terminal on Windows 10; while there are other options available, few seem to work well there either. So here we go for a bold X; this should render fine everywhere.
See Textualize#1934. Simply put: the character that we were using doesn't render well at all in Windows Terminal on Windows 10 or 11. This one isn't ideal as it sits a little low, at least in some environments. I want to try this one on for a wee bit and see how we feel about it. Honestly, I'm not 100% happy with it; but right now it's the least-worst option I've tried.
I'm interested in anything that works of course, but what are the other current options? I don't find the actual radio icon very appealing at all |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Neither clicking nor the key bindings work to change state using the examples from the documentation on https://github.com/microsoft/terminal/releases/tag/v1.17.1023
Checkbox
RadioButton
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: