-
Notifications
You must be signed in to change notification settings - Fork 252
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
Spinners in the examples don't render properly in the Windows Command Prompt #574
Comments
Hmm, okay. I don't think I'd be able to test this, but would be happy to review a PR if you are able to submit one. I think the main change here is that you'd want to change the default |
@djc I'd be happy to submit a PR soon. :) Thank you for linking me that file, by the way, I was looking for that before submitting this issue and couldn't find it. That said, I also think it may be useful if we could figure out a way to automatically detect unsupported characters - i.e. if the terminal supports it, we might default to the current braille characters, and otherwise default to a simple spinner using However, I have no idea how we might accurately figure that out - the only idea that comes to mind is to check for emoji support, and use the braille characters if that's true. |
Yeah, I don't know how you might figure it out, though emoji support is probably a decent proxy (for just general Unicode support, which I think is what missing for these spinner code points). And I definitely was not suggesting we should always use the non-Unicode characters by default -- only in contexts where Unicode is not properly supported. I personally don't have much context on how we'd figure that out, so I suggest you spend some time researching that aspect, for example by looking at the API of the console crate (and maybe other projects in the same space, like https://github.com/rust-cli/anstyle). |
@djc Gotcha. I'll consider researching the matter at some point, when I have some free time. For now, would replacing the default |
No, I don't want to regress this for all of today's users who have Unicode-capable terminals -- especially since this is the first time (as far as I recall) that anyone has complained about (which suggests this kind of usage is rare). |
It was less a complaint, and more a note that Command Prompt doesn't properly render the default However, I will note that this doesn't impact functionality at all - it only impacts how a shell program's output looks - which may be part of why nobody's ever brought it up. In any case, I'm unsure what I should do in my PR then. Would I check for emoji support, and decide between the current default (if emoji is supported) and a simple |
You might look into what console (https://github.com/console-rs/console) supports, which is what indicatif leverages for feature detection. |
Yup, that seems like a decent step forward. |
Right, so I looked further into this - just to make sure I know what I'm doing - and I think I know what I want to do now. The plan I have is thus: Use a It's worth noting that However, there's a problem with using the Thus, I'm inclined to go ahead with my current plan of using a |
I... think you're overthinking it. Just use |
I do tend to overthink things a bit, but I'm not sure this is one of those times. Let me explain. It is as you said: Emoji support is pretty much guaranteed to be the same between What isn't guaranteed to be the same, is whether both are considered to be "attended" - something which That's why I'm hesitant to use If you still think I should go ahead with |
Why do you think the support for attended is related to the support for emoji? If we're writing to a Unicode-capable non-attended stream, why shouldn't we use the Unicode tick strings? (Alternatively, |
Because we may not be writing to a Unicode-capable non-attended stream? I don't know if that's true, though - but I do know that
...I've mentioned several times that |
Sorry for not reading your message carefully. I also feel like I've told you several times what I think will be an adequate (if admittedly not perfect) solution and you keep pushing back, so I get a bit impatient (too?). I suggested this solution like 5 messages ago and as a volunteer maintainer you've taken a lot of round trips while, in my view, not adding any new (for me) insights to the conversation. If you want to go through and make sure that the tick strings match the current terminal's emoji support (but only if the tick strings haven't been changed from the default), I'll review that code, but I might shoot it down for adding too much complexity. I think there's a four-line fix here that is likely to be good enough (TM) for a large majority of cases. |
Frankly, I don't even want to interact here much more, after what felt like having my concerns be thrown to the wayside in favor of "why does that matter, just do this". I don't know when I'll get to it, but I'll try to get to this at some point in the future. |
I suppose I should mention, since it's been two months, that I have absolutely zero interest in pursuing this matter. If anyone wants to pursue this in my stead, I hope I've left enough information in this issue for you to figure out what to do. If I haven't, or if discussions need be had on something I've missed, please leave me out of the talking. |
Hi! This is fairly minor, but I noticed that some examples don't appear to show their spinners properly when run on the Windows Command Prompt. For example, with the
![image](https://private-user-images.githubusercontent.com/1008889/259010457-9407d068-a9a7-449c-a712-3b6173f8e8a3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Mjg0MDQsIm5iZiI6MTczOTgyODEwNCwicGF0aCI6Ii8xMDA4ODg5LzI1OTAxMDQ1Ny05NDA3ZDA2OC1hOWE3LTQ0OWMtYTcxMi0zYjYxNzNmOGU4YTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMjEzNTA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWYxNTBkMDMwZWQxZWMxNmE5NzQ2NjUxMDY4MDRhZjg5OTZlMGQxODA2NjI1Y2Y2MDdkOWM4NWQ2M2M3YzcyYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.5oPyNCPYlYdD_bm8jAaUEctzyvBk_aDH5Bs-M-QOd9U)
multi
example:As best as I can tell, this is due to using unsupported characters as the spinner. If I switch the spinner characters to
![image](https://private-user-images.githubusercontent.com/1008889/259012927-73402b4b-4744-4d22-8ade-f79e6dafb031.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Mjg0MDQsIm5iZiI6MTczOTgyODEwNCwicGF0aCI6Ii8xMDA4ODg5LzI1OTAxMjkyNy03MzQwMmI0Yi00NzQ0LTRkMjItOGFkZS1mNzllNmRhZmIwMzEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMjEzNTA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWFiMTA5MmQwZGUyNjE4MmE2NTAzOGVmOGIxMTAyMDgzMGY4MDI0MmRhNWIyMjVlYzc4ODMwYzQyMTllMGU3NiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.buyY2qnuRXIau_pr14S0FeUrDk6qojUVWhFzUmDbTHs)
"-\\|/ "
:then it appears to show up properly.
I'm unsure of how this might be fixed - but it would be appreciated if spinners could default to supported characters on shells that may not support them.
The text was updated successfully, but these errors were encountered: