Skip to content

Instantly share code, notes, and snippets.

@ziyuang
Last active December 17, 2015 17:49
Show Gist options
  • Save ziyuang/5648301 to your computer and use it in GitHub Desktop.
Save ziyuang/5648301 to your computer and use it in GitHub Desktop.
  • .bashrc: append to the local .bashrc
  • .bashrc-remote: append to the remote .bashrc
  • .screenrc: local .screenrc
case "$TERM" in
screen*)
SCREENTITLE='\[\ek\e\\\]\[\ek\W\e\\\]'
PS1="${SCREENTITLE}${PS1}"
;;
esac
PROMPT_COMMAND='
if [ $TERM = "screen" ]; then
MYPWD="${PWD/#$HOME/~}"
[ ${#MYPWD} -gt 20 ] && MYPWD=..${MYPWD:${#MYPWD}-18}
echo -n -e "\033k$HOSTNAME@$MYPWD\033\\"
fi
'
altscreen on
caption always '%{=d 0f}%-w%{=rb 0f}%>%n %t%{-}%+w%{-b}%< %{= kG}%-=%D %c%{-}'
shelltitle '$ |bash'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment