From e86a31f6d4d9298d05c627078032851f2d60d0c6 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 16 Sep 2020 20:58:07 +0200 Subject: [PATCH] Use the newly fixed `test -t` in isatty Removes a weird dependency on the test command. --- share/functions/isatty.fish | 6 +----- tests/pexpects/isatty.py | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/share/functions/isatty.fish b/share/functions/isatty.fish index 8575a25fe..ba72b1683 100644 --- a/share/functions/isatty.fish +++ b/share/functions/isatty.fish @@ -25,9 +25,5 @@ function isatty -d "Tests if a file descriptor is a tty" set fd $argv[1] end - # Use `command test` because `builtin test` doesn't open the regular fd's. - # See https://github.com/fish-shell/fish-shell/issues/1228 - # Too often `command test` is some bogus Go binary, I don't know why. Use [ because - # it's less likely to be something surprising. See #5665 - command [ -t "$fd" ] + test -t "$fd" end diff --git a/tests/pexpects/isatty.py b/tests/pexpects/isatty.py index 743e87c61..a18e67b3a 100644 --- a/tests/pexpects/isatty.py +++ b/tests/pexpects/isatty.py @@ -57,3 +57,11 @@ sendline("t