Skip to main content
Topic: Bash/zsh completion for s6-rc (requires version 0.5.3.3 or later) (Read 591 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Bash/zsh completion for s6-rc (requires version 0.5.3.3 or later)

With v0.5.3.3, Skarnet released the fix to an oversight that prevented s6-rc from reading data about system services as a non-root user. Now, bash completion scripts for s6-rc are finally possible.

I've written this script in 2022, but felt most users wouldn't benefit if they had to manually change the PKGBUILD to backport the fix.

I made sure it handles the -l and -c options given for the s6-rc programs for accurate completions even when working with user services. s6-rc -l /run/$USER/s6-rc change <TAB> (if you followed the guide on the wiki) will only show your user services.

See attached gifs for examples of it in action.

Installation instructions
1. Clone the repo with the completion scripts: https://github.com/capezotte/s6-shell-completion
2.b. For bash, source bash/s6-rc.bash the end of your .bashrc.
2.z. For zsh, ln -s "$PWD/zsh/s6-rc" ~/.local/share/zsh/functions/s6-rc, and restart zsh (a simple exec zsh should suffice).

Re: Bash-completion for s6-rc (requires version 0.5.3.3 or later)

Reply #1
I've made zsh completions as well, and created a new git repository containing both:

https://github.com/capezotte/s6-shell-completion

Install instructions are still the same for bash (clone and source s6-rc.bash). For zsh, symlink zsh/s6-rc to ~/.local/share/zsh/functions.

 

Re: Bash/zsh completion for s6-rc (requires version 0.5.3.3 or later)

Reply #2
Scripts have been updated to offer the POSIX process group management switches.