• Home
  • Raw
  • Download

Lines Matching +full:windows +full:- +full:test

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.
13 //! On Windows, it uses a variety of techniques to determine whether the
26 //! [`isatty`]: https://man7.org/linux/man-pages/man3/isatty.3.html
32 #[cfg(windows)]
34 #[cfg(windows)]
36 #[cfg(windows)]
51 fn is_terminal(&self) -> bool; in is_terminal()
57 fn is_terminal(&self) -> bool { in is_terminal()
68 #[cfg(windows)] in is_terminal()
75 // The Windows implementation here is copied from atty, with #51 and #54
79 #[cfg(windows)]
80 fn _is_terminal(stream: BorrowedHandle<'_>) -> bool { in _is_terminal()
81 use std::os::windows::io::AsRawHandle; in _is_terminal()
108 // we're in a Windows console and can therefore trust the negative. in _is_terminal()
122 #[cfg(windows)]
123 unsafe fn console_on_any(fds: &[STD_HANDLE]) -> bool { in console_on_any()
137 #[cfg(windows)]
138 unsafe fn msys_tty_on(handle: HANDLE) -> bool { in msys_tty_on()
171 // a pseudo-terminal is attached. To mitigate against false positives 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()
259 #[cfg(test)]
264 #[test]
265 #[cfg(windows)]
273 #[test]
274 #[cfg(windows)]
282 #[test]
283 #[cfg(windows)]
291 #[test]
302 #[test]
313 #[test]
324 #[test]
335 #[test]
346 #[test]
358 #[test]
359 #[cfg(windows)]
361 use std::{fs::File, os::windows::io::AsRawHandle}; in msys_tty_on_path_length()