summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2012-07-13 15:33:03 +0200
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2012-07-13 15:33:42 +0200
commit6a257631a949785616c3fbc31675b09c785c6c68 (patch)
treed365a5144024fb057e9ce87354bde709e5474f0b
parent002b08f9cef903503bf6f829f29d9675cdedca4f (diff)
downloaddotfiles-6a257631a949785616c3fbc31675b09c785c6c68.tar.gz
dotfiles-6a257631a949785616c3fbc31675b09c785c6c68.tar.xz
dotfiles-6a257631a949785616c3fbc31675b09c785c6c68.zip
bashrc/common/prompt: fix detection of tmux and screen
before even a normal terminal with TERM="screen" was detected as screen and f.e. caused problems with connectbot from android (set TERM="screen" but did not understand the screen escape sequences for setting the title)
-rw-r--r--bashrc/common/prompt.sh4
-rw-r--r--screenrc3
2 files changed, 5 insertions, 2 deletions
diff --git a/bashrc/common/prompt.sh b/bashrc/common/prompt.sh
index 0c14d84..00e95b6 100644
--- a/bashrc/common/prompt.sh
+++ b/bashrc/common/prompt.sh
@@ -27,7 +27,7 @@ __make_prompt() {
fi
# environment flags
- [[ "${TERM#screen}" != "${TERM}" ]] && PS1F="${PS1F}$(pcolor lcyan)s$(pcolor)"
+ [[ -n "${TMUX}" || -n "${SCREEN}" ]] && PS1F="${PS1F}$(pcolor lcyan)s$(pcolor)"
# python virtual env
[[ -n "${VIRTUAL_ENV}" ]] && PS1VE="$(pcolor lred)<${VIRTUAL_ENV#${WORKON_HOME}/}>$(pcolor) "
@@ -109,7 +109,7 @@ __make_prompt() {
export PS1="${PS1VE}${PS1UH}${PS1D} ${PS1BO}${PS1R}${PS1F}${PS1BC} ${s}${PS1P}"
- if [[ "${TERM#screen}" != "${TERM}" ]]; then
+ if [[ -n "${TMUX}" || -n "${TMUX}" ]]; then
echo -ne "\ek$(id -un)@${_hostname%%\.*}\e\\"
fi
}
diff --git a/screenrc b/screenrc
index 4e0a8a9..9761ca6 100644
--- a/screenrc
+++ b/screenrc
@@ -50,3 +50,6 @@ bind = resize =
bind + resize +3
bind - resize -3
bind _ resize max
+
+# register screen
+setenv SCREEN 1