4 ms·
I am in agreement - if you're not handling pipes or process groups correctly, then you don't have a Unix shell. That said, I don't really see why Ctrl-C has an
by DSMan195276 10y ago
I am in agreement - if you're not handling pipes or process groups correctly, then you don't have a Unix shell.
That said, I don't really see why Ctrl-C has anything to do with `longjmp` - and I say that having written a shell capable of doing the above. When talking about TTY functionality, the OS (or whatever handles the TTY layer) handles the Ctrl- keys. All the shell has to do in that instance is use `waitpid` (or similar) to wait for a process to die/suspend/etc. and then handle deciding what to (Such as changing the foreground process). When you press Ctrl-C while running a process, the shell never receives a SIGINT, only the current foreground process.