When you send a control character from the terminal, for example if you pressed
Ctrl+C, the line discipline will receive the byte representing this control character (which is
0x03 in the case of
Now instead of the line discipline sending the byte
0x03 to the program associated with the terminal, it will instead send it the
SIGINT signal (or it will do some other action if it is a different control character).
Now is there a way to prevent the line discipline from handling control characters, so what I want is for the program associated with the terminal to receive the actual bytes representing the control characters (
0x03 in our case).
On linux, you’d use
$ stty intr undef
on the terminal concerned. That sets the interrupt character to nothing (“undef”). To restore you would use
$ stty intr ^c
man stty for details.