Skip to content

Conversation

HypeMC
Copy link
Member

@HypeMC HypeMC commented Sep 11, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

Related to #43665

The problem with $(printf -- '%b' "$w") is that it also interprets \E as an escape sequence.

For example, in

bin/console debug:form 'Symfony\Component\Form\Extension\Core\Type\EmailType'

the \E in the class name is replaced with the ASCII escape character:

Symfony\Component\Form�xtension\Core\Type�mailType

This PR switches to simply replacing double backslashes with a single one instead of using printf -- '%b'.

@Spomky
Copy link
Contributor

Spomky commented Sep 12, 2025

Hi @HypeMC,

The proposed fix may cause other issues.
To me %b adds nothing here and it not only breaks the FQDN but also paths (especially on Windows). regex or JSON could be broken but not sure they are used here.

What if we completely remove this line and rely on the loop instead?

@HypeMC
Copy link
Member Author

HypeMC commented Sep 12, 2025

@Spomky Hi.

The proposed fix may cause other issues.

Do you have any examples you could share?

but also paths (especially on Windows).

Have you experienced problems with paths on any other OS?

What if we completely remove this line and rely on the loop instead?

I haven't tested it, but that might reintroduce the original issue #43665 tried to fix.

Copy link
Contributor

@Spomky Spomky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I performed some tests and it looks good.
I was mistaken about the effect of this change.

@nicolas-grekas
Copy link
Member

Thank you @HypeMC.

@nicolas-grekas nicolas-grekas merged commit 2924491 into symfony:6.4 Sep 13, 2025
10 of 11 checks passed
@HypeMC HypeMC deleted the fix-bash-completion branch September 13, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants