From f83da4d6f011d6d0ca43ed6da0a0b9808736a469 Mon Sep 17 00:00:00 2001 From: "Maximilian.Beckers" Date: Mon, 17 Oct 2022 10:30:55 +0200 Subject: [PATCH 1/2] [Console] Fix error output on windows cli --- Application.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Application.php b/Application.php index 1021a900f..64f5ae71c 100644 --- a/Application.php +++ b/Application.php @@ -254,7 +254,7 @@ public function doRun(InputInterface $input, OutputInterface $output) $alternative = $alternatives[0]; $style = new SymfonyStyle($input, $output); - $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error'); + $style->block(sprintf('Command "%s" is not defined.', $name), null, 'error', ' ', true); if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); @@ -955,11 +955,21 @@ protected function configureIO(InputInterface $input, OutputInterface $output) } switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break; - case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break; - case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break; - case 3: $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); break; - default: $shellVerbosity = 0; break; + case -1: + $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); + break; + case 1: + $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); + break; + case 2: + $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + break; + case 3: + $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + break; + default: + $shellVerbosity = 0; + break; } if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { From 8e70c1cab07ac641b885ce80385b9824a293c623 Mon Sep 17 00:00:00 2001 From: aleksandr-shevchenko Date: Wed, 19 Oct 2022 09:15:51 +0400 Subject: [PATCH 2/2] Update Application.php https://github.com/symfony/symfony/issues/47862#issuecomment-1282195961 --- Application.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Application.php b/Application.php index 64f5ae71c..42c4911a0 100644 --- a/Application.php +++ b/Application.php @@ -254,7 +254,9 @@ public function doRun(InputInterface $input, OutputInterface $output) $alternative = $alternatives[0]; $style = new SymfonyStyle($input, $output); - $style->block(sprintf('Command "%s" is not defined.', $name), null, 'error', ' ', true); + $output->writeln(''); + $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); + $output->writeln($formattedBlock); if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy