获得Emacs ansi-term和Zsh玩得很好 [英] Getting Emacs ansi-term and Zsh to play nicely

查看:291
本文介绍了获得Emacs ansi-term和Zsh玩得很好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在我的emacs会话中使用Zsh,没有emacs重新映射所有的Zsh键。我发现ansi-term的作品相当不错,但我仍然有一些问题。我得到了很多垃圾字符输出,我可以解决它:

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. I was getting lots of junk characters outputted with, I was able to fix it with:

## Setup proper term information for emacs ansi-term mode
[[ $TERM == eterm-color ]] && export TERM=xterm

但是,一切仍然不能正常工作。现在我输出的画面出现问题,尤其是在使用C-r等搜索时。

But everything still doesn't work perfectly. Now I am having trouble with output being drawn offscreen , especially when using something like C-r for search.

任何想法。任何人都有Zsh + Ansi-term工作正常?

Any thoughts. Anyone else have Zsh + Ansi-term working properly?

推荐答案

尝试 MultiTerm

它是唯一的Emacs终端模式,似乎与zsh发挥不错。它允许您轻松设置要由emacs捕获的命令以及要路由到终端的哪些命令。对于我来说,默认的设置已经足够好了。

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.

此外,将以下内容添加到.zshrc中,以允许emacs在您周围的时候跟踪您当前的目录。

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

这篇关于获得Emacs ansi-term和Zsh玩得很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆