From abb35d283f1abad10f8f260c880aff453a2570b0 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 23 Aug 2018 20:27:58 +0200 Subject: [PATCH] Fix escaping of escape codes. Without this, readline will compute the length of the prompt incorrectly, leading to display artifacts. --- data/etc/profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/etc/profile b/data/etc/profile index 0059a89dda..5e9aad0b69 100644 --- a/data/etc/profile +++ b/data/etc/profile @@ -13,8 +13,8 @@ else fi unset ARCH -PS1='`if [ $? = 0 ]; then echo "\e[32m"; - else echo "\e[31m\]"; fi`'"$PS1\e[0m\]> " +PS1="\["'`if [ $? = 0 ]; then echo "\e[32m"; + else echo "\e[31m"; fi`'"\]$PS1\[\e[0m\]> " export USER=`id -un` export GROUP=`id -gn`