reddit / emacs

strange behavior in eshell

ntrysii · 2022-05-20 19:14
hi guys, i have a problem in eshell, whenever i include a directory to eshell path using addpath, the directory gets added normally, then i can run a command from that directory only once, then it is no longer available in eshell. when checking the PATH env it seems normal when restarting emacs everything starts normally and then the i face the same problem this is the configurations i use for eshell buffers : (defun my-eshell-mode-hook() (define-key eshell-mode-map (kbd "C-j") 'eshell-send-input) (general-define-key :states '(normal visual motion insert) :keymaps '(eshell-mode-map) (kbd "C-a") 'eshell-bol (kbd "C-x C-s") nil (kbd "C-j") 'eshell-send-input (kbd "M-i") 'completion-at-point ) (require 'pcomplete) (require 'pcmpl-git) (setq-local corfu-auto t) (define-key eshell-mode-map (kbd "C-x C-s") (lambda () (interactive))) (general-define-key :keymaps '(eshell-mode-map) :states '(normal visual motion) "gh" 'eshell-bol "s" nil) (defalias 'pcomplete/ssh 'pcmpl-args-pcomplete-on-man) (defalias 'pcomplete/systemctl 'pcmpl-args-pcomplete-on-help) (eshell/addpath "~/go/bin/") )
fela_nascarfan · 2022-05-22 11:10
Hm, strange, I have it in my config file in the same manner ( `(eshell/addpath "/home/richard/bin")`). Only one difference is using `/home/<user>` instead of `~/`.
ntrysii · 2022-05-23 17:33
i tried using this and nothing.
fela_nascarfan · 2022-05-24 06:46
So if I undertand well, the variable `eshell-path-env` somehow automatically changes after a certain command... What is the command?
ntrysii · 2022-05-24 20:12
the variable is the same but it is no longer indexes the all the directories especially those i have added using `eshell/addpath.` it works now i dont know why but thanks for your help anyway i really appreciate it.