A
Arjun
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.
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.