EMACS가 256 개의 색상에 액세스 할 수 있도록 Linux X 터미널을 설정하려면 어떻게해야합니까?

StackOverflow https://stackoverflow.com/questions/684424

  •  22-08-2019
  •  | 
  •  

문제

내가 달릴 때 emacs -nw X 터미널 창에서 M-x list-colors-display, 나는 Paltry 팔레트가 제공됩니다.

black                                                     
red    
green  
yellow 
blue   
magenta
cyan   
white  

265 개의 색상을 얻을 수 있다고 들었습니다. 설정 TERM 환경 변수 xterm-256color 일을하지 않습니다. 무엇을합니까?

도움이 되었습니까?

해결책

에 따르면 이것 당신은 필요합니다 ncurses-term 설정 외에도 도서관 TERM 에게 xterm-256color.

괜찮아, 이것 다른 것들이 있습니다.

The xterm in Ubuntu Edgy does not advertise 256 color support by
default.  To fix this you need to install a 256 color terminfo entry,
and tell xterm to use it:

    apt-get install ncurses-term
    echo XTerm.termName: xterm-256color \
      >>~/.Xdefaults
    xrdb -merge ~/.Xdefaults

그리고 :

So you need a file term/screen-256color.el in your load-path.  Emacs
22 expects it to contain a terminal-init-screen defun.  Emacs 21
expects it to contain a bunch of top-level forms.  Here's what I use:

    ;;; This is for GNU Emacs 22
    (defun terminal-init-screen ()
      "Terminal initialization function for screen."
      ;; Use the xterm color initialization code.
      (load "term/xterm")
      (xterm-register-default-colors)
      (tty-set-up-initial-frame-faces))

    ;;; This is for GNU Emacs 21
    (if (= 21 emacs-major-version)
        (load "term/xterm-256color"))

For Emacs 21, you also need to install the xterm-256color.el file from

    http://www.splode.com/~friedman/software/emacs-lisp/src/term/xterm-256color.el

다른 팁

환경 TERM 에게 xterm-256color ~이다 당신은 무엇을하길 원합니까. 또한 EMACS 22 (적어도)는 256 개의 색상을 표시하기 위해 나에게 특별한 구성이 필요하지 않았습니다. 이것 좀 봐 관련 질문. 이랑 ncurses-term 패키지가 설치되어있어 Ubuntu 버전과 함께 제공되는 바닐라 Xterm을 사용하여 EMAC에서 256 개의 색상을 얻을 수있었습니다 (이 경우 Interpid,이 경우 이전 버전에서는 괜찮을 것이라고 생각합니다). 또한 그놈 터미널, Konsole 및 Putty를 사용하여 256 개의 색상을 얻었습니다.

내가 이것을 구글링했을 때 나는 대부분의 배포판으로 포장 된 터미널 에뮬레이터에서 256 개의 컬러 지원을 활성화하지 못한다는 인상을 받았습니다.

나는 당신이 계속보고 있다면 당신이 내가 한 것과 같은 결론에 올 수 있다고 생각합니다. 가장 좋은 대답은 다운로드하는 것입니다 urxvt 그리고 모든 종과 휘파람을 켜고 직접 컴파일하십시오.

VIM을 사용하고 있었기 때문에 EMAC에 특정한 다른 종속성/gotchas가있을 수 있지만 256 개의 색상을 지원하는 터미널이 중요합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top