and the terminal emulator is not itself sending the signals, its always just sending raw characters to the pty device - it is the kernel's pty layer sending a signal if the right flags are on and doing line buffering, local echo, etc. and signals go to the foreground process group (which is set by the shell making a tcsetpgrp syscall)