From 5ed0020f4ec39c5ff9994882cae9f04eb45e4ed7 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 1 Jan 2024 10:24:15 +0900 Subject: [PATCH] perf(vncviewer): set nocasematch inside subshell --- completions/vncviewer | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/completions/vncviewer b/completions/vncviewer index 8b9a039c3aa..cc5654e4606 100644 --- a/completions/vncviewer +++ b/completions/vncviewer @@ -83,13 +83,14 @@ _comp_cmd_xvnc4viewer() WMDecorationWidth ZlibLevel) [[ $cur == --* ]] && dash=-- || dash=- - local IFS=$' \t\n' reset=$(shopt -p nocasematch) - shopt -s nocasematch - local option - COMPREPLY=($(for option in "${options[@]}"; do - [[ $dash$option == "$cur"* ]] && printf '%s\n' "$dash$option" - done)) - $reset + local IFS=$' \t\n' + COMPREPLY=($( + shopt -s nocasematch + local option + for option in "${options[@]}"; do + [[ $dash$option == "$cur"* ]] && printf '%s\n' "$dash$option" + done + )) else _comp_compgen_known_hosts -- "$cur" fi