【问题标题】:EMACS 24 Arch linux not supporting 256 colorEMACS 24 Arch linux 不支持 256 色
【发布时间】:2014-03-07 05:34:33
【问题描述】:

我已经查看并尝试了很多东西,但我仍然无法在 EMACS 24 中获得 256 色支持。

我试过这个:emacs 256 colour support

但这对我不起作用。

我在 vim 和终端中支持 256 色,但不支持 emacs。

tput colors

输出 256

但当我在 emacs 中执行 list-colors-display 时,它只显示 8

当前设置:

Manjaro Linux(基于 Arch)

guake终端

zsh -> 别名 e='TERM=xterm-256color emacs -nw'

tmux

【问题讨论】:

  • 您的 TERM 通常设置为什么?你是在screen还是tmux下运行?
  • 是的,我在 tmux 中运行..我的问题是我的大部分设置
  • 尝试“TERM=xterm-256color tmux attach -d -t ${SESSION}”,然后在启动 emacs 之前使用 colortest-256 测试显示

标签: linux emacs 256color


【解决方案1】:

尝试在您的~/.Xresources 文件中插入这一行:

xterm*termName: xterm-256color

查看 archlinux wiki 了解更多信息:Xterm - ArchWiki

根据此页面Hidden gems of xterm - Lukáš Zapletal,手动设置TERM 变量是一种不好的做法。

【讨论】:

    【解决方案2】:

    你可以尝试在.bashrc中使用这个:

    # 256 colors Tmux, "force tmux to assume the terminal supports 256 colours"
    # See man tmux
    alias tmux='tmux -2'
    
    export TERM=xterm-256color
    

    在你的.emacs:

    ;; "Terminal initialization function for screen."
    ;; Use the xterm color initialization code.
    (load "term/xterm")
    

    【讨论】:

      【解决方案3】:

      我在使用 tmux 时遇到了这个问题,因为我进入 tmux 时的 TERM 环境是 xterm 而不是 xterm-256color。一旦我修复了emacs就可以了。

      colortest-256 也是一个方便的测试工具。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-02-27
        • 2012-01-19
        • 1970-01-01
        • 2017-06-08
        • 2012-03-17
        • 2021-03-30
        相关资源
        最近更新 更多