Commit e09874b
committed
bug #14740 [Console] SymfonyStyle : fix blocks output is broken on windows cmd (ogizanagi)
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] SymfonyStyle : fix blocks output is broken on windows cmd
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Using `SymfonyStyle::block` method, output is broken on windows cmd:

Windows cmd seems to wrap lines as soon as the terminal width is reached, whether there are following characters or not.
I've encountered this behavior with multiple command prompts available on Windows, like Console2, ConEmu, Cmdr, ... But as most of them are simple cmd wrappers, the output is identic. The only good fellow in there is Cygwin which provides an Unix-like env and command-line interface.
This PR solves this issue by assuming that the lineLength (not the terminal width), used to wrap lines internally within the `SymfonyStyle::block` method, should be the terminal width - 1.
Commits
-------
ea3d768 [Console] SymfonyStyle : Fix blocks output is broken on windows cmdFile tree
Expand file treeCollapse file tree
1 file changed
+2
-1
lines changedOpen diff view settings
Filter options
- src/Symfony/Component/Console/Style
Expand file treeCollapse file tree
1 file changed
+2
-1
lines changedOpen diff view settings
Collapse file
src/Symfony/Component/Console/Style/SymfonyStyle.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Style/SymfonyStyle.php+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
46 | 46 | |
47 | 47 | |
48 | 48 | |
49 | | - |
50 | 49 | |
| 50 | + |
| 51 | + |
51 | 52 | |
52 | 53 | |
53 | 54 | |
|
0 commit comments