diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-12-07 20:59:00 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-12-07 20:59:41 +0100 |
commit | e6863595bf8a2d88c33d72aae9995561b8e269f1 (patch) | |
tree | 9c8817d1caf626f817eb9897770000a3bb50c35a | |
parent | 21b8518d20ae44e125e1a91459a9e968f86e82bd (diff) | |
download | dotfiles-e6863595bf8a2d88c33d72aae9995561b8e269f1.tar.xz |
emacs: fix 256 colors support in screen
-rw-r--r-- | emacs | 12 | ||||
-rw-r--r-- | screenrc | 4 | ||||
-rw-r--r-- | zshrc | 4 |
3 files changed, 14 insertions, 6 deletions
@@ -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) @@ -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 @@ -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` |