Re: [Illustration PATCH] add -i: accept single-keypress input
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 3, 2009, 09:05 UTC
- Message-ID
- <7vbptjdh5e.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1233651248-26717-1-git-send-email-trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 6 quoted lines
> Demonstrate how to add Term::ReadKey functionality to the main add -i > prompt function list_and_choose(). > > Not really great because if several input choices share a common first > character, it prompts for the _rest_ of the line, meaning the choice > of the first character cannot be undone again.
Hmm, you could trigger the action immediately after seeing _enough_ number of characters to disambiguate instead of stop-and-prompt, I guess? That way, you would get a single-key merely as a degenerate case when the choices are all distinct.