With bits like schedulers and device drivers in an interrupt-based system a lot of ideas we'd like to about runtime state as modeled by your language of choice (the stack, lexical scope, memory, thread context, reference counts) become exposed and the implementation details have to be known, or you have to be comfortable tuning/self-restricting use of features around such a tricky, dragons-be-here scenario.
This isn't a problem specific to TTYs, but indeed they are their own special little hell no matter how you choose to tackle them.
This isn't a problem specific to TTYs, but indeed they are their own special little hell no matter how you choose to tackle them.