emacs shell插件,让Emacs尊重我的默认shell +选项

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 far I have a few issues:

PATH isn't found, below is the fix I'm using for that.

I'm getting ascii color codes all over the place with another fix I tried.

I have the following in my mwilliams.el file. The first few lines give me access to /usr/local/bin in M-x shell, which solves half the problem and the last few lines get me running with Zsh but my prompt is very screw.

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))

(setq exec-path (append exec-path '("/usr/local/bin")))

(defun shell ()

(interactive)

(ansi-term "/bin/zsh"))

With the above I get the following all throughout when I M-x shell.

4m\342/236/234

The modes being used are: (Term: char run yas)

As far as I can tell it's not respecting some of the ascii color codes in my Zsh theme. I am however seeing a few colors coming through; so it's half way there. My best guess is that I need it to respect my .zshrc which contains information about my theme and PATH.

I'm just getting my feet wet in Emacs and getting a solid shell is one of the last few things I need before I can start migrating my daily work (and everything else) over to Emacs.

I'm running Emacs 23.1 (9.0) in OSX Snow Leopard.

解决方案

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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值