Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] Fix side-effects from running bash completions #57853

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

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Jul 28, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix composer/composer#12015
License MIT

Fixes issues in symfony bash completions having side-effects for other completions. See composer/composer#12015 for details.

I identified this IFS line as causing the issue.. But it was introduced here
e9e0c07 (cc @GromNaN) probably for a good reason. So I don't think this is mergeable as is, but we should see what can be done to set IFS where needed per process call and not change it globally like that.

@Seldaek Seldaek requested a review from chalasr as a code owner July 28, 2024 07:29
@carsonbot carsonbot added this to the 5.4 milestone Jul 28, 2024
@carsonbot carsonbot changed the title Fix side-effects from running bash completions [Console] Fix side-effects from running bash completions Jul 28, 2024
@OskarStark OskarStark requested a review from GromNaN July 28, 2024 08:17
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

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

Wow, great find!

Comment on lines 9 to 10
# Use newline as only separator to allow space in completion values
IFS=$'\n'
Copy link
Member

Choose a reason for hiding this comment

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

Can you try if local IFS=$'\n' also fixes the issue?

Based on a quick local test, the behavior (being able to autocomplete values with spaces) still works when declaring it as a local variable.

Copy link
Member

Choose a reason for hiding this comment

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

PR updated to your suggestion @wouterj

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for taking over sorry summer holidays here

@nicolas-grekas
Copy link
Member

Thank you @Seldaek.

@nicolas-grekas nicolas-grekas merged commit 5d0fa8e into symfony:5.4 Aug 13, 2024
11 of 12 checks passed
@wouterj
Copy link
Member

wouterj commented Aug 13, 2024

@nicolas-grekas @GromNaN what do you think about increasing the completion api version (e.g. from 1 to 1.0.1), so users get a message to upgrade their completion script? Worth it for a bug fix, or not worth it? (given it only affects one of the three supported shells)

@GromNaN
Copy link
Member

GromNaN commented Aug 13, 2024

@nicolas-grekas @GromNaN what do you think about increasing the completion api version (e.g. from 1 to 1.0.1), so users get a message to upgrade their completion script? Worth it for a bug fix, or not worth it? (given it only affects one of the three supported shells)

That would break completion for no reason until they update their completion script. The version check need to accept bugfix versions. But then I don't see how we can trigger a warning when the completion is run.

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.

6 participants