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

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