From: Erik Faye-Lund <kusmabite@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Jeff King <peff@peff.net>
Subject: git_getpass regression?
Date: Fri, 29 Jun 2012 12:06:31 +0200 [thread overview]
Message-ID: <CABPQNSa4uvgijjGCSJDXDMqHC3UkqQKKujG3xDFqnQ13LNrKdQ@mail.gmail.com> (raw)
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?
next reply other threads:[~2012-06-29 10:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-29 10:06 Erik Faye-Lund [this message]
2012-06-29 17:39 ` git_getpass regression? 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
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=CABPQNSa4uvgijjGCSJDXDMqHC3UkqQKKujG3xDFqnQ13LNrKdQ@mail.gmail.com \
--to=kusmabite@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.
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).