-
Notifications
You must be signed in to change notification settings - Fork 354
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
"panic: inappropriate ioctl for device" when stdin is reused #88
Comments
bcicen
changed the title
"panic: inappropriate ioctl for device" when stdin is reused
Aug 12, 2018
panic: inappropriate ioctl for device
when stdin is reused
Thanks you. 👍 |
abrander
added a commit
to abrander/go-prompt
that referenced
this issue
Aug 14, 2020
When using go-prompt before /dev/ is populated, it will panic() from NewStandardInputParser() because /dev/ isn't populated yet. This will use stdin (fd 0) as a fallback if /dev/tty doesn't exist. Furthermore GetWinSize() will return the default console size if the IOCTL call fails. This can happen if the default stdin is not a terminal, but a pipe as fixed in commit 846777c and described in issue c-bata#88.
rbergman
pushed a commit
to rbergman/go-prompt
that referenced
this issue
Jun 3, 2021
When using go-prompt before /dev/ is populated, it will panic() from NewStandardInputParser() because /dev/ isn't populated yet. This will use stdin (fd 0) as a fallback if /dev/tty doesn't exist. Furthermore GetWinSize() will return the default console size if the IOCTL call fails. This can happen if the default stdin is not a terminal, but a pipe as fixed in commit 846777c and described in issue c-bata#88. (cherry picked from commit aba8e36)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug reports
When a program reads input from stdin (i.e, piped in before initializing the prompt),
go-prompt
attempts to reuse this same pipe to read user input interactively, resulting in a panic:Expected Behavior
go-prompt
should always open a fresh stdin descriptor when initializedCurrent Behavior and Steps to Reproduce
Read from stdin before starting the prompt
Context
The text was updated successfully, but these errors were encountered: