Closed hexclover closed 10 months ago
Yes, $path is specific to oh-my-fish: https://github.com/oh-my-fish/oh-my-fish/blob/d427501b2c3003599bc09502e9d9535b5317c677/docs/en-US/Packages.md?plain=1#L70
I know nix fairly well, but I don't use home manager, so I don't have an easy way to experiment.
We could wrap the entire contents of init.fish in an if statement that checks for the presence of $path/functions/__git.init.fish
Maybe we should just wrap the source
line? Because home-manager still wants init.fish
to initialize the plugin, it just adds the functions
directory to fish_function_path
before sourcing init.fish
so source $path/...
becomes unnecessary.
I just want to add that it also breaks scp
.
Hello, thank you for the fantastic plugin! I have a NixOS system with
and I am look into the issue of being unable to SSH to any host through
ProxyJump
. It turns out if I (somehow) skip executing this line ofinit.fish
, the problem magically disappears:https://github.com/jhillyerd/plugin-git/blob/641b8722948bde5863cc3a049c2fde394158122d/init.fish#L2
It seems that since I don't have the
$path
variable defined in my environment, this line is expanded simply assource
. According to fish's document, the behavior ofsource
isSo in an interactive shell, the command fails and returns immediately; since home-manager generates code for loading the
__git.init
function, L3 ininit.fish
can be executed and the plugin itself works without problem. But in the fish process SSH spawns to execute the proxy command (fish -c 'exec ssh ...'
), thesource
command will wait for input indefinitely, before continuing toexec
.I would like to know about the usage of this
$path
variable to come up with a proper fix of the problem. I guess it comes from some plugin framework but I failed to find relevant information. Or we can just modifyinit.fish
to skip initialization if we are not in an interactive shell.