That's quite ambitious, BUU!
screen has to implement not only the functionality to write the contents of the screen to a user (curses can help you with that) but also the other side of this translation: functionality to interpret the output of other programs and render it to a virtual screen. This is of course a terminal emulator.
You will be able to experience all the joys of VT100. (Actually you can choose to emulate some other kind of terminal instead, but VT100 is so ubiquitous...) You can learn about all of the various deviations from the standard (if there is such a thing). You can emulate xterm so as to be bug compatible with it! Support for Unicode (UTF-8 encoding, certainly) in a terminal emulator with its combining characters, bidirectional text and wide/narrow characters is a lot of fun too!
I congratulate you if that's your idea of a "just because" project for fun. It's not really mine! screen is quite hackable and extensible (through its scriptability and features like coprocesses) so to me it's an excellent invitation to build on top of existing work.
Anyway one of the important functions you need is that you need to emulate several terminals at the same time (with one at a time being displayed on the "real" terminal). In order to accomplish this you should either look at an event loop or threads. If you want to support detaching or multi attaching like screen does, you need to choose an IPC mechanism to support this. screen uses UNIX domain sockets.
In reply to Re: "Faking" screen in perl?
by Celada
in thread "Faking" screen in perl?
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |