There is a command line tool called xdotool that allows you to mimic key-presses, commands, etc. using the process ID, process type, class, or name.
I was able to differentiate the different terminal instances by PID, and even rename them. So instead of having your current user and directory at the top of the window, it would have the unique name you set (e.g A, B, and C). And xdotool uses this as an identifier. Can be easier than remembering the ~10 digit PID.
So in terminal A, you can tell xdotool to mimic the key-presses for a certain command, and have them execute in terminal C. You should be able to put these commands in scripts, as well.
Here is the project site
Tested out some scripts, works pretty well. I was able to have A tell B to run a local server. In the same script, I used xdotool’s delay function so that B tells C to run a script to end the server process in B. So it seems like you can get pretty complex with it.
The only annoyance is that the standard terminal doesn’t receive the commands or key presses unless it’s the active window. Just one extra command works around this fine, but not ideal. Xterm has a setting that will let it receive commands when not the active window.
-c
or--exec
flag, but otherwise they run shell which takes input from keyboard, not anywhere else. You can simulate sending keypresses to a specific window, or you can run a "server" command that listens to commands, but otherwise - you can't just tell terminal A to do something from terminal B simply because that's how they're designed