让Emacs尊重我的默认shell +选项 [英] Getting Emacs to respect my default shell + options
问题描述
我试图让我的Emacs shell模拟我的标准终端会话。基本上,我希望它尊重相同的路径以及命令提示符。
到目前为止,我有几个问题:
- 找不到PATH,下面是我正在使用的修复程序。
- 我正在获取ascii颜色代码我尝试了另一个修复的地方。
我的mwilliams.el文件中有以下内容。前几行让我访问Mx shell中的/ usr / local / bin,解决了一半的问题,最后几行让我运行Zsh,但是我的提示非常棘手。
(setenvPATH(concat(getenvPATH):/ usr / local / bin))
(setq exec-path -path'(/ usr / local / bin))
(defun shell()
(interactive)
(ansi-term/ bin / zsh))
使用上述我在Mx shell中可以得到以下内容。 p>
4m\342 / 236/234
正在使用的模式是:(Term:char run yas)
据我所知,它不尊重一些ascii颜色代码在我的Zsh主题。我看到几种颜色通过;所以这是半途而废。我最好的猜测是,我需要它尊重我的.zshrc,其中包含有关我的主题和PATH的信息。
我只是让我的脚在Emacs弄湿,我可以开始将我的日常工作(和其他一切)迁移到Emacs之前,需要的最后几件事情之一。
我正在运行Emacs 23.1( 9.0)在OSX Snow Leopard中。
我不使用zsh,但是在 zsh FAQ ,并尝试一下。我有一个多彩的ls,没有时髦的人物。
3.10:为什么zsh不能在Emacs shell模式下工作?
了解更多: http:// www .faqs.org / faqs / unix-faq / shell / zsh /#ixzz0TyTJsHMq
另一种方法是将
#!/ bin / sh
pre>
TERM = emacs exec zsh
进入文件
〜/ bin / eshell
,然后chmod + x〜/ bin / eshell
,并通过添加(setenvESHELL)告诉emacs将其用作shell (expand-file-name〜/ bin / eshell))
to
〜/ .emacs
。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
.
这篇关于让Emacs尊重我的默认shell +选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!