I have created a command-line application in Linux that reads data from stdin (the stdin can be the terminal).

When I type Ctrl+C on the terminal, the terminal will send the byte 0x03 to the line discipline. Now instead of the line discipline sending the byte 0x03 to my application, it will instead handle 0x03 as a control character and send the SIGINT signal to my application.

Is there a way to make sure that the byte 0x03 is sent to my application when I press Ctrl+C (without having to change the line discipline settings like mentioned in this question).


Pressing CtrlV (or whatever lnext is set to on the line discipline) will force the next keypress to be input literally.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.