You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a bare repo at ~/.cfg with a worktree of ~ (happens to be my dotfiles repo), the following command gives an error:
~ > carapace git nushell "git" "--git-dir" "~/.cfg" "--work-tree" "~" "add" ""
[{"value":"ERR","display":"ERR","description":"stat /Users/wil/~: no such file or directory","style":{"fg":"red","attr":"b"}},{"value":"_","display":"_"}]
Changing the command to carapace git nushell "git" "--git-dir" "/Users/wil/.cfg" "--work-tree" "/Users/wil" "add" "" seems to avoid that error (this solution is not ideal, as I'd rather use ~ expansion for home instead of getting weird with environment variables, especially considering the nushell completer setup doesn't seem to expand environment variables/interpolate strings?):
However, it still doesn't quite work how it should. In my instance, if I cd to ~/.config/nushell and run the command again, it still uses paths relative to the worktree even though they should be relative to the CWD:
In the above instance, ~/.config/nushell > carapace git nushell "git" "--git-dir" "~/.cfg" "--work-tree" "~" "add" "" to output config.nu.
Steps To Reproduce
With carapace 1.0.5, run carapace git nushell "git" "--git-dir" "~/.cfg" "--work-tree" "~" "add" "" with the CWD being anything other than the worktree dir, in this case ~. Don't think this is isolated to nushell, seems to happen in bash as well.
Version
1.0.5
OS
Darwin
Linux
Termux
Windows
Shell
Bash
Elvish
Fish
Nushell
Oil
Powershell
Xonsh
Zsh
Anything else?
No response
Polar
The text was updated successfully, but these errors were encountered:
Homedir expansion is one of the tough topics.
There's a difference between unquoted ~ (expanded) and quoted "~" (not exanded) tilde.
But the information of it being quoted or not gets lost along the way.
I think it's safe for now to simply assume expansion here if one passes the ~ prefix as argument.
But be aware that while it shows completions using carapace the git command will likely fail if quoted:
Current Behavior
With a bare repo at ~/.cfg with a worktree of ~ (happens to be my dotfiles repo), the following command gives an error:
Changing the command to
carapace git nushell "git" "--git-dir" "/Users/wil/.cfg" "--work-tree" "/Users/wil" "add" ""
seems to avoid that error (this solution is not ideal, as I'd rather use ~ expansion for home instead of getting weird with environment variables, especially considering the nushell completer setup doesn't seem to expand environment variables/interpolate strings?):However, it still doesn't quite work how it should. In my instance, if I
cd
to~/.config/nushell
and run the command again, it still uses paths relative to the worktree even though they should be relative to the CWD:Expected Behavior
In the above instance,
~/.config/nushell > carapace git nushell "git" "--git-dir" "~/.cfg" "--work-tree" "~" "add" ""
to outputconfig.nu
.Steps To Reproduce
With
carapace
1.0.5, runcarapace git nushell "git" "--git-dir" "~/.cfg" "--work-tree" "~" "add" ""
with the CWD being anything other than the worktree dir, in this case~
. Don't think this is isolated to nushell, seems to happen in bash as well.Version
1.0.5
OS
Shell
Anything else?
No response
Polar
The text was updated successfully, but these errors were encountered: