Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2007 14:22:30 +0200
From:      Simias <simias.n@gmail.com>
To:        freebsd-hackers@freebsd.org
Cc:        djembe nazar <dn77881188@googlemail.com>
Subject:   Re: two-way terminal multiplexing
Message-ID:  <86d4x52ovt.fsf@simias.hd.free.fr>
In-Reply-To: <b7a18f790708300423o5cb56551lf5b409698c8d1e32@mail.gmail.com> (djembe nazar's message of "Thu\, 30 Aug 2007 12\:23\:37 %2B0100")
References:  <b7a18f790708300423o5cb56551lf5b409698c8d1e32@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"djembe nazar" <dn77881188@googlemail.com> writes:

> I am trying to work out a way to do the following for a
> "FreeBSD teaching environment":
>
> The intention is to have two terminals, one above the other.
> The bottom terminal shows one's own commands and output like
> an ordinary xterm whilst the top terminal shows the commands
> and output of a peer (such as an instructor).
>
> The pupil is not allowed to enter commands into the
> instructor's terminal, it simply shows what the instructor
> typed and the resulting output of the commands. The same
> is true of the reverse. The overall concept is to allow an
> instructor to tutor a pupil over an appropriate medium such
> as instant messaging whilst allowing the pupil to learn by
> example with a very hands-on approach.
>
> In the case of a standard 1-to-1 teaching environment, the
> instructor would see his/her own terminal on the bottom and
> the terminal of the pupil on the top. The pupil would see the
> reverse (instructor's terminal above, his/her own terminal
> below).
>
>      pupil sees:            instructor sees:
>   +-----------------+     +-----------------+
>   | INSTRUCTOR TERM |     |    PUPIL TERM   |
>   +-----------------+     +-----------------+
>   |    PUPIL TERM   |     | INSTRUCTOR TERM |
>   +-----------------+     +-----------------+
>
> I do not understand how to achieve this. Is this even possible
> given standard unix security with regards to hijacking the
> tty devices of other users on the system?
>

I think you may achieve this with GNU Screen, since it supports multi
users sessions (look for addacl and aclchg in the screen(1) man page).

If you want to do that by yourself, I'd use a client/server
architecture, the instructor would start a program like script(1), but
instead of writing to a file, it'd write to a socket, and the pupil
would start a client version that will just read the socket and output
what it receives. Note that it probably won't work very well if the two
terminals have different size and/or different Termcaps (especially with
curses apps like vi or emacs).

It's quite trivial to implement, but maybe it won't meet your requirements.

-- 
Simias



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86d4x52ovt.fsf>