Thread (9 messages) 9 messages, 4 authors, 2023-09-14

Re: [PATCH] rebase -i: ignore signals when forking subprocesses

flat view

From: Jeff King <hidden>
Date: 2023-09-14 09:56:05

On Fri, Sep 08, 2023 at 10:59:06AM +0100, Phillip Wood wrote:
Do we want a whole new session? As I understand it to launch a foreground
job shells put the child in its own process group and then call tcsetpgrp()
to change the foreground process group of the controlling terminal to that
of the child. I agree that would be a better way of doing things on unix.
One thing I am not clear on is the convention on who does the process
group and controlling terminal setup. Should Git do it to say "I am
handing off control of the terminal to the editor that I am spawning"?
Or should the editor say "I am an editor which has a user interface that
takes over the terminal; I will control it while I am running".

The latter makes much more sense to me, as Git cannot know how the
editor plans to behave. But as I understand it, this kind of job control
stuff is implemented by the calling shell, which does the tcsetpgrp()
call.

So I dunno. It sounds to me like the "right" thing here is making Git
more shell-like in handing control to a program (like the editor) that
we expect to be in the foreground of the terminal. As opposed to the
"ignore SIGINT temporarily" thing which feels more like band-aid. But
I'm wary of getting into a rabbit hole of portability headaches and
weird corners of Unix terminal-handling conventions.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help