Re: git_getpass regression?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 29, 2012 at 12:06:31PM +0200, Erik Faye-Lund wrote:

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

Backspace shouldn't be making it to git at all; it should be handled at
the terminal input layer, because we are not putting the terminal into
raw mode. It works just fine for me here, both on the linux console and
in an xterm. What terminal are you using? Are you ssh-ing to a remote
linux box? If that is the case, I wonder if your 'stty erase' settings
do not match what your terminal emulator is sending.

If you run "stty erase ^H" and then run git, does it work?

> 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 assume you meant '\b' in (1).  I think (3) is the only sane thing,
though. Even if we handled \b, that is not what all terminals generate.
In particular, most linux terminal emulators these days will generate
DEL (aka ^? or 0x7f) on backspace. This problem needs to be solved at
the terminal layer, and I suspect is just a configuration issue in your
setup.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]