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

Fails to read piped stdin in windows #229

Open
YairHalberstadt opened this issue Jul 26, 2023 · 0 comments
Open

Fails to read piped stdin in windows #229

YairHalberstadt opened this issue Jul 26, 2023 · 0 comments

Comments

@YairHalberstadt
Copy link

When piping stdin from another process on windows, readline fails to read the piped stdin.

Say my binary does this:

func main() {
	rl, err := NewEx(&Config{})
	if err != nil {
		fmt.Println(err)
		return
	}
	line, err := rl.Readline()
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(line)
}

And then I use it as follows

echo "hello world" | MyBinary.exe

fails with EOF instead of printing hello world.

On linux this works as expected.

The issue appears to be in rawreader_windows.go where the call to ReadConsoleInputW returns "invalid function".

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