Fix for dumb terminals like Vim's.

This commit is contained in:
Sorin Ionescu 2011-02-27 10:13:57 -05:00
parent 3a444ea70a
commit deab2ed376
8 changed files with 20 additions and 15 deletions

View file

@ -1,4 +1,5 @@
# fixme - the load process here seems a bit bizarre # fixme - the load process here seems a bit bizarre
[[ "$TERM" == "dumb" ]] && return
unsetopt menu_complete # do not autoselect the first completion entry unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol unsetopt flowcontrol

View file

@ -1,6 +1,4 @@
# if [[ "$DISABLE_COLOR" != "true" ]]; then
# Color grep results [[ -z "$GREP_OPTIONS" ]] && export GREP_OPTIONS='--color=auto'
# Examples: http://rubyurl.com/ZXv [[ -z "$GREP_COLOR" ]] && export GREP_COLOR='1;32'
# fi
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;32'

View file

@ -9,5 +9,5 @@ bindkey "^[m" copy-prev-shell-word
setopt long_list_jobs setopt long_list_jobs
## pager ## pager
export PAGER=less [[ -z "$PAGER" ]] && export PAGER=less
export LC_CTYPE=en_US.UTF-8 [[ -z "$LC_CTYPE" ]] && export LC_CTYPE=en_US.UTF-8

View file

@ -1,3 +1,5 @@
[[ "$TERM" == "dumb" ]] && return
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title #usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1 #http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
#Fully support screen, iterm, and probably most modern xterm and rxvt #Fully support screen, iterm, and probably most modern xterm and rxvt

View file

@ -1,10 +1,9 @@
# ls colors # ls colors
autoload colors; colors; autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad" [[ -z "$LSCOLORS" ]] && export LSCOLORS="Gxfxcxdxbxegedabagacad"
#export LS_COLORS
# Enable ls colors # Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ] if [ "$DISABLE_COLOR" != "true" ]
then then
# Find the option for using colors in ls, depending on the version: Linux or BSD # Find the option for using colors in ls, depending on the version: Linux or BSD
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G' ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'

View file

@ -6,6 +6,11 @@ fi
# Initializes Oh My Zsh # Initializes Oh My Zsh
# Disable colors on dumb terminals
if [ "$TERM" = "dumb" ]; then
DISABLE_COLOR="true"
fi
# add a function path # add a function path
fpath=($ZSH/functions $ZSH/completions $fpath) fpath=($ZSH/functions $ZSH/completions $fpath)

View file

@ -14,7 +14,7 @@ export ZSH_THEME="robbyrussell"
# export DISABLE_AUTO_UPDATE="true" # export DISABLE_AUTO_UPDATE="true"
# Uncomment following line if you want to disable colors in ls # Uncomment following line if you want to disable colors in ls
# export DISABLE_LS_COLORS="true" # export DISABLE_COLOR="true"
# Uncomment following line if you want to disable autosetting terminal title. # Uncomment following line if you want to disable autosetting terminal title.
# export DISABLE_AUTO_TITLE="true" # export DISABLE_AUTO_TITLE="true"

View file

@ -2,12 +2,12 @@
# FILE: sorin.zsh-theme # FILE: sorin.zsh-theme
# DESCRIPTION: oh-my-zsh theme file. # DESCRIPTION: oh-my-zsh theme file.
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
# VERSION: 1.0.2 # VERSION: 1.0.3
# SCREENSHOT: http://i.imgur.com/aipDQ.png # SCREENSHOT: http://i.imgur.com/aipDQ.png
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then if [[ "$DISABLE_COLOR" != "true" ]]; then
MODE_INDICATOR="%{$fg_bold[red]%}%{$reset_color%}%{$fg[red]%}%{$reset_color%}" MODE_INDICATOR="%{$fg_bold[red]%}%{$reset_color%}%{$fg[red]%}%{$reset_color%}"
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"