What you have written should work, assuming that the program writes its log to stdout rather than stderr and that /dev/pts/1
is the correct device for the other terminal. You can test this with something like:
echo Hello > /dev/pts/1
This should make Hello
appear in the other terminal window. If it doesn't, check which device the terminal is using with the tty
command.
If your program logs to stderr, you can redirect it too:
program >/dev/pts/1 2>&1 # send stderr to the same place as stdout