Added function fancyTerm that checks if we are on a "fancy" terminal

Changed prompt management to take in account "screen"
This commit is contained in:
Andrea Mistrali 2014-03-03 11:26:12 +00:00
parent 1dae364411
commit b45d13450a
6 changed files with 11 additions and 6 deletions

View File

@ -15,5 +15,9 @@ autoload -U dust
# bak - remove backup files # bak - remove backup files
autoload -U bak autoload -U bak
#
# fancyTerm - returns true if we are on xterm/rxvt/screen, elsewhere false
autoload -U fancyTerm
# vim: set ts=4 sw=4 tw=0 ft=zsh : # vim: set ts=4 sw=4 tw=0 ft=zsh :

View File

@ -1,6 +1,6 @@
function prompt_minimal_setup { function prompt_minimal_setup {
# Setup PROMPT # Setup PROMPT
if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then if `fancyTerm`; then
# We are on xterminal # We are on xterminal
W="%n@%m:%." W="%n@%m:%."
I="%m:%." I="%m:%."

View File

@ -1,6 +1,5 @@
function prompt_nice_setup { function prompt_nice_setup {
if `fancyTerm`; then
if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then
W="::: %n at %m in %. :::" W="::: %n at %m in %. :::"
I="%m::%." I="%m::%."
L="%B%K{blue}%F{white}@%m::%2~ %f%k L="%B%K{blue}%F{white}@%m::%2~ %f%k

View File

@ -1,6 +1,6 @@
function prompt_plain_setup { function prompt_plain_setup {
# Setup PROMPT # Setup PROMPT
if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then if `fancyTerm`; then
# We are on xterminal # We are on xterminal
W="%n@%m:%." W="%n@%m:%."
I="%m:%." I="%m:%."

View File

@ -1,6 +1,6 @@
function prompt_server_setup { function prompt_server_setup {
# Setup PROMPT # Setup PROMPT
if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then if `fancyTerm`; then
# We are on xterminal # We are on xterminal
W="%n@%m:%." W="%n@%m:%."
I="%m:%." I="%m:%."

View File

@ -27,7 +27,9 @@ function loadRC {
fi fi
# Add local customization file, svn ignored # Add local customization file, svn ignored
if [ $EUID -eq 0 ]; then
[ -f $1/99-local.zsh ] || echo "# Local customizations" > $1/99-local.zsh [ -f $1/99-local.zsh ] || echo "# Local customizations" > $1/99-local.zsh
fi
# Process all .zsh files # Process all .zsh files
for zshFile in $1/[0-9]*.zsh; do for zshFile in $1/[0-9]*.zsh; do