Re: [PATCH] editor: only save (and restore) the terminal if using a tty

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

 



Carlo Arenas <carenas@xxxxxxxxx> writes:

> On Wed, Nov 24, 2021 at 11:34 AM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>>
>> Why 'vi' and 'vim' are so special?  Is this an attempt to paper over
>> a bug in 'vim' on the caller side?
>
> not sure if the bug is on vi/vim, cygwin's pty or the new conPTY that
> Windows Terminal uses; but in Git for Windows, using an MSYS vim (that
> uses cygwin's pty) within Windows Terminal (and other terminals that
> use conPTY most likely) leads to this terminal output corruption, that
> bash "fixes" when it gets the control back, but that git does not
> (unless something like what I am proposing is done), and that is
> specially disruptive when doing several commits in a series (ex: an
> interactive rebase).
>
> you could say it is an attempt to paper over that bug, but IMHO it is
> also a way for git to protect itself from a "rogue" editor, as it is
> now just trusting that the editor wouldn't mess with its terminal
> settings after being invoked and it returns control to git.

Surely, bash keeps using the same TTY and it may be in its interest
to "protect" it.  We on the other hand would exit when we are done
and no need for the TTY.  In other words, bash may "own" TTY and it
may want to take a good care of it.  We don't.

I would have to say that your argument is a bit of stretch ;-).



[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]

  Powered by Linux