Skip to content
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

fix: use Bash 5.3 compgen -V to generate completions including newlines #1222

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akinomyoga
Copy link
Collaborator

@akinomyoga akinomyoga commented Jun 18, 2024

As mentioned in #704 (comment), @algorythmic has added compgen -V array_name in the new version of Bash 5.3, which can be used to handle the completions including newline characters properly.

  • 7c12535 In the first commit, I split the function _comp_compgen into two (for _comp_compgen <generator> and for _comp_compgen -- <options for builtin compgen>).
  • 0ec92f2 In the second commit, I prepare an implementation for Bash 5.3 using compgen -V.

edit: Although the CI tests with Bash 5.3 are not set up, I locally ran tests with Bash 5.3 (more specifically, with the devel ranch of Bash) and confirmed that this change does not break the tests.

@akinomyoga akinomyoga changed the title fix: use compgen -V to generate completions including newlines fix: use Bash 5.3 compgen -V to generate completions including newlines Jun 18, 2024
In Bash >= 5.3, we can use `compgen -V array_name` to properly handle
newlines in the generated completions.
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.

1 participant