1 unstable release

Uses old Rust 2015

0.1.0 Feb 1, 2021

#602 in Operating systems

MIT license

1MB
144 lines

ctty-rs is a cross-platform crate for determining a processes' controlling TTY (ctty). Support is currently available for Linux, macOS, and FreeBSD.

In many cases, it may be useful to know which TTY a process belongs to (for example, when storing session data), but there is no standardized way to do this across operating systems. One way is to use ttyname on stdin, stout, or stderr's file descriptors, but this doesn't work in cases where they are redirected at the shell level.

ctty-rs provides a simple way to obtain a processes' controlling TTY even when stdin, stdout, and stderr with a platform-agnostic interface.

Dependencies