emacs 终端中的奇怪字符 zsh [英] Weird character zsh in emacs terminal

查看:22
本文介绍了emacs 终端中的奇怪字符 zsh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MacOS 下的 emacs(M-x 术语)中使用终端时,由于某种原因,它总是在 zsh 中的每一行之前发布字符 4m,并且总是打印包含用户信息的 2 行,例如

When using the terminal in emacs (M-x term) under MacOS for some reason it always posts the characters 4m before every line in zsh and always prints 2 lines containing the user info such as

4m--(jesus@laptop:/dir)----
4m--(jesus@laptop:/dir)----
prompt>

这比什么都烦人,但我只是想知道是否有办法解决这个问题.我似乎在 Mac OS emacs 终端模式下的 Zsh 中也有问题,当大量输出写入它时,它似乎将其全部减少到一行并不断覆盖同一行(可能相关,因为 4m 可能只是一个特殊的emacs 以不同方式处理的字符会影响格式).

It's more of an annoyance than anything but I was just wondering if there's a way to fix this. I also seem to have issues in Zsh in Mac OS emacs terminal mode when a lot of output is written to it it seems to reduce it all to one line and constantly overwrite the same line (may be related as the 4m is possibly just a special character that emacs is treating differently which can affect formatting).

如果需要,我可以发布我的 .zshrc 和 .emacs 文件.

If need be I can post my .zshrc and .emacs files.

推荐答案

您没有 eterm-color terminfo.首先,您尝试在配置文件中添加以下 S-exp 并进行评估.

You don't have eterm-color terminfo. First, you try to add following S-exp in your configuration file and evaluate.

;; Use Emacs terminfo, not system terminfo
(setq system-uses-terminfo nil)

如果之前的设置没有解决问题,你应该创建 eterm-color terminfo通过使用以下命令.(terminfo 路径可能与您的系统不同)

If problem is not resolved previous setting, you should create eterm-color terminfo by using following command. (terminfo path may different from your system)

# If you use Cocoa Emacs or Carbon Emacs
tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti

这篇关于emacs 终端中的奇怪字符 zsh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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