I am experimenting with wrapping console applications into a synthetic environment like I though multiplexers do. But I've noticed that apps like mc
(midnight commander) written with the use of S-Lang library are able to get partial keyboard state even if their stdin
is not attached to TTY.
For example, cat /dev/zero|/usr/bin/mc
doesn't affect the operability of the app at all.
I tried to understand how does mc works in tmux but I cannot find the place where does the magic happen in the code of these three components (mc, tmux and slang).
The question is how can I programmatically start an app like mc
so that I would be able to interact with it via file descriptor while the actual stdin won't be available to that app at all?