()
| 741 | /// In this case, rustyline may hang because it uses raw mode. |
| 742 | #[cfg(unix)] |
| 743 | fn is_pty_child() -> bool { |
| 744 | use nix::unistd::{getpid, getsid}; |
| 745 | // If this process is a session leader, we're likely in a PTY child |
| 746 | getsid(None) == Ok(getpid()) |
| 747 | } |
| 748 | |
| 749 | #[cfg(not(unix))] |
| 750 | fn is_pty_child() -> bool { |