From 4e40b8ea9d367019019e5b0cc39cdb6d65fe3d6e Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 11 Dec 2008 17:38:49 +0000 Subject: [PATCH] Use ESC-backslash sequence to close PROMPT_COMMAND so as not to cause a virtual console to beep. Use octal escape for backslash in ESC-backslash to avoid the shell eating it and messing up the following carriage return. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@166 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .profile.d/prompt.bashrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.profile.d/prompt.bashrc b/.profile.d/prompt.bashrc index 6ee910e..ad5b1e3 100644 --- a/.profile.d/prompt.bashrc +++ b/.profile.d/prompt.bashrc @@ -24,12 +24,12 @@ info="$HOSTNAME$SSH_FORWARDED" vimchild=" [vim]" if ps -o comm= -p $PPID 2>/dev/null | grep '^vim*$' &>/dev/null; then # Clear [vim] when exiting. - trap "echo -ne '\\033]0;$info\\007'" exit + trap "echo -ne '\\033]0;$info\\033\\0134'" exit info="$info$vimchild" fi if [ "${TERM##screen}" = "$TERM" ]; then - export PROMPT_COMMAND="echo -ne '\033]0;$info\007\r\033[K'" + export PROMPT_COMMAND="echo -ne '\033]0;$info\033\0134\r\033[K'" else - export PROMPT_COMMAND='echo -ne "\033k\033\\"' + export PROMPT_COMMAND='echo -ne "\033k\033\0134"' fi unset blank info vimchild SSH_FORWARDED -- 2.20.1