From e6863595bf8a2d88c33d72aae9995561b8e269f1 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Mon, 7 Dec 2009 20:59:00 +0100 Subject: emacs: fix 256 colors support in screen --- emacs | 12 +++++++++++- screenrc | 4 +--- zshrc | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/emacs b/emacs index 6abc971..0eef7a0 100644 --- a/emacs +++ b/emacs @@ -36,6 +36,16 @@ ;; - http://www.brockman.se/software/zenburn/zenburn.el (color-theme-zenburn) +;; Support 256 colors in screen +;; - http://article.gmane.org/gmane.emacs.devel/109504/ +(if (not (window-system)) (load "term/rxvt")) +(defun terminal-init-screen () + "Terminal initialization function for screen." + ;; Use the rxvt color initialization code. + (rxvt-register-default-colors) + (tty-set-up-initial-frame-faces) +) + ;; Don't show the welcome message (setq inhibit-startup-screen t) @@ -173,7 +183,7 @@ (setq kill-read-only-ok 1) ;; Partially integrate the kill-ring and X cut-buffer -(setq x-select-enable-clipboard t) +;(setq x-select-enable-clipboard t) ;; Copy/paste with accentuation intact (setq selection-coding-system 'compound-text-with-extensions) diff --git a/screenrc b/screenrc index d117f65..23942a5 100644 --- a/screenrc +++ b/screenrc @@ -9,9 +9,7 @@ nonblock on # don't block everything, waiting for an unres bufferfile $HOME/.screenex # the file to use for "readbuf" ('<') and "writebuf" ('>'): shell -$SHELL # make the shell in every window a login shell deflogin on # log new screen windows in utmp -#term screen-256color # set $TERM -attrcolor b ".I" # fix 256 color support in urxvt -termcapinfo rxvt* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' +term screen-256color # set $TERM termcapinfo rxvt* ti@:te@:XT # improve mouse scrolling, altscreen on # and text will go into terminal scrollback buffer #screen -t "User" 0 zsh # default windows diff --git a/zshrc b/zshrc index f4796e9..d084b28 100644 --- a/zshrc +++ b/zshrc @@ -270,7 +270,7 @@ function precmd { # set the window title in screen to the currently running program setopt extended_glob function preexec () { - if [[ "$TERM" == "screen" ]]; then + if [[ "$TERM" == "screen-256color" ]]; then local CMD=${1[(wr)^(*=*|sudo|-*)]} echo -n "\ek$CMD\e\\" fi @@ -309,7 +309,7 @@ function setprompt () { rxvt*) PR_TITLEBAR=$'%{\e]0;%(!.*ROOT* | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}' ;; - screen) + screen*) PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.*ROOT* |.)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}' # ensure SSH agent is still usable after an X restart SSH_AUTH_SOCK=`find /tmp/gpg-* -name S.gpg-agent.ssh` -- cgit v1.2.3