deno icon indicating copy to clipboard operation
deno copied to clipboard

Deno.stdin.setRaw throw error in GitBash Windows

Open codesculpture opened this issue 1 year ago • 2 comments

While try to reproduce this issue https://github.com/denoland/deno/issues/21837

After running this in Git Bash in windows (works in powershell)

let a = new Uint8Array(2), b = new Uint8Array(2)
Deno.stdin.readSync(a)
Deno.stdin.setRaw(true)
Deno.stdin.readSync(b)
console.log(a)
console.log(b)

setRaw throw errors.

error: Uncaught Error: The handle is invalid. (os error 6)
Deno.stdin.setRaw(true);
           ^
    at Stdin.setRaw (ext:deno_io/12_io.js:256:9)

codesculpture avatar Jan 15 '24 16:01 codesculpture

This issue can be tracked here in dart, since the cause of the issue is common which is from mintty. Will update here, when i got the correct implementation.

codesculpture avatar Jan 19 '24 12:01 codesculpture

https://github.com/dart-lang/sdk/issues/54630#issuecomment-1934608504 Here explained the issue well which is very common (from git bash) And all we need to do from deno is to upgrade to recent windows sdk version 10.0.22621 but seems winapi crate dont provide what sdk version?

Can anyone help me to find which windows sdk version does winapi crate using?

codesculpture avatar Feb 10 '24 18:02 codesculpture