got a lot of great answers to "how is the shell involved in handling Ctrl+C" to the effect of one of:
- "the shell is responsible for sending a SIGINT"
- "the shell takes input from the terminal emulator and relays it to the program"
- "it must be handled by the layer above the program, which is the shell"
and while none of those is true, they feel like they totally _could_ be true in a different world. It feels hard to explain why it might be useful to have a more "accurate" mental model
it feels like there's this mental model a lot of people have for the terminal which is a little like this (with some more stuff about signals etc)
and it's not "true" that the shell is in between the terminal emulator and programs in this way but it feels more compelling to me in some ways than the reality.
it makes explaining how the terminal works a little weird — I don't want to teach a “wrong” mental model just because it feels simpler (that seems silly), but also the "correct” mental model feels kind of overly complicated and not worth explaining because there's not obviously a lot of real-world value to learning it
not really looking for advice, just thinking out loud
(3/?)
@b0rk This is reminding me that one of my college computer science courses included an assignment to implement features of a basic shell, but that's been a really long time now
@mulad something I've been learning from these replies is that the “implement a shell" project actually in a way causes more confusion because you can implement a shell in a lot of different ways and not all of those are actually the same as how the shells we use work
(which is fine, like it's cool to do things in different ways, but for me implementing a toy shell definitely gave me some slightly wrong ideas about how shells work)