- Create symlinks in
~/bin
- Then add these lines to
~/.zshenv
. This is needed because runningwsl command
will create a non-login, non-interactive shell andzsh
will source this file in that scenario.
- The above solution will works only on
zsh
, other shells likefish
orcsh
might source different files. - For bash however, there no way to automatically source a file in a non-login non-interactive shell. So one can directly symlink the executable in
/usr/bin
. However it is not recommended as it modifies global executables.
ref: