The operating system supports the use of local printers attached to the AUX or PRINT port on the back of many serial terminals. You can connect these printers via standard RS-232 connections to reduce the load on shared system printers. Once you configure the terminal properly, you can use the lprint(C) command to print files on the local printer.
To add a printer connected to the AUX or PRINT terminal port:
The lprint command must know how to start and stop local printing for each specific terminal. The PN and PS terminal attributes in /etc/termcap define escape sequences that are sent to the terminal to control local printing.
Use a text editor to search for the entry for your terminal in the /etc/termcap file. For example, if your terminal is a Wyse 60, search for ``wyse60''.
Wyse 60 termcap entry
w7|wy60|wyse60|Wyse WY-60 with 80 column/24 line screen in wy60 mode:\ :is=\E`\072\Ee(\EO\Ee6\Ec41\E~4\Ec21\Ed/:\ :if=/usr/lib/tabset/std:pt:\ :G1=\EH3:G2=\EH2:G3=\EH1:G4=\EH5:GD=\EH0:GG#0:GH=\EH\072:\ :GU=\EH=:GV=\EH6:GR=\EH4:GL=\EH9:GC=\EH8:GF=\EH7:\ :PU=\EJ:PD=\EK:\ :al=\EE:am:bs:bt=\EI:cd=\EY:ce=\ET:cl=\E+:\ :cm=\Ea%i%dR%dC:co#80:dc=\EW:dl=\ER:ei=\Er:im=\Eq:k0=^AI\r:\ :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:k7=^AF\r:\ :k8=^AG\r:k9=^AH\r:kd=^J:kh=^~:kl=^H:kr=^L:ku=^K:\ :li#24:mi:nd=^L:se=\EG0:so=\EG4:sg#0:ug#0:ue=\EG0:ul:up=^K:us=\EG8:\
The Wyse 60 has PN and PS defined.
Log in as root to edit /etc/termcap. Make a backup copy of /etc/termcap before editing it.
Refer to your terminal manual to find the sequence of control characters
used to switch the auxiliary port on and off
(this is sometimes referred to as ``passthrough'' or
For example, for a Wyse 60 terminal,
the code to switch on the port auxiliary printing is:
<Esc> d #
And the code to turn it off is:
You must translate these keystrokes into termcap format before inserting them into the termcap file. termcap uses the codes in ``termcap keystroke translations'' to represent keystrokes.
termcap keystroke translations
|CTRLx||^x (x is any character)|
You can represent characters by their caret (^) and backslash (\) characters or by their octal codes. See the ascii(M) manual page. Separate termcap attributes by a colon (:).
Translate the termcap entry for the Wyse 60 keystrokes for PN (<Esc> d #) and PS (<Ctrl>t) into a termcap entry.
For a terminal missing these entries, simply insert a modified version of this line into the termcap entry for the terminal. For other terminals, check your owner's manual and locate the proper sequences for turning the auxiliary print mode on and off and substitute the termcap sequences as in the example. Some terminals (such as the Wyse 60) include a transparent mode, where the data is not displayed on the screen as it is printed. This is the mode selected by the PN sequence in the example.
Do not touch your keyboard while local printing is taking place. You cannot perform other tasks on your terminal while printing.
To eliminate carriage return delays, set the environment variable CRDELAY to ``N''. Do this only if you are running a fast printer.
If, when printing with lprint, everything prints on one line, set the environment variable FORMS to ``X'' to turn on lprint's ``transparent'' mode. In this mode, lprint does not perform special processing of carriage returns, line feeds, form feeds, or tabs.
If the terminal and printer require different stty settings, you must create a shell script to handle that:
: # /usr/bin/lprints # # Do local printing with stty settings that differ from # those of the terminal. The required settings are read # from environment variable LPRINTSTTY.
oldstty=`stty -g` [ "$LPRINTSTTY" != "" ] && stty $LPRINTSTTY
FORMS=X /usr/bin/lprint "$@"
Users can store the stty settings required for a local printer using the environment variable LPRINTSTTY. You can set system-wide values in the /etc/profile and /etc/cshrc files:
LPRINTSTTY="ixon ixoff -ixany onlcr"; export LPRINTSTTY