I am using fork() and execvp() to spawn a process that must believe it is connected to an interactive terminal for it to function properly.
Once spawned, I want to
There's a package called "expect" which you should use. It uses a scripting language called tcl (pronounced tickle).
https://core.tcl-lang.org/expect/