zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: accept-and-hold in interactive mode of menu select
Date: Tue, 16 Dec 2014 08:45:37 -0800	[thread overview]
Message-ID: <141216084537.ZM18852@torch.brasslantern.com> (raw)
In-Reply-To: <6B615901-83A3-41A0-9017-3EFA7EF5CA42@kba.biglobe.ne.jp>

On Dec 16, 11:18pm, Jun T. wrote:
}
} >>> type ab
} 
} % ls test/ab
} interactive: test/abb[]
} abbb*  abbc
} 
} >>> hit ^L
} 
} % ls test/ab test/abbc
} abbb  abbc*
} 
} Note that the 1st word on the command line is not updated to test/abbb.

I'm not entirely sure that's wrong; accept means to accept what is on the
command line, not to accept what is highlighted in the menu.  You have to
finish the action of choosing one of the menu items so that the command
line is updated, before you accept.

On the other hand I can see where there might be confusion about that,
and this is a little-used and therefore little-tested corner of complist,
so implicitly choosing the currently highlighted item (even though in
this situation it will always be whichever one came first in sort order)
may be a reasonable thing to do.

} >>> type ab
} 
} % ls test/{ab
} interactive: test/{abb[]
} abbb* abbc
} 
} >>> hit ^L
} 
} then zsh goes into an infinite loop; ^C does not work.

I'm not able to reproduce this with a completion that does not use a
brace expansion, so I wonder if there's something about that which is
involved.  Brace expansion has always been a bit of a problem child,
and in a brace expansion you're accepting a partial completion rather
than an entire command-line "word", so we try to re-enter selection
in a different state.

} I tried the patch below, and it does avoid the infinite loop. But it
} is far from sufficient; for example, the ^L above now gives (as I
} expect)
} 
} % ls test/{abbb,abbc
} 
} but if I hit ^K to go to the interactive mode again, then I get
} 
} % ls test/{ab

Entering interactive mode always returns to the original state of the
command line before menu-selection was started.   I don't remember why
this is the case, or if it was intentional.

-- 
Barton E. Schaefer


  reply	other threads:[~2014-12-16 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 14:18 Jun T.
2014-12-16 16:45 ` Bart Schaefer [this message]
2014-12-16 19:11   ` Oliver Kiddle
2014-12-17  3:07     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=141216084537.ZM18852@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).