fredag den 06 december 2024 skrev Tobias Geerinckx-Rice:

> libsixel, through mpv, but you misunderstand me, there's nothing
> wrong with it. It's the canary in the coal mine.
>
> The 'broken code' I meant is this
>
>>for f in "$HOME"/.guix-profile/etc/bash_completion.d/* ; do
>>        . "$f"
>>done
>
> Origin aside, it's broken. Completion files aren't written to be
> sourced this way. They'll get none of the library functions normally
> available to them–such as 'have'. Hence the error. There is no bug.
>
> The correct solution is to let the bash-completion package take care
> of bash completion, by sourcing etc/profile.d/bash_completion.sh at
> shell startup.
>
> Guix System *does* explictly check for it! I'd missed that. Well
> spotted:
> <https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system.scm#n1134>
>
> You'll have to do the same, but with $HOME/.guix-profile substituted
> for /run/current-system/profile.

That seems to have resolved the issue. I added the above lines to have access 
to completion for the packages I have installed in my user-profile.

I changed my config to:

    # Profile-specific completion
    if [ -f  "$HOME"/.guix-profile/etc/profile.d/bash_completion.sh ]; then
        source "$HOME"/.guix-profile/etc/profile.d/bash_completion.sh
    fi

Its unfortunate that this needs to be added manually on foreign distros.

-- 
Med vänliga hälsningar Einar

Reply via email to