I have an xterm window with a custom title. The xterm was fired up the following way: xterm -T customTitle
.
I would like to enter a command (for example ls -l) into this xterm window from a python/bash script running on another xterm or gnome terminal, and press Return (Enter) so the command executes.
Is this possible? Is there a way of finding an active xterm by window title or pid and executing a command from another terminal?
If this cant be done programmatically, is there some python libraries out there that would let me find my window by the given title, and simulate my keyboard as if someone was entering the text?
Thanks!
You can try this , run a command and redirect output to the xterm terminal-
/dep/pts/5
is the file descriptor obtained from 'tty' command on your xterm !Hope this helps !