I have a similar program called pty. I wrote it to work around a bug in xterm, which thinks it knows the best way to initialize a pty, but is wrong, and has many options for tweaking its pty handling, which are also wrong. In order to work out WTF it was doing, I even re-wrote unifdef so I could see what code xterm ran on FreeBSD - this was not immediately obvious because xterm's pty handling code has about the highest ifdef density I've seen.
It turns out that the easiest way to discourage xterm from screwing up the pty settings is to ensure it has a /dev/tty whose settings it can copy. Unfortunately X sessions usually don't have a /dev/tty. So I wrote my pty program so I could run it in my .xsession script as a wrapper around fvwm, so that my window manager and all the programs it spawns (especially xterm) have a /dev/tty to use as a template when creating ptys.
It turns out that the easiest way to discourage xterm from screwing up the pty settings is to ensure it has a /dev/tty whose settings it can copy. Unfortunately X sessions usually don't have a /dev/tty. So I wrote my pty program so I could run it in my .xsession script as a wrapper around fvwm, so that my window manager and all the programs it spawns (especially xterm) have a /dev/tty to use as a template when creating ptys.
IWJ and I have just found out between us that so did DJB in the early 1990s...