![]() |
![]() |
![]() |
View or control another console (QNX)
ditto [-c command_char] [-f] [-k] [-n node] [-q] [-t console] [device_pathname]
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.
![]() |
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.)
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.
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.
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.
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.
An alphabetical list of commands follows:
This mode is the default if ditto was invoked with the form:
ditto //node/dev/conXSee the "View active console" command if you wish instead to always view the active (displayed) console on a remote node.
See the "Attach Specific Console" command if you wish instead to always view a specific console of a node.
This mode is the default if ditto was invoked with the form:
ditto user_name
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.
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
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.
![]() |
![]() |
![]() |