Skip to content

Commit 4e6a5ad

Browse files
authored
Restore Prompt output after calling another command (#47929)
1 parent 62d570e commit 4e6a5ad

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Illuminate/Console/Concerns/CallsCommands.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ protected function runCommand($command, array $arguments, OutputInterface $outpu
6464
{
6565
$arguments['command'] = $command;
6666

67-
return $this->resolveCommand($command)->run(
67+
$result = $this->resolveCommand($command)->run(
6868
$this->createInputFromArguments($arguments), $output
6969
);
70+
71+
$this->restorePrompts();
72+
73+
return $result;
7074
}
7175

7276
/**

src/Illuminate/Console/Concerns/ConfiguresPrompts.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,14 @@ protected function promptUntilValid($prompt, $required, $validate)
119119
return $result;
120120
}
121121
}
122+
123+
/**
124+
* Restore the prompts output.
125+
*
126+
* @return void
127+
*/
128+
protected function restorePrompts()
129+
{
130+
Prompt::setOutput($this->output);
131+
}
122132
}

0 commit comments

Comments
 (0)