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

"The handle is invalid" running inside Cygwin on Windows 10 #68

Open
AlbertoGP opened this issue Jun 14, 2020 · 2 comments
Open

"The handle is invalid" running inside Cygwin on Windows 10 #68

AlbertoGP opened this issue Jun 14, 2020 · 2 comments

Comments

@AlbertoGP
Copy link

Hi, this combination might be out of scope but I can spend some time helping diagnose it.

Compiling in Windows 10, the program runs fine under PowerShell and CMD.EXE, but crashes when run from the Cygwin console:

$ cargo run
   Compiling lf v0.1.0 (C:\cygwin\home\user\linefeed-crash)
warning: variable does not need to be mutable
  --> src\main.rs:13:7
   |
13 |   let mut reader = Interface::new("my-application")?;
   |       ----^^^^^^
   |       |
   |       help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 11.76s
     Running `target\debug\lf.exe`
Hello, world!
Error: Os { code: 6, kind: Other, message: "The handle is invalid." }

$

The error happens on line 13 of the attached file:
let mut reader = Interface::new("my-application")?;
main.rs.txt

Is this a known issue?

@AlbertoGP
Copy link
Author

AlbertoGP commented Jun 14, 2020

This might be a widespread problem: I’m checking alternatives, and for instance in rustyline it says:

Note: Mintty (Cygwin/MinGW) is not supported

Others don’t specify that. Two of them, Terminal Wizardry and Runtastic Prompt mention only that they support Windows, the others don’t say even that.

@AlbertoGP
Copy link
Author

For easy reference, here are the problems with supporting Mintty in rustyline from their issue tracker:

There are at least two problems implementing the Term trait (mainly the input part):

Under Mintty, you cannot use the Windows API anymore.

kkawakam/rustyline#203 (comment)

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

1 participant