From: Junio C Hamano Date: Tue, 03 Feb 2009 09:05:49 GMT Subject: Re: [Illustration PATCH] add -i: accept single-keypress input Message-ID: <7vbptjdh5e.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1233651248-26717-1-git-send-email-trast@student.ethz.ch> Thomas Rast writes: > 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.