Nukesor / pueue

:stars: Manage your shell commands.
MIT License
4.68k stars 128 forks source link

Feature: add shell completions for `nushell` #527

Closed Tirka closed 2 months ago

Tirka commented 2 months ago

Rationale

pueue recommended as a temporary workaround solution for background task spawning for nushell users.

It would be nice to have shell completions within nushell.

Usage

Currently nushell has no preferred way to install completion files into system: https://github.com/nushell/nushell/issues/11337

One possible way of doing this could be:

1) generate completions

mkdir /usr/share/nushell-completions/pueue/
pueue completions nushell /usr/share/nushell-completions/pueue/
mv /usr/share/nushell-completions/pueue/pueue.nu /usr/share/nushell-completions/pueue/mod.nu

2) open nushell config

config nu

3) add reference to completion file into config (at the bottom)

use ~/.config/nushell/completions/pueue/ *

4) save config and restart the shell

Screenshot

image

Tirka commented 2 months ago

BTW

Not sure why this code block repeats twice, looks like a bug

https://github.com/Nukesor/pueue/blob/cc7aedd9889e3a24337e4bc2eb50b1722267a32c/pueue/src/bin/pueue.rs#L104-L144

Nukesor commented 2 months ago

Yep, not sure how that managed to sneak in there. Feel free to delete that duplicate blob. Probably a copy past error by me when i introduced the feature to print completions to stdout.

Also, could you add nushell to the completions integrationt test :)?

github-actions[bot] commented 2 months ago

Test Results

  3 files   22 suites   2m 39s :stopwatch: 148 tests 148 :white_check_mark: 0 :zzz: 0 :x: 316 runs  316 :white_check_mark: 0 :zzz: 0 :x:

Results for commit cc7aedd9.

Tirka commented 2 months ago

Also, could you add nushell to the completions integrationt test :)?

The existing test has already been corrected. Should I add something else?

Nukesor commented 2 months ago

Nice, thanks for the contribution :) Change looks good to me!