.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "ISATTY" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME isatty \- test if a file descriptor is a terminal .SH SYNOPSIS .nf \fBisatty\fP [\fIFILE_DESCRIPTOR\fP] .fi .sp .SH DESCRIPTION .sp \fBisatty\fP tests if a file descriptor is a terminal (as opposed to a file). The name is derived from the system call of the same name, which for historical reasons refers to a teletypewriter (TTY). .sp \fBFILE DESCRIPTOR\fP may be either the number of a file descriptor, or one of the strings \fBstdin\fP, \fBstdout\fP, or \fBstderr\fP\&. If not specified, zero is assumed. .sp If the specified file descriptor is a terminal device, the exit status of the command is zero. Otherwise, the exit status is non\-zero. No messages are printed to standard error. .sp The \fB\-h\fP or \fB\-\-help\fP option displays help about using this command. .SH EXAMPLES .sp From an interactive shell, the commands below exit with a return value of zero: .INDENT 0.0 .INDENT 3.5 .sp .EX isatty isatty stdout isatty 2 echo | isatty 1 .EE .UNINDENT .UNINDENT .sp And these will exit non\-zero: .INDENT 0.0 .INDENT 3.5 .sp .EX echo | isatty isatty 9 isatty stdout > file isatty 2 2> file .EE .UNINDENT .UNINDENT .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .