Re: Bug: Tab completion for pdf files with blanks in path
On Mon 29 Jan 2024 at 07:40:13 (-0500), Greg Wooledge wrote:
> On Mon, Jan 29, 2024 at 09:32:18AM +0100, Michael Kiermaier wrote:
> > I would like to run okular opening the pdf file
> > ~/dir1\ with\ blanks/dir2/file.pdf
> > via command line. In konsole I type
> > okular ~/dir1\ with\ blanks/
> > and hit the tab key twice for autocomplete. But I won't get offered
> > dir2. After adding more letters like
>
> My first question would be: does the problem still occur if you disable
> bash-completion? Open a new instance of bash and run "complete -r" to
> remove all programmable completions. See if the problem still occurs.
> Then close that instance of bash.
>
> > okular ~/dir1\ with\ blanks/di
> > to make the completion to dir2 unique
>
> Oh, there's more than one subdir? Let me test that as well....
>
> Yeah, even with both dir1 and dir2 (each containing a file), I still get
> the expected behavior in bash without bash-completion in the picture.
>
> unicorn:~$ cd /tmp
> unicorn:/tmp$ mkdir -p 'dir with blanks'/dir2
> unicorn:/tmp$ touch "$_"/file
>
> (first experiments with tab completion, not shown)
>
> unicorn:/tmp$ mkdir -p 'dir with blanks'/dir1
> unicorn:/tmp$ touch "$_"/otherfile
> unicorn:/tmp$ xyz dir\ with\ blanks/dir
> dir1/ dir2/
> unicorn:/tmp$ xyz dir\ with\ blanks/dir2/file
>
> I'm assuming whatever issue you're seeing is the result of a
> bash-completion bug, not a bash bug. If you can confirm that, then
> you'll know which package to file a bug against.
Unless I missed a bit in the OP, the bug is actually worse.
Type di and press TAB, and bash-completion gives you
dir\ with\ blanks/ ok. But now rub out the "nks/" at the end
and press TAB. It fails to complete even that directory name.
However, there's a workaround, which you really have to know
about if you're a bash-completion user, and that is:
ESCAPE /
AFAICT you won't get the list of possibilities as you would normally,
but it should autocomplete as far as the string remains unique.
Cheers,
David.
Reply to: