git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: git@vger.kernel.org
Cc: johannes.schindelin@gmx.de,
	"Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Subject: [PATCH 0/2] protect git from a rogue editor
Date: Mon,  4 Oct 2021 00:25:58 -0700	[thread overview]
Message-ID: <20211004072600.74241-1-carenas@gmail.com> (raw)
In-Reply-To: <20211002153654.52443-1-carenas@gmail.com>

The following series, expands git's terminal support to allow for
saving/restoring its settings around an EDITOR call.

The reason why that might be useful has been documented[1] by Windows
users that had found themselves not able to read clearly the messages
printed by git after a commit (or a rebase) when the default EDITOR
failed to reset the terminal settings completely.

It can be useful also in POSIX systems and indeed could be tested there
by forcefully killing vi while doing a commit, and that before this series
will require the user to reset their terminal.

The code has been improved since the RFC and simplified, and has been
tested in Windows 7 x86, and Windows 10 and 11 (x86_64).

[1] https://github.com/microsoft/terminal/issues/10152#issuecomment-932808573

Carlo Marcelo Arenas Belón (2):
  terminal: teach git how to save/restore its terminal settings
  editor: save and reset terminal after calling EDITOR

 compat/terminal.c | 75 ++++++++++++++++++++++++++++++++++++++---------
 compat/terminal.h |  3 ++
 editor.c          |  8 +++++
 3 files changed, 72 insertions(+), 14 deletions(-)

-- 
2.33.0.955.gee03ddbf0e


  parent reply	other threads:[~2021-10-04  7:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02 15:36 [RFC PATCH 0/2] protect git from a rogue editor Carlo Marcelo Arenas Belón
2021-10-02 15:36 ` [RFC PATCH 1/2] terminal: teach git how to save/restore its terminal settings Carlo Marcelo Arenas Belón
2021-10-02 15:36 ` [RFC PATCH 2/2] editor: save and reset terminal after calling EDITOR Carlo Marcelo Arenas Belón
2021-10-04  7:25 ` Carlo Marcelo Arenas Belón [this message]
2021-10-04  7:25   ` [PATCH 1/2] terminal: teach git how to save/restore its terminal settings Carlo Marcelo Arenas Belón
2021-10-04 16:36     ` Junio C Hamano
2021-10-04 17:27       ` Carlo Arenas
2021-10-04 18:10         ` Junio C Hamano
2021-10-04 18:33           ` Carlo Arenas
2021-10-04  7:26   ` [PATCH 2/2] editor: save and reset terminal after calling EDITOR Carlo Marcelo Arenas Belón
2021-10-04 16:38   ` [PATCH 0/2] protect git from a rogue editor Junio C Hamano
2021-10-05  7:46   ` [PATCH v2 " Carlo Marcelo Arenas Belón
2021-10-05  7:46     ` [PATCH v2 1/2] terminal: teach git how to save/restore its terminal settings Carlo Marcelo Arenas Belón
2021-10-05  7:46     ` [PATCH v2 2/2] editor: save and reset terminal after calling EDITOR Carlo Marcelo Arenas Belón

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211004072600.74241-1-carenas@gmail.com \
    --to=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).