我正在使用OSX snow leopard系统。当我直接从终端使用emacs时,我有一个很喜欢的颜色设置(例如C/C++),绿底黑字,红色注释,关键词带颜色等等。其中一些是在“终端偏好设置”中设置的,另一些则在我的~/.emacs文件中(见下文)。但是当我从屏幕上运行emacs时,基本的颜色方案相同(绿底黑字),但是着色不同(例如注释字符为红色,但不是整个注释)--这真的很烦人。
任何帮助都将不胜感激!
以下是我的'.emacs'文件(在gnu-screen emacs中无法正常工作):
在我的'.screenrc'文件中:
我认为在我的.screenrc文件中使用“shell -$SHELL”命令会使屏幕中的命令提示符与默认提示符相同——它确实使我的命令行显示为“computername:/DIR/ username$”,而不是只有“bash-3.2$”。
=================================================================
解决方案:感谢Greg E.
我需要将screen中的终端仿真器设置为与我的正常shell相匹配。为此,我添加了以下内容:
任何帮助都将不胜感激!
以下是我的'.emacs'文件(在gnu-screen emacs中无法正常工作):
(global-font-lock-mode t)
(custom-set-faces
'(font-lock-comment-face
((((class color) (background light))
:foreground "tomato")
)))
在我的'.screenrc'文件中:
shell -$SHELL # colors still don't work without this
#term xterm-256color # using this doesn't fix the colors (suggested on some forums)
altscreen on
startup_message off
我认为在我的.screenrc文件中使用“shell -$SHELL”命令会使屏幕中的命令提示符与默认提示符相同——它确实使我的命令行显示为“computername:/DIR/ username$”,而不是只有“bash-3.2$”。
=================================================================
解决方案:感谢Greg E.
我需要将screen中的终端仿真器设置为与我的正常shell相匹配。为此,我添加了以下内容:
export TERM='xterm-color'
到~/.bash_profile
由于某些原因,“term xterm-color”在“〜/ .screenrc”文件中无效。