Re: prompt with \[ \] corrupted by vi history search
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Mike Stroyan on 2/3/2006 12:16 PM: > Description: > The prompt is corrupted when using the vi Esc/ history search. > This happens when the prompt contains non-printing characters > marked by the \[ \] delimiters. > > Fix: > The best fix seems to be in _rl_make_prompt_for_search in > bash/lib/readline/display.c > > Everything behaves better if _rl_make_prompt_for_search just uses the > unexpanded rl_prompt string for composing its result. Here is a patch > that comments out the troublesome code. My only concern is whether this patch also affects {non-,}incremental searches in emacs mode. But it sure solves the display bugs of doing non-incremental searches in vi mode. Thanks for the patch. - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD6eq384KuGfSFAYARAkmQAKDPCFFZ3JPbP7++QXC5cdwPMLgzCwCcCki5 nW6wa5K/KEQ94R6YNrUs84s= =NPWW -END PGP SIGNATURE- ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
Re: prompt with \[ \] corrupted by vi history search
> My only concern is whether this patch also affects {non-,}incremental > searches in emacs mode. But it sure solves the display bugs of doing > non-incremental searches in vi mode. Thanks for the patch. I don't tend to use emacs mode. A few quick experiments definitely show the prompt problem does occur with the non-incremental-reverse-search-history (M-p) feature in emacs mode. The patch corrects that symptom as well. I don't see any problem with the incremental search. It doesn't seem to ever try to incorporate the standard prompt. -- Mike Stroyan, [EMAIL PROTECTED] ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
misc patches for rlfe example code
attached is a patch to address these issues with rlfe: - trying to build rlfe on uClibc fails because it lacks sys/stropts.h - pty.c uses close() but doesnt include - rlfe.c uses OpenPTY() but doesnt include "extern.h" - rlfe.c uses wait() but doesnt include - rlfe/configure sets up LIBS but Makefile.in ignores it (breaks on bsd due to -lutil not being linked in properly) -mike --- readline-5.1/examples/rlfe/Makefile.in +++ readline-5.1/examples/rlfe/Makefile.in @@ -25,7 +25,7 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ #LDFLAGS = -L$(READLINE_DIR) LDFLAGS = @LDFLAGS@ -LIBS = -lreadline -lhistory -lncurses +LIBS = -lreadline -lhistory @LIBS@ [EMAIL PROTECTED]@ CPP_DEPEND=$(CC) -MM --- readline-5.1/examples/rlfe/configure.in +++ readline-5.1/examples/rlfe/configure.in @@ -435,4 +435,6 @@ fi +AC_CHECK_HEADERS(sys/stropts.h sys/wait.h) + AC_OUTPUT(Makefile) --- readline-5.1/examples/rlfe/pty.c +++ readline-5.1/examples/rlfe/pty.c @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -34,7 +35,7 @@ #endif /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ -#ifdef HAVE_SVR4_PTYS +#if defined(HAVE_SYS_STROPTS_H) # include #endif --- readline-5.1/examples/rlfe/rlfe.c +++ readline-5.1/examples/rlfe/rlfe.c @@ -73,6 +73,11 @@ #include #include "config.h" +#include "extern.h" + +#ifdef HAVE_SYS_WAIT_H +# include +#endif #ifdef READLINE_LIBRARY # include "readline.h" ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash