is-terminal for platform
Check if stdin, stdout, or stderr is a terminal.
Signature
> is-terminal {flags}
Flags
-
--stdin, -i: Check if stdin is a terminal. -
--stdout, -o: Check if stdout is a terminal. -
--stderr, -e: Check if stderr is a terminal.
Input/output types:
| input | output |
|---|---|
| nothing | bool |
Examples
Return "terminal attached" if standard input is attached to a terminal, and "no terminal" if not.
> if (is-terminal --stdin) { "terminal attached" } else { "no terminal" }
terminal attached
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/is-terminal.html