git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 2/3] editor: allow for saving/restoring terminal state

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 2, 2021, 06:35 UTC
Message-ID
<xmqqtufrwm38.fsf@gitster.g>
In-Reply-To
<20211202035446.1154-3-carenas@gmail.com>
Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:
Show 21 quoted lines
> From: Junio C Hamano <gitster@pobox.com>
>
> When EDITOR is invoked to modify a commit message (or do some
> other editing), and it is a terminal mode editor, it will need to
> change the terminal settings, and if it misbehaves could leave the
> terminal output damaged as shown in recent reports from Windows
> Terminal[1]
>
> Instead use the functions provided by compat/terminal to save the
> settings of the terminal and recover safely, but only do so if
> the editor is known to have issues and unless the user has told
> us through a boolean configuration "editor.stty" that it is safe
> not to do so.
>
> [1] https://github.com/microsoft/terminal/issues/9359
> ---
> The commit message was contributed by me, but the rest comes from:
> https://lore.kernel.org/git/xmqq7dcnyh5o.fsf@gitster.g/
> Signed-of-by is missing as I didn't know what would be preferred
> or if the Author will be ok with my grammar (ginger free grammar
> check seems to approve, otherwise)

It was merely an illustration patch, without 3/3 it would not be complete, and most importantly, finishing the last mile like 3/3 did is 80% of the work. I'd rather see you take the authorship of the commit that results from the squashing of 2 and 3.

Any patch I send here is by default signed off by me.
Thanks.
Previous: Carlo Marcelo Arenas BelónNext: Carlo Marcelo Arenas Belón
Message 4 of 5 in “editor: teach it to protect itself from rogue editors”
  1. 0/3 editor: teach it to protect itself from rogue editorsCarlo Marcelo Arenas Belón, Dec 2, 2021
  2. 1/3 terminal: teach save_term to fail when not foregroundCarlo Marcelo Arenas Belón, Dec 2, 2021
  3. 2/3 editor: allow for saving/restoring terminal stateCarlo Marcelo Arenas Belón, Dec 2, 2021
  4. Junio C HamanoDec 2, 2021
  5. 3/3 fixup! editor: allow for saving/restoring terminal stateCarlo Marcelo Arenas Belón, Dec 2, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.