elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.53k stars 297 forks source link

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

Open VorpalBlade opened 6 months ago

VorpalBlade commented 6 months ago

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.)

str4d commented 5 months ago

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

VorpalBlade commented 5 months ago

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.