Re: [PATCH] editor: only save (and restore) the terminal if using a tty
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 29, 2021, 21:12 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2111292208180.63@tvgsbejvaqbjf.bet>
- In-Reply-To
- <xmqqwnkx1h5y.fsf@gitster.g>
Hi Junio,
On Wed, 24 Nov 2021, Junio C Hamano wrote:
Show 7 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > Maybe a better approach would be to hide the `save_term()` dance behind a > > new config option, and then have it turned on automatically if the > > `editor` _happens_ to be `vi` or `vim`. > > Why 'vi' and 'vim' are so special?
Git's default editor is `vi`. That's what makes it special.
> Is this an attempt to paper over a bug in 'vim' on the caller side?
While this works around a concrete bug reported at https://github.com/microsoft/terminal/issues/9359, the mere fact that this bug was possible indicates that Git needs to be able to deal with such bugs, whether the bug is in the editor, in a POSIX emulation layer, in the used shell or in the terminal. It is all the more important to have such a knob because there are so many potential sources for buggy behavior that users are unlikely to have the expertise to even identify which component is at fault.
Ciao, Dscho