From a30b79ca4e99816493472d06df2846a0c91b0348 Mon Sep 17 00:00:00 2001 From: PHO Date: Wed, 23 May 2012 16:27:04 +0900 Subject: [PATCH] Auto commit by The Sugar System. --- dot-files/_screenrc | 4 +--- dot-files/_zshrc | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dot-files/_screenrc b/dot-files/_screenrc index 78c9d7d..c841dbd 100644 --- a/dot-files/_screenrc +++ b/dot-files/_screenrc @@ -1,10 +1,8 @@ escape ^Z^Z -vbell off +vbell on defscrollback 50000 defutf8 on defflow off -#shelltitle '% |zsh' - hardstatus alwayslastline "[%02c]:%H: %`%-w%{=b rw}%n %t%{-}%+w" diff --git a/dot-files/_zshrc b/dot-files/_zshrc index 145fabb..f115c4c 100644 --- a/dot-files/_zshrc +++ b/dot-files/_zshrc @@ -53,7 +53,11 @@ setopt inc_append_history setopt share_history function _we_are_in_gnu_screen () { - [[ "$WINDOW" != "" ]] + [[ -n "$WINDOW" ]] +} + +function _we_are_in_ssh_session () { + [[ -n "$SSH_CONNECTION" ]] } _prompt_base='%B[%n@%m] %{%(?.$fg[green].$fg[red])%}%#%{$reset_color%}%b ' @@ -191,16 +195,24 @@ autoload -U compinit compinit # End of lines added by compinstall -if [ "x$WINDOW" = "x" ]; then +if ( _we_are_in_gnu_screen ); then + # When we are in a GNU Screen session... + + if ( _we_are_in_ssh_session ); then + # Propagate remote session's bells to the local one. + screen -X vbell off + fi +else + if [ -e ".motd" ]; then + cat ".motd" + fi + + # Run "fortune" if we aren't in a GNU Screen session. if which fortune 2>&1 >/dev/null; then fortune fi fi -if [ -e ".motd" ]; then - cat .motd -fi - if which ssh-agent-manager 2>&1 >/dev/null; then eval `ssh-agent-manager -s` fi -- 2.40.0