From 277678381eaa9827843e961223c6b3d98c55542c Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 15 Sep 2010 14:07:00 +0100 Subject: [PATCH] tmux hacks. 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 | 2 +- .profile.d/resize.bashrc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.profile.d/prompt.bashrc b/.profile.d/prompt.bashrc index 2145c22..da94e97 100644 --- a/.profile.d/prompt.bashrc +++ b/.profile.d/prompt.bashrc @@ -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"' diff --git a/.profile.d/resize.bashrc b/.profile.d/resize.bashrc index e74dbc5..3f24b48 100644 --- a/.profile.d/resize.bashrc +++ b/.profile.d/resize.bashrc @@ -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 ;; -- 2.20.1