You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
←[H←[2J←[3Jthread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 87, kind: InvalidInput, message: "The parameter is incorrect." })', src\main.rs:2:26
Doesn't matter if launch from VSCode console, cmd or powershell.
Faulty code, according to debugger: win::is_windows_10 returns true while the platform is windows 7. This is because the logic inside the function expects pwsh_package_management to be indicator of windows 10, but it wasn't in my situation. I have no idea when and what software installed this package during windows lifetime. This caused further code to execute SetConsoleMode on stdout with flag ENABLE_VIRTUAL_TERMINAL_PROCESSING, which is absent on platforms below windows 10 build number 10586 according to this comment on stackoverflow. As a debugging measure, removing pwsh_package_management check gets rid of the error on all tested terminals.
Additional information
c:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 7 Ultimate
OS Version: 6.1.7601 Service Pack 1 Build 7601
c:\>powershell.exe -Command Get-Command -Module PackageManagement
c:\>echo %ERRORLEVEL%
0
The text was updated successfully, but these errors were encountered:
Fixes#5
Windows 7 Powershell at least as of 6.1.7601 supports the tested
functionality, making the test useless for checking support. Removing
this check completely will rely more on the ability to set the bit as a
check for setting the bit; that's already acknowledged in the docs so 👍
Code to reproduce
main.rs
Cargo.toml
The error
Doesn't matter if launch from VSCode console,
cmd
orpowershell
.Faulty code, according to debugger:
win::is_windows_10
returnstrue
while the platform is windows 7. This is because the logic inside the function expectspwsh_package_management
to be indicator of windows 10, but it wasn't in my situation. I have no idea when and what software installed this package during windows lifetime. This caused further code to executeSetConsoleMode
on stdout with flagENABLE_VIRTUAL_TERMINAL_PROCESSING
, which is absent on platforms below windows 10 build number 10586 according to this comment on stackoverflow. As a debugging measure, removingpwsh_package_management
check gets rid of the error on all tested terminals.Additional information
The text was updated successfully, but these errors were encountered: