Skip to content

Localize shell variable REPLY to avoid overwriting users' value#489

Merged
kislyuk merged 1 commit intokislyuk:developfrom
akinomyoga:REPLY
Jun 12, 2024
Merged

Localize shell variable REPLY to avoid overwriting users' value#489
kislyuk merged 1 commit intokislyuk:developfrom
akinomyoga:REPLY

Conversation

@akinomyoga
Copy link
Copy Markdown
Contributor

The shell function __python_argcomplete_scan_head in the completion setting (argcomplete/bash_completion.d/_python-argcomplete) uses the read builtin without specifying variable names. This stores the read result in the shell variable REPLY. Then, __python_argcomplete_scan_head checks the value of REPLY. A problem is that this will clobber the users' values of the global shell variable REPLY on an attempt of completion. We should declare the REPLY as a local variable in the shell function __python_argcomplete_scan_head.

@kislyuk kislyuk merged commit 80e5cb6 into kislyuk:develop Jun 12, 2024
@kislyuk
Copy link
Copy Markdown
Owner

kislyuk commented Jun 12, 2024

Thanks!

@akinomyoga akinomyoga deleted the REPLY branch June 12, 2024 00:36
@akinomyoga
Copy link
Copy Markdown
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants