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

Filename completion on unquoted string #1057

Open
3 tasks done
mmjo opened this issue Sep 28, 2023 · 1 comment
Open
3 tasks done

Filename completion on unquoted string #1057

mmjo opened this issue Sep 28, 2023 · 1 comment

Comments

@mmjo
Copy link

mmjo commented Sep 28, 2023

Describe the bug

File completion when there is an open quote fails.
I.e. "a b"/"x

To reproduce

mkdir empty
cd empty
mkdir d
touch d/f

  1. cd empty
  2. Type: d/"<TAB>
  3. Get: d/"d/f"

Expected behavior

Get: d/f
Or: d/"f"

Versions (please complete the following information)

Additional context

Initially the problem occurred with spaces in directory and filenames.
Hence the typing of the " before the <TAB>.

Discussion in bug-readline mailing list,
especially the message of the bash/readline maintainer, Chet Ramey:
https://lists.gnu.org/archive/html/bug-readline/2023-09/msg00018.html

Debug trace

trace.txt

@mmjo
Copy link
Author

mmjo commented Oct 3, 2023

Chet Ramey notes further (https://lists.gnu.org/archive/html/bug-readline/2023-10/msg00000.html):

This could be an opportunity for bash-completion to do a better job than
bash's default completion.

It could note that ${COMP_WORDS[$COMP_CWORD]} differs from the word readline thinks is being completed,
check whether readline's word is a subset of the current word,
perform completions on the current word as it does now,
and then filter out the prefix readline isn't going to use before returning the possible 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

No branches or pull requests

1 participant