ISATTY(1)
okay bestie, welcome to the ISATTY(1) page from fish-shell β yes, the manual name is literally fish-shell, and todayβs main character is isatty. letβs get into it π
β¨
β¨ NAME β¨
isatty β test if a file descriptor is a terminal π
π SYNOPSIS π
isatty [FILE_DESCRIPTOR]
π DESCRIPTION π
okay so isatty 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 β and for historical reasons, that call refers to a teletypewriter (TTY). history really said βvibes onlyβ π
The FILE DESCRIPTOR may be either the number of a file descriptor, or one of the strings stdin, stdout, or stderr. If itβs not specified, zero is assumed. no cap.
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. silence is golden, fr fr π€«
-h,--helpβ displays help about using this command. cute and helpful π«Ά
π¦ EXAMPLES π¦
From an interactive shell, the commands below exit with a return value of zero:
isatty
isatty stdout
isatty 2
echo | isatty 1
And these will exit non-zero:
echo | isatty
isatty 9
isatty stdout > file
isatty 2 2> file
π Copyright π
fish-shell developers
this iconic page was brought to you by fish-shell version 4.9, dated Sep 08, 2026 β ISATTY(1) out, byeee bestie π
πβ¨
π¦ where this page comes from
- arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms