programming a "terminal"?

Discussion in 'C Programming' started by Arjun, Dec 13, 2005.

  1. Arjun

    Arjun Guest

    Hi,

    I wasn't sure quite what to title this, so I just chose something that
    sounded reasonably correct. If I butcher and/or misuse any terms in
    this post, then I apologize, please correct me.

    My problem is this: I want to program a GNU Screen - like application,
    though not _nearly_ on the same scale. The only thing I really want it
    to be able to do is support multiple "windows", as it were, and
    automatically notify the user when one of them is free for usage - that
    is, the task in it is over. Originally, I had the bright idea to use
    C's built-in system(command) function to do the actual code execution,
    but it turns out system(command) executes command and then kills that
    "session", for lack of a better term. So if I type something like "cd
    /var/www", it will cd the user into the /var/www directory, then kill
    that "session", thus resetting all environment variables and putting
    the user back in /home/$user. So if I type "cd /var/www" and then I
    type "pwd", i get /home/$user, but if I do "cd /var/www; pwd", i get
    /var/www.

    I know this can be done correctly, as programs like screen, xterm, and
    so on have to have the terminal functionality, or else they'd be
    worthless. The problem is, I can't make head or tail of screen's code,
    and xterm's is a nightmare. So here's my plea: Does anyone know of
    either 1) a resource that gives insight into the building of a
    "terminal" application such as the aforementioned, or 2) a very simple
    terminal program whose source I can dissect and preferably ask
    questions about?

    Thanks,
    Arjun

    By the way, this is being programmed C using ncurses.
    Arjun, Dec 13, 2005
    #1
    1. Advertising

  2. Arjun

    Chuck F. Guest

    Arjun wrote:
    >
    > My problem is this: I want to program a GNU Screen - like
    > application, though not _nearly_ on the same scale. The only
    > thing I really want it to be able to do is support multiple
    > "windows", as it were, and automatically notify the user when
    > one of them is free for usage - that is, the task in it is over.
    > Originally, I had the bright idea to use C's built-in
    > system(command) function to do the actual code execution, but it
    > turns out system(command) executes command and then kills that
    > "session", for lack of a better term. So if I type something
    > like "cd /var/www", it will cd the user into the /var/www
    > directory, then kill that "session", thus resetting all
    > environment variables and putting the user back in /home/$user.
    > So if I type "cd /var/www" and then I type "pwd", i get
    > /home/$user, but if I do "cd /var/www; pwd", i get /var/www.
    >

    .... snip ...
    >
    > By the way, this is being programmed C using ncurses.


    Screens are system dependent. There is no guarantee a C system has
    such a thing. Thus they are off-topic in c.l.c. You should try a
    newsgroup that deals with your actual system. c.l.c deals ONLY
    with the portable, system independent, C language as specified in
    the various standards, especially C90 and C99.

    Similarly directories, sessions, ncurses are all system dependent,
    and off-topic here.

    --
    Read about the Sony stealthware that is a security leak, phones
    home, and is generally illegal in most parts of the world. Also
    the apparent connivance of the various security software firms.
    http://www.schneier.com/blog/archives/2005/11/sonys_drm_rootk.html
    Chuck F., Dec 13, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brantley Richbourg

    Visual Studio .NET & Terminal Server

    Brantley Richbourg, Nov 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    471
    Brantley Richbourg
    Nov 1, 2004
  2. Bill Priess

    Re: Restart service - Terminal Services

    Bill Priess, Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,115
    Bill Priess
    Jun 25, 2003
  3. Arjun

    Re: programming a "terminal"?

    Arjun, Dec 13, 2005, in forum: C Programming
    Replies:
    5
    Views:
    355
    Richard Tobin
    Dec 15, 2005
  4. gaurav kashyap
    Replies:
    3
    Views:
    6,642
    Paul Boddie
    Oct 31, 2008
  5. Steve
    Replies:
    2
    Views:
    932
    edicionsdigitals.com edicions digitals xarxa socia
    Dec 7, 2010
Loading...

Share This Page