carapace-sh / carapace-bin

multi-shell multi-command argument completer
https://carapace.sh
MIT License
972 stars 54 forks source link

nushell: carapace completion doesn't work for Nu after 0.92 if `XDG_CONFIG_HOME` was set #2337

Closed hustcer closed 7 months ago

hustcer commented 8 months ago

Current Behavior

Carapace completion doesn't work for Nu after 0.92 if XDG_CONFIG_HOME was set

BTW: The first line generated by carapace _carapace nushell is incorrect for me:

$env.PATH = ($env.PATH | split row (char esep) | prepend "/Users/hustcer/.config/carapace/bin")

/Users/hustcer/.config/carapace/bin does not exist, which carapace output /usr/local/bin/carapace, However, after correcting the generated init.nu still doesn't work for me.

Expected Behavior

Carapace completion should work with or without XDG_CONFIG_HOME env config

Steps To Reproduce

  1. Nushell support XDG_CONFIG_HOME env config now, set it in system env and start nu
  2. cd a git repo and type git st then tab no completion appears
  3. Remove XDG_CONFIG_HOME env config and restart Nu again with the same config file everything works as expected, the completion works fine.

Version

1.0.0

OS

Shell

Anything else?

key value
version 0.92.2
branch nightly
commit_hash 394487b3a75c12679681924410169697814a74d4
build_os macos-x86_64
build_target x86_64-apple-darwin
rust_version rustc 1.75.0 (82e1608df 2023-12-21)
rust_channel 1.75.0-x86_64-apple-darwin
cargo_version cargo 1.75.0 (1d8b05cdd 2023-11-20)
build_time 2024-04-06 01:27:03 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, sqlite, static-link-openssl, trash, which
installed_plugins
rsteube commented 8 months ago

The modification of the path is not for the carapace binary but for shims.

It works for me on linux. Did you move/update the nushell configuration at the new location (${XDG_CONFIG_HOME}/nushell/config.nu)?

hustcer commented 8 months ago

Did you move/update the nushell configuration at the new location (${XDG_CONFIG_HOME}/nushell/config.nu)?

Yes, I did. It's weird.

hustcer commented 8 months ago

I have tried it on Windows, It works for me too.

rsteube commented 7 months ago

Tried it on a mac and it seems fine as well. Might be sth. with your configuration?

hustcer commented 7 months ago

Tried it on a mac and it seems fine as well. Might be sth. with your configuration?

Agreed, It's most likely my system configuration issue, I'll look into it in a couple of days when I get some time over the weekend