From 4c7bd86a5eb388e9992c83189485e5b9a93a1a8b Mon Sep 17 00:00:00 2001 From: saul365 Date: Thu, 8 Oct 2020 08:05:27 +0000 Subject: [PATCH] lib/shopt: Add support for CASE_SENSITIVE Co-authored-by: Koichi Murase --- lib/shopt.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/shopt.sh b/lib/shopt.sh index f821628..9ad9b16 100644 --- a/lib/shopt.sh +++ b/lib/shopt.sh @@ -27,7 +27,14 @@ shopt -s nocaseglob; ## SMARTER TAB-COMPLETION (Readline bindings) ## # Perform file completion in a case insensitive fashion -bind "set completion-ignore-case on" +if [[ ${CASE_SENSITIVE-} == false ]]; then + bind "set completion-ignore-case on" +elif [[ ${CASE_SENSITIVE-} == true ]]; then + bind "set completion-ignore-case off" +else + # By default, case sensitivity is disabled. + bind "set completion-ignore-case on" +fi # Treat hyphens and underscores as equivalent bind "set completion-map-case on"