I have a terminal (xterm) open with bash running in it, showing a prompt. Suppose I know this running bash\'s pid and the tty associated with this terminal. Is there any w
Use a TIOCSTI ioctl. Example in C:
TIOCSTI
char* cmd="ls\n"; int fd = open (ptsname, O_RDWR); while (*cmd) { ioctl(fd, TIOCSTI, cmd++); }