tmux hacks.
authorIain Patterson <me@iain.cx>
Wed, 15 Sep 2010 13:07:00 +0000 (14:07 +0100)
committerIain Patterson <me@iain.cx>
Fri, 1 Oct 2010 10:47:10 +0000 (11:47 +0100)
tmux won't allow window resizing.  It also requires a TERM setting of
screen or screen-256color.  Assume that screen or screen-256color means
tmux and screen-bce or screen-256color-bce means real screen.

.profile.d/prompt.bashrc
.profile.d/resize.bashrc

index 2145c22..da94e97 100644 (file)
@@ -30,7 +30,7 @@ if ps -o comm= -p $PPID 2>/dev/null | grep '^vim*$' &>/dev/null; then
   trap "echo -ne '\\033]0;$info\\033\\0134'" exit
   info="$info$vimchild"
 fi
-if [ "${TERM##screen}" = "$TERM" ]; then
+if [ "${TERM##screen}" = "$TERM" -o "${TERM%%-bce}" = "$TERM" ]; then
   PROMPT_COMMAND="echo -ne '\033]0;$info\033\0134\r\033[K'"
 else
   PROMPT_COMMAND='echo -ne "\033k\033\0134"'
index e74dbc5..3f24b48 100644 (file)
@@ -1,7 +1,9 @@
 # Can we resize this window?
 case "$TERM" in
   # Terminals we KNOW can't be resized.
-  cygwin|linux|sun-color)
+  # screen and screen-256color are included to support tmux.  Real screen
+  # will set TERM to screen-256color-bce and we drop through.
+  cygwin|linux|screen|screen-256color|sun-color)
     export RESIZABLE=0
   ;;