And the answer was "do this insane set of ioctls". Followed by "oh and make damn sure your program can NEVER EVER crash, because you must undo this before exit or other programs will be screwed up.
This was obviously insanely wrong then, and it still is now.
With shells using readline-style libraries now, there are NO programs left that use the TTY in anything other than uncooked mode (programs like cat that are mostly used as destinations of pipes do not count!). It does seem like it is time to scrap this. This would also allow "pty" to be scrapped as well, because you could use plain old pipes for this.
There should be a trivial uncooked raw io interface that you open as "/dev/newtty" or whatever. The drivers should be about 10 lines long I think.
The old tty/pty interface should be a CUSE api of some sort that emulates it atop the new interface. And that can be vastly reduced. For instance we can scrap the entire key assignment thing, as nobody ever alters it, and finally (after almost 4 decades!) get both Backspace and Delete to work at the same time!
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds