This image shows how pseudo-terminals work:
If I have two terminal emulators open, I can send the string "Hello"
from the first terminal emulator to the second terminal emulator:
echo "Hello" > /dev/pts/1
When this command is executed, the string "Hello"
will travel from the slave side of the second pseudo-terminal to the master side of the second pseudo-terminal and then gets displayed on the second terminal emulator.
Now is it possible to send data in the opposite direction, that is, to send data to the shell instead of the terminal emulator (or the process that the shell is running)?