pass-otp icon indicating copy to clipboard operation
pass-otp copied to clipboard

[WIP] Add fish completions (Fixing #118)

Open harmtemolder opened this issue 3 years ago • 5 comments

I dove into the way fish completions work and came up with a solution to add them for pass otp. They work, but still a couple of TODOs before it's ready for production:

  • [ ] Do not suggest a second subcommand after a first one is used
  • [x] Do not suggest --clip on insert, append or validate
  • [ ] Do not hard-code the path to the main pass completions
  • [ ] Make sure the Makefile does not overwrite the main pass completions
  • [ ] Make sure the default FISHCOMPDIR is in $fish_complete_path, and before the main pass completions' location

harmtemolder avatar Dec 13 '21 12:12 harmtemolder

If you installed pass on a Mac using homebrew the path to the completion file is:

/opt/homebrew/share/fish/vendor_completions.d/pass.fish

Shouldn't the path be set by the package maintainer for whatever distro this is packaged for?

This is working great on my Mac.

apastuszak avatar Jan 15 '22 20:01 apastuszak

This is working great on my Mac.

Do you mean these added completions?

Shouldn't the path be set by the package maintainer for whatever distro this is packaged for?

I guess it should, but I'm not in the trade of making packages and don't know how to do this. That means I'd need help to finish this PR.

@tadfisher Can you—or do you know anyone who can—help me figure out a way to dynamically get the location of the original pass's completions so that I don't have to hard-code them?

harmtemolder avatar Jan 16 '22 05:01 harmtemolder

I made my own completion following @tadfisher's comments. These are on a separate file named 'pass-otp.fish' and instead of copying it to /usr/share/fish/vendor_completions.d/pass.fish, I copy to my private XDG config file (.config/fish/completions/), so it doesn't conflict with pass.fish. I know nothing about fish completions, I basically copied and pasted and followed along the pass git command as suggested, but it seems to be working fine.

Personally I manage that file within my dotfiles, but if you want I can open a PR to contribute this file. I am not sure how to add that to the Makefile but it shouldn't be that hard.

vonpupp avatar Sep 10 '23 02:09 vonpupp

I made my own completion following @tadfisher's comments. These are on a separate file named 'pass-otp.fish' and instead of copying it to /usr/share/fish/vendor_completions.d/pass.fish, I copy to my private XDG config file (.config/fish/completions/), so it doesn't conflict with pass.fish. I know nothing about fish completions, I basically copied and pasted and followed along the pass git command as suggested, but it seems to be working fine.

Personally I manage that file within my dotfiles, but if you want I can open a PR to contribute this file. I am not sure how to add that to the Makefile but it shouldn't be that hard.

i tried this but it doesn't help one bit with this issue at least https://github.com/tadfisher/pass-otp/issues/187

BarbzYHOOL avatar Sep 20 '23 00:09 BarbzYHOOL