terminal_size

Function terminal_size_using_fd

Source
pub unsafe fn terminal_size_using_fd(fd: RawFd) -> Option<(Width, Height)>
๐Ÿ‘ŽDeprecated: Use terminal_size_of instead. Use BorrowedFd::borrow_raw to convert a raw fd into a BorrowedFd if needed.
Expand description

Returns the size of the terminal using the given raw file descriptor, if available.

The given file descriptor must be an open file descriptor.

If the given file descriptor is not a tty, returns None

ยงSafety

fd must be a valid open file descriptor.