jj icon indicating copy to clipboard operation
jj copied to clipboard

cli: add nushell completion support

Open NyCodeGHG opened this issue 2 years ago • 8 comments
trafficstars

This PR adds nushell completion support, see #2323 because of https://github.com/clap-rs/clap/issues/5164, this generates invalid nu code for now

Checklist

If applicable:

  • [x] I have updated CHANGELOG.md
  • [x] I have updated the documentation (README.md, docs/, demos/)
  • [ ] I have updated the config schema (cli/src/config-schema.json)
  • [ ] I have added tests to cover my changes

NyCodeGHG avatar Oct 08 '23 21:10 NyCodeGHG

One minor thing is that the nix flake app installs completions for the three shells automatically, and I've no idea about nushell support in nix/nixos

I guess somebody who uses both (nix and nushell, that is) will come along to fix that eventually

necauqua avatar Oct 11 '23 14:10 necauqua

I do use nix and I'm trying to move to nushell, but afaik there is no "standard way" for nushell completion files in nix (please correct me if i'm wrong)

NyCodeGHG avatar Oct 11 '23 14:10 NyCodeGHG

@NyCodeGHG, are you planning to make any changes to this PR?

martinvonz avatar Oct 11 '23 14:10 martinvonz

are you planning to make any changes to this PR?

No, only clap_complete_nushell needs to be updated once https://github.com/clap-rs/clap/pull/5165 is fixed But idk if merging it now is a good idea, because it generates invalid nushell code right now

NyCodeGHG avatar Oct 11 '23 14:10 NyCodeGHG

No, only clap_complete_nushell needs to be updated once clap-rs/clap#5165 is fixed But idk if merging it now is a good idea, because it generates invalid nushell code right now

Ah, I missed that bit. I agree with waiting until we can depend on a fixed version of clap_complete_nushell then. Thanks.

martinvonz avatar Oct 11 '23 14:10 martinvonz

I do use nix and I'm trying to move to nushell, but afaik there is no "standard way" for nushell completion files in nix (please correct me if i'm wrong)

Yeah, I'm actually checking out nushell now, and yeah there's no support in nix as of now

For future reference, once installShellCompletion from here supports nushell (and nushell supports some form of completion files, not sure that it does right now), we should add a parameter to where we call it in the postInstall derivation step in flake.nix

necauqua avatar Oct 12 '23 13:10 necauqua

Any updates on this?

nyabinary avatar Jan 12 '24 17:01 nyabinary

still blocked by clap_complete_nushell generating invalid code

NyCodeGHG avatar Jan 12 '24 18:01 NyCodeGHG

I've made https://github.com/martinvonz/jj/pull/3073 and the fix upstream to handle nushell completions

poliorcetics avatar Feb 17 '24 18:02 poliorcetics

superseded by https://github.com/martinvonz/jj/pull/3073 thanks @poliorcetics

NyCodeGHG avatar Feb 17 '24 18:02 NyCodeGHG