Console.Unix: reset terminal at exit in less cases to avoid blocking the parent. (#42303)
* Console.Unix: reset terminal at exit in less cases to avoid blocking the parent. When a parent is fetching the Console.Cursor position, it configures the terminal to not echo, writes an escape sequence to query the position, and then reads the position from stdin. Because this doesn't happen atomically a child process can overwrite the terminal settings to echo before the parent starts reading. This causes the position to be echoed to the user, and the parent gets stuck waiting for input on stdin. Currently terminal settings are reset at exit for applications that use the Console or Process class. This change tracks whether the application has changes the terminal settings and only then resets the terminal settings. This doesn't fix the issue, but makes it less likely to occur. * TermInfo changes are no longer needed * Only configure terminal for child if we've touched the settings. * minor change to comment wording
Showing
想要评论请 注册 或 登录