Skip to content
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

KERNEL32.SetConsoleMode() raises OSError: [WinError 87] The parameter is incorrect. #5

Open
marph91 opened this issue Jul 31, 2024 · 7 comments

Comments

@marph91
Copy link

marph91 commented Jul 31, 2024

Hi,

a user of my app got an issue: marph91/jimmy#9

In short:

I couldn't reproduce it on my Windows VM with cmd.

Do you have any idea how to fix it?

@avylove
Copy link
Collaborator

avylove commented Jul 31, 2024

I'd guess their terminal doesn't support the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag. That's the case with older versions of Windows 10, but there is a check in that file to make sure they are using Windows 10 build number 10586 or newer. Can you ask them what version and build number they are using (Start -> Settings -> System -> About)?

@marph91
Copy link
Author

marph91 commented Jul 31, 2024

Thanks for the explanation. I forwarded the question.

Would it be possible to do some fallback/workaround (at enlighten) instead of raising the exception?

@avylove
Copy link
Collaborator

avylove commented Jul 31, 2024

The workaround would probably be in Jinxed to try ANSICON if the native support fails. However, it would be good to know if some condition isn't already being caught by the guard.

@marph91
Copy link
Author

marph91 commented Jul 31, 2024

Can you ask them what version and build number they are using (Start -> Settings -> System -> About)?

Answer from the user:

The version of Windows I use is 11 Enterprise 23H2, build 22631.3880 and Experience Pack 1000.22700.1020.0.

So it's even windows 11. (I adapted the original post accordingly.)

@avylove
Copy link
Collaborator

avylove commented Jul 31, 2024

Yeah, that's weird. We wouldn't want to fall back in that case. Best to try and figure out what's going on

@avylove
Copy link
Collaborator

avylove commented Jul 31, 2024

Once I get my VM updated, I'm going to test an update to Jinxed that won't set the console mode if the needed mode is already enabled. It wasn't enabled by default before, but it looks like it is now. I don't know if that's your user's issue, but, if we don't have to set the mode, then it avoids the whole issue.

@avylove
Copy link
Collaborator

avylove commented Jul 31, 2024

I released Jinxed 1.3.0 with this change. Hopefully that solves the issue. If not, we can keep investigating. Either way, I think the change makes sense.

marph91 added a commit to marph91/jimmy that referenced this issue Aug 1, 2024
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

No branches or pull requests

2 participants