From 37ed55f6950d921a87d5beeab16d03f8de26b060 Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Fri, 29 Sep 2023 17:26:07 +1000 Subject: [PATCH] Prioritize fallback over non-interactive mode (#91) --- src/Prompt.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Prompt.php b/src/Prompt.php index 8c8f3832..dfa0657e 100644 --- a/src/Prompt.php +++ b/src/Prompt.php @@ -75,18 +75,18 @@ abstract public function value(): mixed; public function prompt(): mixed { try { - static::$interactive ??= stream_isatty(STDIN); - - if (! static::$interactive) { - return $this->default(); - } - $this->capturePreviousNewLines(); if (static::shouldFallback()) { return $this->fallback(); } + static::$interactive ??= stream_isatty(STDIN); + + if (! static::$interactive) { + return $this->default(); + } + $this->checkEnvironment(); try {