NOT Working: /bin/bash: Psu: command not found

M-! cmd Psu


M-! cmd ls


cat ~/.bashrc | grep Psu
cat ~/.bashrc | grep aliases

 alias Psu='sudo pacman -Syyu'
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases


cat ~/.bash_profile | grep -A 2 bashrc

if [ -f ~/.bashrc ]; then
    . ~/.bashrc


cat ~/.bash_aliases

if [ -f ~/.bashrc ]; then
    . ~/.bashrc

I've read and followed: https://emacs.stackexchange.com/a/28999/21118

What am I missing?


From the documentation:

To specify the shell file name used by M-x shell, customize the variable explicit-shell-file-name. If this is nil (the default), Emacs uses the environment variable ESHELL if it exists. Otherwise, it usually uses the variable shell-file-name

You obviously want to use bash shell; may I suggest a piece of my Emacs configuration:

;; make emacs recognize my bash aliases and functions & use bash as default shell                                                                                              
(setq explicit-shell-file-name "/bin/bash")                                                                                                                                    
(setq shell-file-name "bash")                                                                                                                                                  
(setq explicit-bash.exe-args '("--noediting" "--login" "-ic"))                                                                                                                 
(setq shell-command-switch "-ic")                                                                                                                                              
(setenv "SHELL" shell-file-name)
  • What does the flag "-i" does to shell-command-switch?
    – aadcg
    Oct 21 '20 at 20:09
  • Interactive, makes sense.
    – aadcg
    Oct 22 '20 at 10:05
  • Thank you. Still no .bashrc aliases in eshell. Tried [0] as well. Any other suggestions? [0] github.com/purcell/exec-path-from-shell
    – jjk
    Aug 22 '21 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.