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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.