I have several binaries I would like to call from eshell
; I'm running into not-found-in-path errors. They are callable from a normal shell.
Following the advice from the emacs wiki:
~/.emacs.d/config $ which cargo
which: no cargo in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin)
~/.emacs.d/config $ (setq exec-path (append exec-path '("/home/thor/.cargo/bin")))
("/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/sbin" "/bin" "/usr/games" "/usr/local/games" "/snap/bin" "/usr/lib/emacs/27.1/x86_64-linux-gnu" "/home/thor/.cargo/bin")
~/.emacs.d/config $ which cargo
which: no cargo in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin)
~/.emacs.d/config $ (setenv "PATH" (concat (getenv "PATH") ":/home/thor/.cargo/bin"))
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/thor/.cargo/bin
~/.emacs.d/config $ which cargo
which: no cargo in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/thor/.cargo/bin)
whereas from a normal shell:
$ which cargo
/home/thor/.cargo/bin/cargo