git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git_getpass regression?
@ 2012-06-29 10:06 Erik Faye-Lund
  2012-06-29 17:39 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Erik Faye-Lund @ 2012-06-29 10:06 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Jeff King

Since 9b4b894 ("Makefile: linux has /dev/tty", 2011-12-10) we're
reading input from the terminal using strbuf_getline instead of
getpass. But at least on my linux-box, getpass treats the
backspace-key ('\b') as an actual deletion. strbuf_getline obviously
shouldn't do this, as it's a utility function. But I think as a
user-interface feature, it would be much more pleasant to be allowed
to edit the entered text ;)

I can't find anything in POSIX that standardize this behavior, but for
most text-input use-cases it's probably what the user intended.

I guess this is technically a regression, but probably not a very important one.

I think we have multiple possible solutions:
 1) Read a character at the time, and special-case '\r' to erase the
previously entered character.
 2) Post-process the strbuf to explicitly perform the erasing.
 3) Do nothing.

I'm in favor of 2) because I'm a Windows-user, and we never had the
erasing-behavior to begin with. And it's a nice feature, so we could
make the post-processing a function that can be reusable by the
Windows-version of git_terminal_prompt. We could even use it on the
plain getpass-fallback, to unify the user-experience across platforms.

We can probably also be do 1) in a reusable form by adding some kind
of on_char-callback, but it's probably something that'd end up more
confusing than than the alternative.

Thoughts?

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-07-18 14:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29 10:06 git_getpass regression? Erik Faye-Lund
2012-06-29 17:39 ` Jeff King
     [not found]   ` <CABPQNSZ4NhEA1CBiCBD_YNJZcnK8u=NtQ3PeDa5c0NDROPDyrQ@mail.gmail.com>
2012-06-29 20:30     ` Jeff King
2012-06-30 11:27       ` Erik Faye-Lund
2012-06-30 18:36         ` Jeff King
     [not found]           ` <CABPQNSYP6mUZb-1dCifytRxqP7_grzYzON2bjevK2zsGawb-yg@mail.gmail.com>
2012-07-03 16:28             ` Erik Faye-Lund
2012-07-03 17:11               ` Jeff King
2012-07-03 17:37                 ` Erik Faye-Lund
2012-07-18  5:53                   ` Junio C Hamano
2012-07-18 14:23                     ` Erik Faye-Lund

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).