Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] $section->setMaxHeight() not working as described #54875

Open
PBXg33k opened this issue May 10, 2024 · 0 comments
Open

[Console] $section->setMaxHeight() not working as described #54875

PBXg33k opened this issue May 10, 2024 · 0 comments

Comments

@PBXg33k
Copy link

PBXg33k commented May 10, 2024

Symfony version(s) affected

7.0.7

Description

Following the documentation on console sections i noticed the example output does not reflect the output described in the example code description.

Expected Output

$ #Irrelevant history
$ bin/console playground:cli-sections
Line2
Line3

Actual Output

$ #Irrelevant history
Line1
Line2
Line3

If i add two more $section1->writeln() to the end for example i get the following output where i would expect only Line5 and Line6

Line1
Line4
Line6

It looks to me that there's some strange behaviour going on where Lines which were n+1 of the argument given to setMaxHeight() stays printed in the console window. But i could be way off on this.

Tested environment
OS: Debian 12
PHP: 8.3.6
Docker: NO
Shell: Bash
Symfony version: 7.0.7 (ran symfony new for this bug report)

composer info

doctrine/inflector                 2.0.10  [...]
nikic/php-parser                   v5.0.2  [...]
psr/cache                          3.0.0  [...]
psr/container                      2.0.2  [...]
psr/event-dispatcher               1.0.0  [...]
psr/log                            3.0.0  [...]
symfony/cache                      v7.0.7  [...]
symfony/cache-contracts            v3.5.0  [...]
symfony/config                     v7.0.7  [...]
symfony/console                    v7.0.7  [...]
symfony/dependency-injection       v7.0.7  [...]
symfony/deprecation-contracts      v3.5.0  [...]
symfony/dotenv                     v7.0.7  [...]
symfony/error-handler              v7.0.7  [...]
symfony/event-dispatcher           v7.0.7  [...]
symfony/event-dispatcher-contracts v3.5.0  [...]
symfony/filesystem                 v7.0.7  [...]
symfony/finder                     v7.0.7  [...]
symfony/flex                       v2.4.5  [...]
symfony/framework-bundle           v7.0.7  [...]
symfony/http-foundation            v7.0.7  [...]
symfony/http-kernel                v7.0.7  [...]
symfony/maker-bundle               v1.59.1 [...]
symfony/polyfill-intl-grapheme     v1.29.0 [...]
symfony/polyfill-intl-normalizer   v1.29.0 [...]
symfony/polyfill-mbstring          v1.29.0 [...]
symfony/polyfill-php83             v1.29.0 [...]
symfony/process                    v7.0.7  [...]
symfony/routing                    v7.0.7  [...]
symfony/runtime                    v7.0.7  [...]
symfony/service-contracts          v3.5.0  [...]
symfony/string                     v7.0.7  [...]
symfony/var-dumper                 v7.0.7  [...]
symfony/var-exporter               v7.0.7  [...]
symfony/yaml                       v7.0.7  [...]

How to reproduce

Create a new symfony project using Symfony's CLI tool

(commands from my 'history')

  1. $ symfony new cli-test
  2. $ cd cli-test/
  3. $composer require --dev symfony/maker
  4. $bin/console make:command playground:cli-sections
  5. Paste the example code from the documentation page
  6. $bin/console playground:cli-sections

Possible Solution

No response

Additional Context

No response

@PBXg33k PBXg33k added the Bug label May 10, 2024
@PBXg33k PBXg33k changed the title $section->setMaxHeight() not working as described [Console] $section->setMaxHeight() not working as described May 10, 2024
@xabbuh xabbuh added the Console label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants