From a9f9eaf51fc7f960a74485a84a061aea282d1d03 Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Mon, 20 Mar 2017 20:18:10 +0700 Subject: [PATCH] Fix issues with grep and spectrum --- lib/grep.sh | 2 +- lib/history.sh | 16 ++++++++-------- lib/misc.sh | 2 +- lib/spectrum.sh | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/grep.sh b/lib/grep.sh index 7adc567..282051e 100644 --- a/lib/grep.sh +++ b/lib/grep.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # is x grep argument available? -grep-flag-available() { +grep_flag_available() { echo | grep $1 "" >/dev/null 2>&1 } diff --git a/lib/history.sh b/lib/history.sh index e57f45f..f78102b 100644 --- a/lib/history.sh +++ b/lib/history.sh @@ -17,11 +17,11 @@ case $HIST_STAMPS in *) alias history='fc -l 1' ;; esac -#setopt append_history -#setopt extended_history -#setopt hist_expire_dups_first -#setopt hist_ignore_dups # ignore duplication command history list -#setopt hist_ignore_space -#setopt hist_verify -#setopt inc_append_history -#setopt share_history # share command history data +#shopt append_history +#shopt extended_history +#shopt hist_expire_dups_first +#shopt hist_ignore_dups # ignore duplication command history list +#shopt hist_ignore_space +#shopt hist_verify +#shopt inc_append_history +#shopt share_history # share command history data diff --git a/lib/misc.sh b/lib/misc.sh index fac94f1..735d2ac 100644 --- a/lib/misc.sh +++ b/lib/misc.sh @@ -23,4 +23,4 @@ if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then fi # recognize comments -#setopt interactivecomments +shopt interactivecomments diff --git a/lib/spectrum.sh b/lib/spectrum.sh index 8f44a38..bc4e79f 100644 --- a/lib/spectrum.sh +++ b/lib/spectrum.sh @@ -6,12 +6,12 @@ typeset -Ag FX FG BG FX=( - reset "%{^[[00m%}" - bold "%{^[[01m%}" no-bold "%{^[[22m%}" - italic "%{^[[03m%}" no-italic "%{^[[23m%}" - underline "%{^[[04m%}" no-underline "%{^[[24m%}" - blink "%{^[[05m%}" no-blink "%{^[[25m%}" - reverse "%{^[[07m%}" no-reverse "%{^[[27m%}" + [reset]="%{^[[00m%}" + [bold]="%{^[[01m%}" [no-bold]="%{^[[22m%}" + [italic]="%{^[[03m%}" [no-italic]="%{^[[23m%}" + [underline]="%{^[[04m%}" [no-underline]="%{^[[24m%}" + [blink]="%{^[[05m%}" [no-blink]="%{^[[25m%}" + [reverse]="%{^[[07m%}" [no-reverse]="%{^[[27m%}" ) for color in {000..255}; do