[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash-5.0-beta2 breaks ``complete -D''

From: Tom Ryder
Subject: Re: bash-5.0-beta2 breaks ``complete -D''
Date: Fri, 30 Nov 2018 22:33:17 +1300
User-agent: Mutt/1.11+4 (54103972) (2018-11-27)

On Fri, Nov 30, 2018 at 05:21:32PM +0800, Clark Wang wrote:
Just tried 5.0-beta2 and it broke my completion rules. It can be reproduced with the following steps: ...

Hello Clark; I noticed the same thing; I addressed it in an earlier message with the attached patch as a suggested fix, modifying a patch from Luca Boccassi.


----- Forwarded message from Tom Ryder <address@hidden> -----

Date: Sun, 25 Nov 2018 23:04:18 +1300
From: Tom Ryder <address@hidden>
To: Luca Boccassi <address@hidden>
Cc: address@hidden
Subject: Re: [PATCH] Fix custom program's completions when initial word is set

On Fri, Nov 23, 2018 at 12:48:54PM +0000, Luca Boccassi wrote:
The fix is to only override foundcs if both iw_compspec is not null
and we are not in command position.

Thank you for this patch. I first ran into the issue with 5.0-beta2 another
way: I noticed that my default completion spec with -D as suggested by the
Bash manual page was no longer working:

       . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
  complete -D -F _completion_loader -o bashdefault -o default

In 5.0-beta2, after running this code, for any command with no completion
specs defined in /etc/bash_completion.d, completing an argument does nothing.

Your second patch does not correct that, but it looks like that's because a
non-zero `foundcs` is coerced to 1 in it, when there are other meaningful
values for the integer as the first parameter for
`pcomp_set_readline_variables(int, int)`.

The attached patch is my own attempt, which seems to correct my issues as well
as the one you raised in this post. Long-time user, first-time poster...

----- End forwarded message -----

Tom Ryder <https://sanctum.geek.nz/>

Attachment: 0001-Corrections-for-initial-word-completion-logic.patch
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]