Shell – Is it possible to send data to the the shell of another pseudo-terminal

linuxshellterminal

This image shows how pseudo-terminals work:

enter image description here

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)?

Best Answer

TIOCSTI works as said in a comment by thrig above: https://stackoverflow.com/a/29615101/2995591