From 782fad08fd37cbf2144ea203430f37608b156ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Wed, 22 Jan 2014 22:56:48 +0100 Subject: [PATCH] Save IFS at startup to restore it in _lp_set_prompt We already restore IFS to its default value. This patch only changes the way it is done to avoid a call to 'echo' in a sub-shell at runtime. Fixes #267. --- liquidprompt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/liquidprompt b/liquidprompt index 13d010b..4052014 100755 --- a/liquidprompt +++ b/liquidprompt @@ -87,6 +87,10 @@ else return fi +# Save $IFS as we want to restore the default value at the beginning of the +# prompt function +_LP_IFS="$IFS" + ############### # OS specific # @@ -1547,8 +1551,7 @@ _lp_set_prompt() # Reset IFS to its default value to avoid strange behaviors # (in case the user is playing with the value at the prompt) - local IFS="$(echo -e ' \t') -" # space, tab, LF + local IFS="$_LP_IFS" # execute the old prompt eval "$LP_OLD_PROMPT_COMMAND"