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
okular ~/dir1\ with\ blanks/di
to make the completion to dir2 unique
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.
On 29/01/2024 19:40, Greg Wooledge wrote:
Let me test that as well....[...]
unicorn:/tmp$ xyz dir\ with\ blanks/dir2/file
"okular" is important here. Only limited set of file name suffixes are allowed for some commands. You do not need to have okular installed, completion rules are part of bash-completion.
On Tue, Jan 30, 2024 at 12:05:24AM +0700, Max Nikulin wrote:
On 29/01/2024 19:40, Greg Wooledge wrote:
Let me test that as well....[...]
unicorn:/tmp$ xyz dir\ with\ blanks/dir2/file
"okular" is important here. Only limited set of file name suffixes are allowed for some commands. You do not need to have okular installed, completion rules are part of bash-completion.
That's my point as well. I'm trying to get the OP to determine whether
it's the programmable completion for "okular" in particular that's at
fault, or bash itself (hint: it's not).
In my demonstration, all programmable completions were disabled. I
never use them to begin with. So, in my demonstration, the command
name is completely irrelevant.
On Tue, Jan 30, 2024 at 12:05:24AM +0700, Max Nikulin wrote:
On 29/01/2024 19:40, Greg Wooledge wrote:
Let me test that as well....[...]
unicorn:/tmp$ xyz dir\ with\ blanks/dir2/file
"okular" is important here. Only limited set of file name suffixes are
allowed for some commands. You do not need to have okular installed,
completion rules are part of bash-completion.
That's my point as well. I'm trying to get the OP to determine whether
it's the programmable completion for "okular" in particular that's at
fault, or bash itself (hint: it's not).
On Mon 29 Jan 2024 at 19:31:50 (+0100), Michael Kiermaier wrote:
Thank you for your responses! After 'complete -r' the problem
disappears. I should add that I never touched the autocomplete settings.
No, but you lose your so-called component (2) filtering.
For me, a better workaround is, when the directory path gets "stuck":
. Press HOME,
. Type any letter that makes a "wrong" command name (eg aokular),
. Press END,
. Press TAB and carry on using completion for directory/filenames,
. Once you reach the right directory, and if you need filtering,
press HOME DELETE END and you've got filtering back again.
. Obviously press HOME DELETE if you didn't do the previous step.
I will submit a bug report for the package bash-completion.
On 1/29/24 18:59, Greg Wooledge wrote:
On Tue, Jan 30, 2024 at 12:05:24AM +0700, Max Nikulin wrote:
On 29/01/2024 19:40, Greg Wooledge wrote:
Let me test that as well....[...]
unicorn:/tmp$ xyz dir\ with\ blanks/dir2/file
"okular" is important here. Only limited set of file name suffixes are allowed for some commands. You do not need to have okular installed, completion rules are part of bash-completion.
That's my point as well. I'm trying to get the OP to determine whether it's the programmable completion for "okular" in particular that's at fault, or bash itself (hint: it's not).
Thank you for your responses! After 'complete -r' the problem
disappears. I should add that I never touched the autocomplete settings.
I will submit a bug report for the package bash-completion.
complete -r isn't intended as a workaround. It's intended as a diagnostic step.
Seeing the problem go away when completion goes away means that the
problem is *in* the completion. Thus, he knows which package to file
a bug report against.
On 30/01/2024 02:51, David Wright wrote:
. Press HOME,
. Type any letter that makes a "wrong" command name (eg aokular),
. Press END,
The escape "Esc /" workaround has been posted in this thread already.
It uses built-in readline path completion instead of BASH programmable completion. It may be available as [Alt+/] (in xterm it requires xterm*vt100.metaSendsEscape: true)
[Ctrl+A] and [Ctrl+E] are alternatives for [Home] and [End].
For details see the BASH manual
info '(bash) Commands For Completion'
"complete-filename" function and other sections related to readline
and completion. https://www.gnu.org/software/bash/manual/html_node/Commands-For-Completion.html#index-complete_002dfilename-_0028M_002d_002f_0029
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 46:09:37 |
Calls: | 6,910 |
Files: | 12,377 |
Messages: | 5,429,524 |