From bb17c96e76c4c62b3e74b66f63a6834ecfb7f6f9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 21 Nov 2012 11:19:43 +0900 Subject: [PATCH 1/2] fix TERM for tmux --- bashrc | 7 ++++++- tmux.conf | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index d7add76..ad4a2f1 100755 --- a/bashrc +++ b/bashrc @@ -55,6 +55,11 @@ export GIT_PAGER="less -F" export GIT_EDITOR="$EDITOR" echo "$TERM" | grep '^screen' >/dev/null 2>&1 || export TERM_ORIG=$TERM test "$TERM" = screen && test "$TERM_ORIG" = xterm-256color && TERM=screen-256color +if test -n "$TMUX" && \ + test -n "tmux display -p '#{client_termname}' | grep -o 256color" +then + TERM=screen-256color +fi test -z "$TMP" && export TMP=/tmp/${USER}-tmp mkdir -p "$TMP" @@ -100,7 +105,7 @@ _timeformat_rfc2822="%a, %d %b %Y %T %z" alias ls="ls -hCF${_coloroption}${_timeoption}" # export GREP_OPTIONS="" -alias gr="grep -n${_coloroption}" +alias gr="grep -n --color=always" iswindows && alias grep="grep -n" # alias ll="ls -l" # alias la="ls -A" diff --git a/tmux.conf b/tmux.conf index 01bc6fe..9a59b80 100644 --- a/tmux.conf +++ b/tmux.conf @@ -38,3 +38,7 @@ setw -g window-status-current-attr bold set -g mode-bg white set -g mode-fg black + +# this does not work because it runs asyncly +# if "test -n \"tmux display -p '#{client_termname}' | grep -o 256color\"" \ +# "set -g default-terminal screen-256color" "set -g default-terminal screen" From dab58242f1408fb9485c2987a7e42a7b13fb5525 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 21 Nov 2012 11:22:16 +0900 Subject: [PATCH 2/2] remove TERM_ORIG --- bashrc | 2 -- 1 file changed, 2 deletions(-) diff --git a/bashrc b/bashrc index ad4a2f1..bf0f6a1 100755 --- a/bashrc +++ b/bashrc @@ -53,8 +53,6 @@ export LC_MESSAGES=C export VISUAL="$EDITOR" export GIT_PAGER="less -F" export GIT_EDITOR="$EDITOR" -echo "$TERM" | grep '^screen' >/dev/null 2>&1 || export TERM_ORIG=$TERM -test "$TERM" = screen && test "$TERM_ORIG" = xterm-256color && TERM=screen-256color if test -n "$TMUX" && \ test -n "tmux display -p '#{client_termname}' | grep -o 256color" then