-
Notifications
You must be signed in to change notification settings - Fork 284
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
On MacOS, crossterm::cursor::position()
freezes the program when stdin is piped
#828
Comments
It looks like this issue is upstream — specifically, as far as I can tell, rustix::termios::tcsetattr is hanging whenever it's supplied a file descriptor for '/dev/tty' (instead of default stdin). This happens whenever standard input isn't a TTY. I used the provided main function to reproduce the issue. Here's the LLDB backtrace when this hang occurs, where I'm reproducing the issue by directing a file through standard input:
|
That's interesting. That's curious that it only occurs on MacOS as far as I know. I see you made a PR that throws an error in case stdin is not a tty. It will surely prevent hanging the program, but that means |
Could someone see if #956 fixes this? I wasn't able to reproduce a hang in Side note, but piped input should work properly with |
Describe the bug
When using
crossterm::cursor::position()
when stdin comes from another program (piped input), the program freezes and doesn't respond to any other event. When it occurs, it's impossible to quit the program by pressing Ctrl+C. The shell launching the program also get some trouble (nushell blocks, zsh get its size wrong).The issue is not reproductible on Linux. I haven't tried on Windows yet.
To Reproduce
on zsh
on nushell
Expected behavior
Not to freeze 😄
OS
MacOS Ventura 15.5.2
Terminal/Console
Tried on iTerm2 and vscode integrated console.
Launched with nushell and zsh.
The text was updated successfully, but these errors were encountered: