A Legion tty object directs output from Legion processes towards a specific shell. This means that you can see the output from a remotely executed program on your workstation, direct output from a locally executed program into a file, or perhaps view the output from several simultaneously executed programs in a single shell. Generally, you will want one tty object per shell, so that each shell's output will appear in that shell, regardless of where its processes are run.
Note that when you exit from a shell the tty_watch process will not automatically shut down. That is, it will continue to send information to the now defunct shell. This will bog down the tty process and may result in error messages. We therefore suggest that before you exit a shell you stop the tty_watch process.
There are two commands for the simple approach: legion_tty and legion_tty_off. The former creates, sets, and watches a tty object and the latter stops the tty_watch process, so that the output from the shell will no longer be directed towards the shell. Note that this approach sets and watches a tty object in a single shell. If you wish to set a tty object in one shell and watch it in another you should use the complex approach.
If mytty does not already exist, a new tty object will be created and assigned the context path name /tty_objects/mytty. The output from all processes run in your current shell, whether on your local system or a foreign system, will now be directed to mytty, and a tty_watch process will start. This process will watch its assigned tty object and pass a copy of the tty object's information to the shell's standard output (i.e., to the shell's command line). Note that a shell can run only one tty_watch process at a time.
To stop the tty_watch process, run the legion_tty_off command. This will end whatever tty_watch process is currently running in the current shell, although it will not destroy the tty object being watched.
First, if you do not already have a tty object you must use legion_create_object to create a tty object. Then use legion_set_tty to set a tty object for your shell. Remember that you can only have one tty object set per shell. If a tty object has already been set, legion_set_tty will just switch to the new one. Finally, use legion_tty_watch to start watching your current (set) tty object. The whole procedure looks something like this:
The legion_tty_watch command can be run with or without a tty object's name: multiple tty_watches can be run, and can be started at different times. They can be piped to a file, or run in a different window, as desired. To stop the tty_watch procedure, send a SIGINIT, using either "kill -INT" or the Ctrl-C key combination.
To direct the current tty object's output to a file object instead of standard output, use the legion_tty_redirect command. The example below redirects the current tty's object output to file object Foo. If no file object of that name exists, Legion will create a new one.