Getting Emacs to respect my default shell + options

后端 未结 2 1790
执笔经年
执笔经年 2021-02-05 15:04

I\'m trying to get my Emacs shell to mimic that of my standard terminal sessions. Basically I would like it to respect the same PATH as well as the command prompt.

So f

相关标签:
2条回答
  • 2021-02-05 15:35

    For the path, there is the package exec-path-from-shell (OS X only).

    It gets $MANPATH, $PATH and exec-path from the shell and sets them for emacs.

    0 讨论(0)
  • 2021-02-05 15:40

    I don't use zsh but I found this in the zsh FAQ and gave it a try. I got a colorful ls with no funky characters.

    3.10: Why does zsh not work in an Emacs shell mode any more?
    
    Read more: http://www.faqs.org/faqs/unix-faq/shell/zsh/#ixzz0TyTJsHMq
    

    Another method is to put

    #!/bin/sh 
    TERM=emacs exec zsh
    

    into a file ~/bin/eshell, then chmod +x ~/bin/eshell, and tell emacs to use that as the shell by adding

    (setenv "ESHELL" (expand-file-name "~/bin/eshell"))
    

    to ~/.emacs.

    0 讨论(0)
提交回复
热议问题