guix-devel
[Top][All Lists]
Advanced

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

Re: [completion] Completion scripts not loaded from ~/.guix-profile/etc/


From: Maxim Cournoyer
Subject: Re: [completion] Completion scripts not loaded from ~/.guix-profile/etc/profile
Date: Mon, 14 Oct 2019 22:12:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hello,

YOANN P <address@hidden> writes:

> Hi guix,
>
> Not sure if it needs to be add to the guix documentation or directly included 
> in "~/.guix-profile/etc/profile" generation process, 
> but the completion scripts provided by packages seem not to be loaded.
> For example, if i only install the package "git", the completion scripts for 
> "git" reside in "~/.guix-profile/etc/bash_completion.d/git".
> But there is no loading instructions for those files in 
> "~/.guix-profile/etc/profile".
> So after sourcing "~/.guix-profile/etc/profile", a user need to loop over 
> files in "~/.guix-profile/etc/bash_completion.d/" 
> and "~/.guix-profile/share/bash-completion" to source them manually because 
> native bash/bash-completion from the user distribution 
> are not aware of the new completion scripts available in 
> "~/.guix-profile/etc/bash_completion.d/" and  
> "~/.guix-profile/share/bash-completion".
>
> I think a "bash loop" need to be added for this purpose in the generation of 
> "~/.guix-profile/etc/profile" and in the meantime add a section for this
> inside "2.6 Application Setup" section be cause i didn't find any 
> instructions about this on the documentation.
>
> Regards,
> Yoann

I think was is needed is to install the 'bash-completion' package.  On
the Guix System, this is was gets run at login (/etc/profile, which
sources /etc/bashrc):

--8<---------------cut here---------------start------------->8---
# The 'bash-completion' package.
if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ]
then
  # Bash-completion sources ~/.bash_completion.  It installs a dynamic
  # completion loader that searches its own completion files as well
  # as those in ~/.guix-profile and /run/current-system/profile.
  source /run/current-system/profile/etc/profile.d/bash_completion.sh
fi
--8<---------------cut here---------------end--------------->8---

I also have this line in my ~/.bashrc, and IIRC it was useful in getting
the completion to work (not sure if it's required anymore):

--8<---------------cut here---------------start------------->8---
# Source the system-wide file.
source /etc/bashrc
--8<---------------cut here---------------end--------------->8---

HTH,

Maxim



reply via email to

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