Chet Ramey <[email protected]> wrote:

>>>> (The "\\r\n" tells psql to clear its query buffer.) Unfortu-
>>>> nately, this doesn't work if readline is in "quote mode",
>>>> e. g. the preceding line contains an opening "'" or '"'. I
>>>> noticed though that pressing C-c does what I want: It can-
>>>> cels all active thingies and gives me a clean prompt.

>>>>   Unfortunately, I can't use "\C-c" to invoke it as the key
>>>> probably gets passed as SIGINT to readline. Is there another
>>>> way to "call" rl_free_line_state () from a binding defini-
>>>> tion?

>>> Why not bind a key sequence to "abort" and use it in the macro?

> I'm sorry, I didn't read this closely enough.  You're not going to be able
> to do this well without application support.  Readline doesn't have a
> notion of a "quote mode," for instance -- it works a line at a time.  An
> application can note that a line contains an unbalanced quote and
> accumulate subsequent lines into a complete command, but readline
> doesn't know about this.

> I suspect that psql works much like bash in this regard.  The disconnect
> between separate lines of input is why readline has a hard time honoring
> quoting that appears on a previous line while doing completion in bash.
> [...]

Okay, thanks for clearing that up. I guess I'll stay with my
"\C-a\C-k\\r\n" solution then as it works "well enough" and
patching psql would require a lot of effort for little gain.

Tim



_______________________________________________
Bug-readline mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to