You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previous calls to $this->callSilent remove any output of the new prompts package.
Removing any $this->callSilent calls fixes the problem.
Even a simple example command as this:
classTestCommandextendsCommand
{
/** * The name and signature of the console command. * * @var string */protected$signature = 'app:test-command';
/** * The console command description. * * @var string */protected$description = 'Command description';
/** * Execute the console command. */publicfunctionhandle()
{
$this->callSilent('about');
confirm('Is this visible?');
}
}
When running this command, no output is visible in the terminal but the application is waiting for user input.
Removing the $this->callSilent('about'); call fixes the issue.
Edit:
Manually calling Prompt::setOutput($this->output); also fixes the problem, like this:
$this->callSilent('about');
Prompt::setOutput($this->output);
confirm('Is this visible?');
So I suppose that the callSilent somehow resets Prompt's output interface.
This also helped me uncover and fix some otherissues. There is still one remaining issue to be aware of where passing --no-interaction to a child command also prevents interactivity in the parent command afterwards, but I should have that one solved soon too.
Laravel Prompts Version
0.1.1
Laravel Version
10.17.0
PHP Version
8.2.8
Operating System & Version
macOS 13.5
Terminal Application
iTerm
Description
Previous calls to
$this->callSilent
remove any output of the new prompts package.Removing any
$this->callSilent
calls fixes the problem.Even a simple example command as this:
When running this command, no output is visible in the terminal but the application is waiting for user input.
Removing the
$this->callSilent('about');
call fixes the issue.Edit:
Manually calling
Prompt::setOutput($this->output);
also fixes the problem, like this:So I suppose that the callSilent somehow resets Prompt's output interface.
Steps To Reproduce
I created a test repository here: https://github.com/mpociot/prompts-call-silent
To reproduce:
The text was updated successfully, but these errors were encountered: