Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Interrupting globs (Re: Something rotten in tar completion)

On Sat, 6 Dec 2014 12:49:19 +0100
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> Another difference: the menu completion listing could previously be
> aborted with ctrl-c and keep the command line. It now closes the
> listing and aborts the command line.

Here's a suggestion: when we go back to the main keymap, assume that if
the user typed ^C in the mean time they want to continue editing from
this point.  I think that fixes this case.

(This is only on the interrupt_abort branch, again.)

> Additionally, with menu selection, you could previously ctrl-c out of
> selection and get to the menu, ctrl-c that again, and still have the
> command line. Now you just go straight from selection to a new empty
> command line.

This second case was already working for me (interrupt_abort branch with
Sven-comment-restoration, commit e385312e0937).  I tried both
MENU_COMPLETE and AUTO_COMPLETE behaviour.  There may be another way in.
Does the patch below help with this, too?

I'm intending to commit this and then stop patching to allow us to take
stock of what effects are now present on the interrupt_abort branch.  So
feel free to re-report any bad features.


diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 30d25eb..48f210c 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -504,6 +504,16 @@ mod_export void
 selectlocalmap(Keymap m)
     localkeymap = m;
+    if (!m)
+    {
+	/*
+	 * No local keymap; so we are returning to the global map.  If
+	 * the user ^Ced in the local map, they probably just want to go
+	 * back to normal editing.  So remove the interrupt error
+	 * status.
+	 */
+	errflag &= ~ERRFLAG_INT;
+    }
 /* Reopen the currently selected keymap, in case it got deleted.  This *

Messages sorted by: Reverse Date, Date, Thread, Author