From 40564c458df1d5d379874bdb987bd3c7448151aa Mon Sep 17 00:00:00 2001 From: Anselm Kruis Date: Mon, 2 Sep 2013 13:24:54 +0200 Subject: [PATCH] Avoid beeping when setting the console title if non-ascii chars in $PWD. Fix for issue #128 where the prompt causes the console to beep if there are non-ASCII characters in the path. This patch replaces all non-ASCII characters with a question mark when expanding the prompt Signed-off-by: Anselm Kruis Signed-off-by: Pat Thoyts --- etc/profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/profile b/etc/profile index 6c68d7d6..6e80b0aa 100644 --- a/etc/profile +++ b/etc/profile @@ -153,7 +153,7 @@ esac [ -r /git/contrib/completion/git-prompt.sh ] && . /git/contrib/completion/git-prompt.sh # non-printable characters must be enclosed inside \[ and \] -PS1='\[\033]0;$MSYSTEM:\w\007\]' # set window title +PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title PS1="$PS1"'\n' # new line PS1="$PS1"'\[\033[32m\]' # change color PS1="$PS1"'\u@\h ' # user@host -- 2.11.4.GIT