From 0d17063e826b137ea00d40c01eca2924e895b8fd Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Mon, 7 Feb 2022 13:45:11 +0800 Subject: [PATCH] macOS: use string array to be compatible with both bash and zsh By default, zsh does not split words in string by spaces. See https://zsh.sourceforge.io/FAQ/zshfaq03.html Change-Id: I167bae2af628be5b2fc9429a090628b6049f7ce4 Reviewed-by: Reviewed-by: Eike Ziller --- share/qtcreator/scripts/openTerminal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/scripts/openTerminal.py b/share/qtcreator/scripts/openTerminal.py index bae549ca9fa..a0347c08674 100755 --- a/share/qtcreator/scripts/openTerminal.py +++ b/share/qtcreator/scripts/openTerminal.py @@ -42,9 +42,9 @@ def clean_environment_script(): 'TERM_SESSION_ID']) return r''' function ignore() { - local keys="''' + env_to_keep + '''" + local keys=(''' + env_to_keep + ''') local v=$1 - for e in $keys; do [[ "$e" == "$v" ]] && return 0; done + for e in "${keys[@]}"; do [[ "$e" == "$v" ]] && return 0; done } while read -r line; do key=$(echo $line | /usr/bin/cut -d '=' -f 1)