Lines Matching +full:use +full:- +full:pty
1 //! is-terminal is a simple utility that answers one question:
9 //! On Unix-family platforms, this is effectively the same as the [`isatty`]
11 //! accepts high-level stream types instead of raw file descriptors.
19 //! use is_terminal::IsTerminal;
26 //! [`isatty`]: https://man7.org/linux/man-pages/man3/isatty.3.html
31 use io_lifetimes::AsFilelike;
33 use io_lifetimes::BorrowedHandle;
35 use windows_sys::Win32::Foundation::HANDLE;
37 use windows_sys::Win32::System::Console::STD_HANDLE;
45 /// use is_terminal::IsTerminal;
51 fn is_terminal(&self) -> bool; in is_terminal()
57 fn is_terminal(&self) -> bool { in is_terminal()
80 fn _is_terminal(stream: BorrowedHandle<'_>) -> bool { in _is_terminal()
81 use std::os::windows::io::AsRawHandle; in _is_terminal()
82 use windows_sys::Win32::System::Console::GetStdHandle; in _is_terminal()
83 use windows_sys::Win32::System::Console::{ in _is_terminal()
123 unsafe fn console_on_any(fds: &[STD_HANDLE]) -> bool { in console_on_any()
124 use windows_sys::Win32::System::Console::{GetConsoleMode, GetStdHandle}; in console_on_any()
138 unsafe fn msys_tty_on(handle: HANDLE) -> bool { in msys_tty_on()
139 use std::ffi::c_void; in msys_tty_on()
140 use windows_sys::Win32::{ in msys_tty_on()
170 // This checks whether 'pty' exists in the file name, which indicates that in msys_tty_on()
171 // a pseudo-terminal is attached. To mitigate against false positives in msys_tty_on()
172 // (e.g., an actual file name that contains 'pty'), we also require that in msys_tty_on()
173 // either the strings 'msys-' or 'cygwin-' are in the file name as well.) in msys_tty_on()
174 let is_msys = name.contains("msys-") || name.contains("cygwin-"); in msys_tty_on()
175 let is_pty = name.contains("-pty"); in msys_tty_on()
182 fn is_terminal(&self) -> bool { in is_terminal()
190 fn is_terminal(&self) -> bool { in is_terminal()
198 fn is_terminal(&self) -> bool { in is_terminal()
206 fn is_terminal(&self) -> bool { in is_terminal()
214 fn is_terminal(&self) -> bool { in is_terminal()
222 fn is_terminal(&self) -> bool { in is_terminal()
230 fn is_terminal(&self) -> bool { in is_terminal()
238 fn is_terminal(&self) -> bool { in is_terminal()
246 fn is_terminal(&self) -> bool { in is_terminal()
254 fn is_terminal(&self) -> bool { in is_terminal()
262 use super::IsTerminal;
361 use std::{fs::File, os::windows::io::AsRawHandle}; in msys_tty_on_path_length()
362 use windows_sys::Win32::Foundation::MAX_PATH; in msys_tty_on_path_length()