-
Notifications
You must be signed in to change notification settings - Fork 156
Prevent (most) output of >= in Windows #1992
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
Conversation
src/term.c
Outdated
@@ -1733,12 +1735,12 @@ static int cmd_config(const PROGRAMMER *pgm, const AVRPART *p, int argc, const c | |||
"to show that of <property>. Wildcards or initial strings are permitted (but\n" | |||
"not both), in which case all settings of matching properties are displayed.\n" | |||
"\n" | |||
"avrdude> config <property>=\n" | |||
"avrdude> config <property>" SPBS "=\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would have preferred a space around the equation sign
avrdude> config <property> = …\n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is my preference as well, but @stefanrueger seems to say it does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have preferred it in the syntax as well. ;-)
Of course, I think it is stupid of any shell to (mis)interpret the characters that have been printed by an application in their own way, but that's a different story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have preferred it in the syntax as well. ;-)
🤣 That's a whole different kettle of fish. Changing the syntax of AVRDUDE in order to modify the help text is like the tail wagging the dog, but, really, changing the syntax makes the parsing a bit involved. I'd rather get to the bottom of this.
shell to (mis)interpret the characters
I suspect, but don't know, it's the display or window manager and not actually the shell.
@mcuee How does the output look when you compile and run the following C program?
#include <stdio.h>
int main() {
printf(" -xsleep=<n> where <n>=1...666 is the sleep duration in ms\n");
}
(Bracing myself to see 666 being replaced with a devil emoji ...) Do you get the original ASCII when you cut the output from the window and paste it into the comment box here? Does any of this change when you set the locale to C as in, eg,
$ LC_ALL=C a.out
Is there an option for your shell or window manager for ASCII rather than UTF-8? An option for fixed-width teletype fonts? I mean, there must be a way for above simple program to print ASCII, not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and what else get's replaced in your environment? <=
? !=
? <>
? ><
? ...
? 2^3
? ... There must be documentation for that kind of stuff, not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you get the original ASCII when you cut the output from the window and paste it into the comment box here?
Yes, that is the intersting part. Looks like it has more to do with the display and not related to the Windows Powershell or CMD command processor here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under PowerShell of the problematic Windows 11 23H2 laptop.
Copy/paste the output -- Okay
C:\work\avr\avrdude_test> cat .\test_geq.c
#include <stdio.h>
int main() {
printf(" -xsleep=<n> where <n>=1...666 is the sleep duration in ms\n");
}
C:\work\avr\avrdude_test> .\test_geq.exe
-xsleep=<n> where <n>=1...666 is the sleep duration in ms
C:\work\avr\avrdude_test>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System Locale is already US English.
https://learn.microsoft.com/en-us/powershell/module/international/get-winsystemlocale?view=windowsserver2025-ps
C:\work\avr\avrdude_test> Get-WinSystemLocale
LCID Name DisplayName
---- ---- -----------
1033 en-US English (United States)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test C code.
#include <stdio.h>
int main() {
printf(" <n> where n >=1 \n");
printf(" <n> where n <=1 \n");
printf(" <n> where n !=1 \n");
printf(" <n> where n <>1 \n");
printf(" <n> where n ><1 \n");
printf(" <n> where n =1...3 \n");
printf(" <n> where n =2^3 \n");
}
Powershell display of the above code and execution result -- not okay
Copy-paste seems to be okay.
C:\work\avr\avrdude_test> cat .\test_display.c
#include <stdio.h>
int main() {
printf(" <n> where n >=1 \n");
printf(" <n> where n <=1 \n");
printf(" <n> where n !=1 \n");
printf(" <n> where n <>1 \n");
printf(" <n> where n ><1 \n");
printf(" <n> where n =1...3 \n");
printf(" <n> where n =2^3 \n");
}
C:\work\avr\avrdude_test> .\test_display.exe
<n> where n >=1
<n> where n <=1
<n> where n !=1
<n> where n <>1
<n> where n ><1
<n> where n =1...3
<n> where n =2^3
More tests under Windows 11 23H2 (upgraded from Windows 10). Got issues
Got no issues --> 3) 4) and 5) are kind of interesting.
|
Seeing that the space-backspace sequence doesn't help, this PR has now replaced the last commit with a verbal description of the trailing
|
From the above, it seems to say the issue is more with the display and not with the shell (Powershell or CMD). More over, I cannot reproduce the issue with my laptop running Windows 11 Home 24H2 using git main. And this PR is good too. I will check further on the laptop which has the issue (Windows 11 Enterprise 23H2). |
This PR is good. Tested with both PowerShell and CMD under Windows 11 23H2 laptop which had the issue before. |
@mcuee Thanks! Given the many different combinations that get misrepresented, we cannot make AVRDUDE avoid all these. Will merge this PR |
Yes, this PR is good to go. |
Interestingly Git Bash inside Windows Terminal got the same issue as PowerShell/CMD inside Windows Terminal. |
In the end, it is a problem with Windows Terminal for certain version of Windows. Windows Console Host is okay. The Shell may not play a part.
|
Thanks! I have slightly changed the Wiki to be more specific. I still think this is a not-our-problem issue, and I don't see a way of completely avoiding AVRDUDE output of I will keep this issue in mind when I do code review, though. |
I agree it is not really an avrdude issue. Microsoft may have already fixed the issue -- it could be that Windows Terminal is not the root cause but some other Window system component. As mentioned, I do not have such issue in another laptop running Windows 11 Home 24H2. Windows 23H2 is still widely used -- need to see if other users still have this issue or not on Windows 11 23H2/24H2. |
Fixes #1991