I don't know how much longer it will be before 3.1 will be available
with the fix for this.  I tracked down the problem in the current version.
This patch can fix it in the current bash 3.00.16.

-- 
Mike Stroyan, [EMAIL PROTECTED]
#! /bin/sh -e

if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

# fix display of history search prompt with non-printing chars in vi edit mode

--- bash/lib/readline/display.c.orig    2005-09-20 10:18:27.000000000 -0600
+++ bash/lib/readline/display.c 2005-09-20 10:20:24.000000000 -0600
@@ -1950,27 +1950,12 @@
 
   rl_save_prompt ();
 
-  if (saved_local_prompt == 0)
-    {
-      len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
-      pmt = (char *)xmalloc (len + 2);
-      if (len)
-       strcpy (pmt, rl_prompt);
-      pmt[len] = pchar;
-      pmt[len+1] = '\0';
-    }
-  else
-    {
-      len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
-      pmt = (char *)xmalloc (len + 2);
-      if (len)
-       strcpy (pmt, saved_local_prompt);
-      pmt[len] = pchar;
-      pmt[len+1] = '\0';
-      local_prompt = savestring (pmt);
-      prompt_last_invisible = saved_last_invisible;
-      prompt_visible_length = saved_visible_length + 1;
-    }
+  len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
+  pmt = (char *)xmalloc (len + 2);
+  if (len)
+    strcpy (pmt, rl_prompt);
+  pmt[len] = pchar;
+  pmt[len+1] = '\0';
 
   return pmt;
 }

Reply via email to