Create a Term & Run chars on this Term

hi floks !
i'd like to know how can i transmete a character or a string from my source code to a term and make it interpret or un by the shell wich is running in my term.
I'd like to create a Term from my code (and get its file descriptor) and then transmete each char typed on the keyboard to this Term.
The easier way to do it seemed to be redirection :
ex: echo "ls -al" > /dev/pts/mytty
but the command is not runned on the console
then i tried to write directly on the file :
ex: fp=fopen("/dev/pts/mytty","w"); fputs("ls -al\n",fp);
but the command is only written on the output of the term but not runned on the shell.

if someone has an idea, it'll be great :stuck_out_tongue: cause i'm getting mad :frowning:

People often leave their terminal world writable. If you could do this to your terminal, you could do it to theirs as well. That would be quite a security problem. I'm sure that your intentions are noble. But we don't discuss ways to violate system security here. So I will close this thread. Thank you for your understanding.