diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2012-07-13 15:33:03 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2012-07-13 15:33:42 +0200 |
commit | 6a257631a949785616c3fbc31675b09c785c6c68 (patch) | |
tree | d365a5144024fb057e9ce87354bde709e5474f0b /bashrc/common | |
parent | 002b08f9cef903503bf6f829f29d9675cdedca4f (diff) | |
download | dotfiles-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)
Diffstat (limited to 'bashrc/common')
-rw-r--r-- | bashrc/common/prompt.sh | 4 |
1 files changed, 2 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 } |