8000 [console] Table grid offset bug · Issue #40634 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[console] Table grid offset bug #40634

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

Closed
tarlepp opened this issue Mar 29, 2021 · 2 comments
Closed

[console] Table grid offset bug #40634

tarlepp opened this issue Mar 29, 2021 · 2 comments

Comments

@tarlepp
Copy link
Contributor
tarlepp commented Mar 29, 2021

Symfony version(s) affected: 5.2.6

Description
Seems like console table has offset issue with latest Symfony;

symfony/console 5.2.5:
image

symfony/console 5.2.6:
image

It seems like to be related to custom styles inside table.

I created simple example repository to demonstrate this bug - https://github.com/tarlepp/symfony-console-bug

@Nyholm
Copy link
Member
Nyholm commented Mar 31, 2021

Lovely. Thank you for this issue and the reproducer.

The error comes form this PR: #40524

When the cell is splitted on multiple rows, the first row is:

Screenshot 2021-03-31 at 22 59 12

The <0x1b> is the escape character (ESC)

$string = '�[31msome text �[39m<fg=default;bg=de
8000
fault>';
strlen(string); // 43
(new UnicodeString($string))->width(false); // 41

I dont know why, It might be an issue in the string component.

@Nyholm
Copy link
Member
Nyholm commented Mar 31, 2021

Could it be related to #40635?

fabpot added a commit that referenced this issue Apr 8, 2021
…, grasmash)

This PR was merged into the 5.2 branch.

Discussion
----------

[Console] Add Helper::width() and Helper::length()

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Close #40697 Fix #40634, fix #40635
| License       | MIT
| Doc PR        |

This PR will add add a Helper::strwidth() and a Helper::strlength(). Same with with the Helper::strlenWithoutDecoration(). It does not deprecate anything. That is done in #40695

With this PR we dont have to revert the emoji issue (ie close #40697)

FYI @grasmash, I used your tests from #40635

Commits
-------

d9ea4c5 Add test.
dc02ab3 [Console] Add Helper::strwidth() and Helper::strlength()
@fabpot fabpot closed this as completed Apr 8, 2021
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

4 participants
0