aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-06-07 23:39:48 +1200
committerTom Ryder <tom@sanctum.geek.nz>2012-06-07 23:39:48 +1200
commit39763dece19184336b84ef6db41826baefe1e297 (patch)
treee2e5cb56cb00c66bd94bc9f6b4b0763c570ee78e /bash
parentUse colorcolumn limit in Markdown if available (diff)
downloaddotfiles-39763dece19184336b84ef6db41826baefe1e297.tar.gz
dotfiles-39763dece19184336b84ef6db41826baefe1e297.zip
Work around race condition bug in tmux
It looks like tmux doesn't wait for me to finish defining my default-terminal before it opens up my new shell. This means the first window of my new tmux sessions usually humbly thinks it only has eight colours. This seems to be a known bug in tmux, so for the moment I'm just working around it with an environment variable with which .bashrc will deal.
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 569b56be..1f48ffc1 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -119,6 +119,15 @@ case "$TERM" in
xterm*) PS1='\[\e]0;\h\a\]'${PS1};;
esac
+# If we're a screen terminal within a 256 color outer, force a 256 color
+# screen terminal too. This deals with a tmux race condition bug.
+case "$CONTAINING_TERM" in
+ *256color)
+ TERM=screen-256color
+ unset CONTAINING_TERM
+ ;;
+esac
+
# Alias ls and grep with the options we've collected.
alias ls="ls ${LS_OPTS}"
alias grep="grep ${GREP_OPTS}"