Skip to content

RFC protect git from a rogue editor

Carlo Marcelo Arenas Belón git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2terminal: teach git how to save/restore its terminal settingscompat/terminal.c compat/terminal.h+62 -130 replies
1/2terminal: teach git how to save/restore its terminal settingscompat/terminal.c compat/terminal.h+64 -144 replies
2/2editor: save and reset terminal after calling EDITOReditor.c+4 -00 replies
2/2editor: save and reset terminal after calling EDITOReditor.c+8 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] protect git from a rogue editor

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(-)
Signature · 1 line
2.33.0.955.gee03ddbf0e