[Previous] [Contents] [Next]

ditto

View or control another console (QNX)

Syntax:

ditto [-c command_char] [-f] [-k] [-n node]
      [-q] [-t console] [device_pathname]

Options:

-c command_char
Enter command mode on this character (hex value). Default is 05 (or Ctrl-E).
-f
Follow "active" console.
-k
Enable local keyboard.
-n node
View the console on this node.
-q
Quiet operation; don't notify target being watched.
-t console
View this console number (0-10).
device_pathname
The pathname of a console device (e.g. //1/dev/con1).

Description:

The ditto utility allows a user to attach their local console or terminal to a remote console. While attached, the local screen reflects the contents of the remote screen, and any changes made to the remote screen are updated on the local one. When the keyboard is enabled, key strokes entered by the user of ditto are "injected" into the remote console, as if typed directly by the remote user.

The ditto utility can monitor only consoles, typically memory mapped devices. Any device driver which supports the console-specific functions (defined in the Watcom C Library Reference for QNX), can support ditto. Currently, this restricts the "ditto-able" devices to those provided by Dev.ansi, Dev.con and wterm (the QNX windows terminal program). Terminal devices provided via ptys e.g. xterm (X-Windows System program) and pterm (Photon terminal program), are not ditto-able, though you may ditto a console from these devices.


Note: You can use ditto from a pterm window in Photon to view a text-mode console; however, to view another pterm session you will need to use phditto instead of ditto. See phditto in the Photon User's Guide.

You must have appropriate permissions for the tty that you are attempting to use ditto on. If ditto fails on a tty, it may be because you do not have read permission for the target device.


While ditto is displaying the remote console on your screen, the cursor will be displayed as a blinking rectangle as an indicator that you are viewing a ditto session rather than one of your own local sessions. If you are using ditto from a tty which does not support a programmable cursor, the cursor will remain unchanged.

To exit from ditto, the command sequence Ctrl-E q can be given. (Press and hold the control key while typing an E. Release both keys, then type a q.)

Remote Typing

Upon entry, ditto will be in VIEW ONLY mode unless the -k command-line option was specified. This means that you are unable to interact with the remote console and anything you type at the keyboard will be discarded.

To enable the keyboard for remote typing you must enter the command character (Ctrl-E) followed by a k (see the Commands section).

Once remote typing is enabled, whatever you type is entered into the remote console. This facility allows two, or many, people to share any console on the network.

Console Sizes

In QNX the actual dimensions of a console are flexible depending on the type of video display hardware installed and console font or, in the case of wterm, the console dimensions specified by the user. For example an EGA can have 43 vertical lines while VGA can support up to 50 lines. (See cfont for information on using smaller console fonts, and stty for information on switching between fonts.)

As ditto attaches to different consoles, each with a potentially different number of displayed lines, your screen will be adjusted to match the number of lines on the remote console as closely as possible. (This means ditto automatically switches your screen to 43 lines if you attach to a console which has 43 lines ...).

If the entire contents of the remote console cannot be displayed locally (e.g. when you are not running ditto from a console), ditto will display only the portion of the remote console containing the cursor.

Privacy/Security

Now that ditto can provide network and dial-up users with complete, transparent access to every screen in the network, some users may find it necessary to implement some form of privacy or security. A command called noditto provides this functionality. This command is run in the background (it will place itself in the background if the user does not specify an & after the command) and excludes all but the users and groups named in its command-line parameters from dittoing the node it is run on. See noditto for more information.

Commands

As a general rule, commands issued to ditto are preceded by pressing the Ctrl-E sequence. This sequence is known as the "command character" and is used to cause ditto to accept whatever is typed next as a command to ditto instead of data to be entered into the attached remote console. If a Ctrl-E needs to be entered into the remote application, the Ctrl-E character should be typed twice. You can also use the -c command_char option to change the command character to something other than Ctrl-E.

After pressing the command character, ditto will display a prompt at the top left corner of the screen. Pressing a "?" at this point will cause ditto to display a command menu containing a list of available commands as well as the current status. If the user is unsure of what command to issue to the first prompt, ditto will also automatically display the command menu after a 3 second pause. The menu displayed by ditto is of the form:

 ---------------Commands---------------
                                         
  0    View initial console              
  1-9  View specific console             
  a    View active console               
  A    Make current console active       
  f    Follow (track) active console     
  k    Turn keyboard on/off              
  n    Display next console              
  p    Display previous console          
  q    Quit                              
  r    Reboot target node                
  u    Update (repaint) screen           
  <    Reduce number of lines        
  >    Expand number of lines        
  ?    Display help file                
 --------------------------------------

Pressing the "?" key will start the builtin ditto help system.

Ditto commands

Here's an alphabetical list of commands:

0
View initial console.

This command causes ditto to switch to the console that it was attached to when it was initially invoked.

1-9
View specific console.

Pressing the number 1 through 9, will cause ditto to lock onto the specified console of the remote node. In much the same manner, as the remote user will be typing Ctrl-Alt-1 through Ctrl-Alt-9 to switch between various consoles, a person using ditto can press the command character followed by a 1 through 9 to view a specific console. Once ditto has been locked to a particular console in this manner, it will always keep viewing it, even if it becomes inactive (i.e. not displayed on the remote node's monitor).

This mode is the default if ditto was invoked with the form:

    ditto //node/dev/conX
See the "View active console" command if you wish instead to always view the active (displayed) console on a remote node.
a
View active console.

This command will inform ditto that you wish to view the active (displayed) console of a remote node. If the user on the remote console switches virtual consoles, ditto will not follow the switch to the newly active console.

See the "Attach Specific Console" command if you wish instead to always view a specific console of a node.

A
Make current console active.

Cause the console currently being viewed in ditto to be made the currently-displayed console on the machine being ditto'd.

f
Follow (track) active console.

This command will cause ditto to follow the active console on the machine being ditto'd -- i.e. if the user at that console switches virtual consoles, the remote ditto display will also switch and display the new active console.

This mode is the default if ditto was invoked with the form:

    ditto user_name
k
Keyboard on/off.

This command turns the keyboard on or off to enable or disable remote typing. By default, typing is off, causing ditto to discard any characters typed into the keyboard.

Having typing off can be useful for monitoring remote consoles that you don't want to accidentally type into. When typing is turned on, any data typed at the keyboard is also typed into the remote console. Note that both the remote keyboard and your keyboard can type into the same remote console.

Since typing the command character (Ctrl-E) causes ditto to enter command mode, if you want it to be entered into the remote console you need to type the command character twice.

Note that QNX compose key sequences, function keys and the BREAK key are completely operational.

n
Display Next Console.

This command is used to cause ditto to transfer the attachment to the next sequential console on the remote node. Thus, this command can be used to quickly step through all the available remote consoles. Afterwards, the "View active console" command can be used to resume display of the currently displayed console again.

p
Display Previous Console.

This command is used to cause ditto to transfer the attachment to the previous sequential console on the remote node. Thus, this command can be used to step backwards through all the available remote consoles.

q
Quit.

This command will cause ditto to exit.

r
Reboot.

This command will cause ditto to reboot the node being viewed. This command will operate only if you are running ditto as root.

u
Update (repaint) screen.

This command is used to cause ditto to completely rewrite the entire screen. This can be useful if a noisy modem line has caused the local copy of the remote console to become incorrect.

<
Reduce number of lines.

This command reduces the number of lines on the remote screen, as if the user there had entered Ctrl-Alt-<.

>
Expand number of lines.

This command expands the number of lines on the remote screen, as if the user there had entered Ctrl-Alt->.

?
Display help file.

This command will cause ditto to display its online help file.

Examples:

View the first console on node 1:

    ditto -n1  

View console 3 on node 1 (//1/dev/con3), and enable keyboard control:

    ditto -k -n1 -t3

View console 2 on node 1 by name.

    ditto //1/dev/con2

View window 3 on a target running Dev.win: (Dev.win is the console driver for QNX Windows' wterm)

    ditto //1/dev/win3 

Files:

Exit status:

0
ditto was run successfully.
>0
An error occurred.

Caveats:

When a session is terminated on a console ditto is monitoring, tinit will not be able to bring up a new login until ditto detaches from that console.

See also:

Dev.ansi, Dev.con, noditto


[Previous] [Contents] [Next]