79081330

Date: 2024-10-12 15:43:15
Score: 1
Natty:
Report link

The communication between the terminal and your program (running on the host) is bidirectional. Bytes are sent from the terminal to the host (in response to your read() call) and strings are sent from the host to the terminal (by printf()).

As @Barmar said, your terminal isn't sending the ^V character to the host, and your program never receives it.

Just for clarification: the terminal driver is OS code that runs on your host (in this case, inside the Linux VM), and by disabling some control characters you're just telling the driver (not the terminal itself) that it must not do any special processing of these characters before (or instead of) sending them to your process (ie. to your code).

By the way, something is missing in your example (the orig_termios variable?).

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @Barmar
  • Low reputation (0.5):
Posted by: Diego Ferruchelli