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
tty: internal mode state does not account for changes outside of libuv #1292
Comments
Are you referring to the |
On Fri, Apr 07 2017, Ben Noordhuis wrote:
Are you referring to the if (mode == tty_handle->mode) return 0 check?
Precisely. I'd be more inclined to rename the mode field to
"inited/initialized" as well, so that it's clear that we use it to store
the orig_termios status for uv_tty_reset_mode.
You cannot easily "get" the tty mode back.
I'd be okay with removing that provided it's replaced with a comment
explaining why libuv doesn't do an early exit - and assuming it
doesn't cause regressions, of course.
Aside the tests in libuv, I also run Julia tests and my expect-like
wrapper (which I why I incur in this issue).
|
See PR #1293 After reviewing the code, I really don't like how uv_tty_reset_mode() works. I didn't change its behavior, but it works on the assumption that you only change one TTY. If you're working with multiple PTYs, uv_tty_reset_mode resets the tty which was first modified, which is senseless. Changing the behavior without changing the ABI though is tough. I hope it's more clear in the docs now. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
In progress/discussion in #1293? |
Didn't touch tty code in a while, I resorted to an external process helper. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
On Thu, Oct 01 2020, Jameson Nash wrote:
Reopened #1292.
Bad stale[bot]!
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When changing the tty mode (via
uv_tty_set_mode
), we keep an internal "mode" state to avoid doing ioctls again. I see this is used to restore the original terminal mode, but it introduces some issues.When using a pty to control a slave process, the slave might change the mode on our back. I have this problem on a couple of occasions, where I need to force a call to cfmakeraw() but I need to toggle the internal state (by changing the tty mode to NORMAL and then IO again) to actually do it.
I'd be tempted to add a "force" parameter to always set the requested mode, but maybe there's a better solution?
The text was updated successfully, but these errors were encountered: