git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: git@vger.kernel.org
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Subject: [RFC PATCH 0/2] protect git from a rogue editor
Date: Sat,  2 Oct 2021 08:36:52 -0700	[thread overview]
Message-ID: <20211002153654.52443-1-carenas@gmail.com> (raw)

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

The rationale is better documented in multiple tickets for Windows
users that had found themselves with a difficult to read output after
doing a commit (either directly or while running a rebase), because
they were using Windows Terminal and vi (the default).

It is also useful in POSIX systems which before this series will have
to reset their terminals, if (for example) vi got killed while editing
a commit message.

Posted as an RFC, because I suspect it might need additional changes
to support Windows < 10 and because I wanted to add a patch that at
least renames the "hconin" variable and maybe fix some spurious errors,
or even add some logic to prevent the reset if the terminal wasn't
messed with.

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 | 72 ++++++++++++++++++++++++++++++++++++++---------
 compat/terminal.h |  3 ++
 editor.c          |  4 +++
 3 files changed, 66 insertions(+), 13 deletions(-)

-- 
2.33.0.955.gee03ddbf0e


             reply	other threads:[~2021-10-02 15:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02 15:36 Carlo Marcelo Arenas Belón [this message]
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 ` [PATCH 0/2] protect git from a rogue editor Carlo Marcelo Arenas Belón
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

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

  git send-email \
    --in-reply-to=20211002153654.52443-1-carenas@gmail.com \
    --to=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    /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).