Getting Emacs ansi-term and Zsh to play nicely

后端 未结 4 631
[愿得一人]
[愿得一人] 2021-02-01 21:42

I\'ve been trying to use Zsh within my emacs session, without emacs remapping all the Zsh keys. I found ansi-term works pretty well for this but, I\'m still having some problems

4条回答
  •  感动是毒
    2021-02-01 22:42

    Try MultiTerm.

    Its the only Emacs terminal mode that seems to play nice with zsh. It allows you to easily set which commands you want captured by emacs and which you want routed to the terminal. The default settings have been good enough for me so far though.

    Also, add the following to your .zshrc to allow emacs to track your current directory as you cd around.

    if [ -n "$INSIDE_EMACS" ]; then
      chpwd() { print -P "\033AnSiTc %d" }
      print -P "\033AnSiTu %n"
      print -P "\033AnSiTc %d"
    fi
    

提交回复
热议问题