Eric Hodel d5677625a7
Add is-terminal to determine if stdin/out/err are a terminal (#10970)
# Description

I'm not sure if "is-terminal" is the best name for this command as there
is also "term size". Uses
[`is_terminal()`](https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html#tymethod.is_terminal)
which is cross-platform.

Possible alternative names:
* `term is-tty --stdout`
* `term is-tty stdout`
* `term is-terminal stdout`

If multiple streams are provided an error is returned. The error span
covers all arguments as the incompatible one is not known. This may be
new?

Fixes #10517

# User-Facing Changes

* Add `is-terminal` to check if stdin, stdout, or stderr are a terminal
(TTY)

# Tests + Formatting

The nu tests always redirect stdin, stdout, and stderr so a positive
test case is not possible without extra work

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

The new command will be added automatically

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-11-21 20:48:39 -06:00
..
2022-11-22 16:58:11 -08:00
2023-08-24 07:08:58 -05:00
2023-10-05 18:43:58 +02:00
2023-11-16 15:14:45 -06:00
2023-10-24 12:48:05 -05:00
2023-09-26 18:49:28 +02:00
2023-11-03 10:09:33 -05:00
2022-12-22 00:33:26 +02:00
2023-10-19 09:30:34 -05:00
2023-10-10 03:31:15 +13:00
2023-11-17 19:30:53 -06:00
2023-10-13 13:45:36 -05:00
2023-09-16 21:49:10 +02:00
2023-03-15 18:54:55 +13:00
2023-11-17 07:30:15 +08:00
2023-10-19 22:08:09 +02:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-11-16 05:28:54 -06:00
2023-04-28 13:25:44 +02:00
2023-10-30 07:59:48 -05:00
2023-10-08 13:12:46 +02:00