elves / elvish

Powerful scripting language & versatile interactive shell

Home Page:https://elv.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support request: Where to install elvish completions in distro packages?

VorpalBlade opened this issue · comments

I'm writing some software that supports shell completions, using the Rust library (crate) bpaf. It has support for generating completion files for several different shells, including elvish.

I'm also packaging my software for Arch Linux (possibly other distros as well down the line). As part of that I install the completions as part of the package in the system location for the shell. Unfortunately I haven't been able to find out where I'm supposed to put completion files for elvish. I.e. what goes on the last line of this:

    "$_cmd_name" --bpaf-complete-style-zsh > "$pkgdir/usr/share/zsh/site-functions/_${pkgname}"
    "$_cmd_name" --bpaf-complete-style-bash > "$pkgdir/usr/share/bash-completion/completions/${pkgname}"
    "$_cmd_name" --bpaf-complete-style-fish > "$pkgdir/usr/share/fish/vendor_completions.d/${pkgname}.fish"
    # TODO: Where do completions for elvish go?
    #"$_cmd_name" --bpaf-complete-style-elvish

(I don't use elvish myself, I'm a zsh user, but I want to make the experience as good as possible for users of all supported shells.)

This is a duplicate of #1564; see the discussion there, which indicates that no such automatic discovery path currently exists.

Thank you. The reasoning seems strange (if I install a command I trust it (or I would sandbox it with flatpak), so there is little point in not also trusting the completion files, especially since they are usually installed by distro packages anyway, and installing a distro package is an act of trust).

I'm having a hard time seeing the security angle on this, since all the relevant code is in the same trust level, thus if I'm evil I could for example just patch your init file instead.