Check whether stderr is a tty if writing to stderr
Offen
- Vorherrschende Sprache
- Rust
- Sterne
- 7.1k
- Forks
- 547
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
While writing up #48 I found a bit of an odd behaviour in tunnelto: although it apparently writes its output to `stderr`, it doesn't check whether `stderr` is a tty, instead it checks stdout:
$ tunnelto 2>test.txt
will write a bunch of ANSI escape codes to `test.txt`, but
$ tunnelto > /dev/null 2>test.txt
will not.
So when writing a script around tunnelto, despite only reading from stderr one has to redirect `stdout` in order to avoid an output full of ANSI.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.