If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
From - Fri Sep 28 06:04:35 2001
Path: typhoon.ne.mediaone.net!chnws06.ne.mediaone.net!24.147.2.43!chnws02.mediaone.net!newsfeed2.skycache.com!newsfeed1.cidera.com!Cidera!cpk-news-hub1.bbnplanet.com!news.gtei.net!newshub2.home.com!news.home.com!news1.rdc1.nj.home.com.POSTED!not-for-mail
From: "Brian K. White" <brian@aljex.com>
Newsgroups: comp.unix.sco.misc
References: <9p09ar$mdb$1@news.inav.net>
Subject: Re: Passthru print on Link Mc5 kills login session
Lines: 208
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Message-ID: <c%Rs7.3943$c8.512497@news1.rdc1.nj.home.com>
Date: Fri, 28 Sep 2001 03:19:36 GMT
NNTP-Posting-Host: 24.253.240.158
X-Complaints-To: abuse@home.net
X-Trace: news1.rdc1.nj.home.com 1001647176 24.253.240.158 (Thu, 27 Sep 2001 20:19:36 PDT)
NNTP-Posting-Date: Thu, 27 Sep 2001 20:19:36 PDT
Organization: Excite@Home - The Leader in Broadband http://home.com/faster
Xref: chnws06.ne.mediaone.net comp.unix.sco.misc:103861
"Gregory Calvert" <gmc@inav.net> wrote in message
news:9p09ar$mdb$1@news.inav.net...
>
> When I issue a unix print job to my passthru printer attached to a Link
Mc5
> terminal running in VT220-7 mode, the job prints but my login session
never
> comes back. I am kicked out to a login prompt.
>
> The terminal responds correctly to the following string when entered from
> the keyboard:
>
> echo "\033[5ithis is a test \033[4i"
>
> This terminal is attached via a modem.
>
> Thanks for any suggestions
----- Original Message -----
From: "Gregory Calvert" <gmc@inav.net>
To: <brian@aljex.com>
Sent: Thursday, September 27, 2001 6:24 PM
Subject: Passthru printing on Link Mc5
> Thanks for your reply. After modifying termcap for vt220, and terminfo, it
prints when I issue the following command:
>
> echo "\033[5i thisis a test\033[4i"
>
> It still wouldn't print a unix file, printing it to the screen instead. I
put the printer off and printer on codes in the printer > interface script
( /usr/spool/lp/admins/lp/interfaces/nlib ), and then it would print a unix
file but it kills my session- kicks > me out to a login. This terminal is
attached via modem. Any ideas?
> Thanks for your help.
[ I'm replying to this back in public. it is of general interest to others,
and if you want exclusive attention, then generally my company and
subsequently me gets paid for that. :) ]
if the above command prints to the printer, then it proves that your
terminal does in fact use ansi passthru print codes as opposed to some other
flavor, or none at all. The above command does not care about termcap or
terminfo or the $TERM variable since it doesn't use any of them. This tells
us what we need to know in order to set those things up so that all your
other applications will work, which *do* need those systems to be configured
properly since that is how they figure out that they should send "\E[5i" and
such.
First, where are you getting "vt220" from? Does the terminal manual say that
is the emulation it supports best?
[ ok, I see from the newsgroup post that you know the terminal is in
"vt220-7" mode. that answers this question and several of the following
ones, so you can skip to the part where I say "assuming it really is a
vt220..." ]
Log in via this terminal and perform a few tests and tell me the results.
echo $TERM
what does it say?)
hit ctrl-v followed by the F1 key, followed by the enter key.
Note down the escape sequence displayed and then hit enter or delete to
get a fresh command prompt, then do the same for F4, F5, and F10, and
Delete, and Backspace. Delete and/or Backspace might not display any
sequence, just tell me what it does do. delete might make a new command
prompt, backspace might simply move the cursor to the left one space, or
Delete might show something like ^[[3~ and backspace might show something
like ^?
If your terminal is really vt220, F1 might show ^[[[A , or if it is really
scoansi, it might show ^V^[[M: not found
of that, the ^[[M is the important part.
do all of them and report what they say
ctrl-v F1 enter
ctrl-v F4 enter
ctrl-v F5 enter
ctrl-v F10 enter
ctrl-v Delete enter
ctrl-v Backspace enter
This will tell us:
what kind of terminal your system *thinks* you have (value of $TERM)
and
what kind of terminal you really have (determined via the ctrl-v stuff)
and then we can make sure that they match and if necessary fix one or the
other until they match.
untill we get that, nothing else can be done, since everything else depends
on this being correct.
assuming for now that it really is a vt220 compatible terminal, then this is
what you need to do:
vi /etc/ttytype
find the line that has the tty the modem is on, change the first word from
"unknown" (or whatever it says now) to "vt220"
log ot, log back in, you should get a prompt immediately after login that
looks like:
TERM = (vt220)
just hit return, or, if it does not say vt220 in the parenthesis, then type
in vt220 and hit return, instead of just hitting return. then proceed...
first verify TERM is currently set to vt220,
echo $TERM
it should print "vt220", if it does, proceed. If it does not then type:
TERM=vt220 ;export TERM
and proceed...
infocmp >vt220.src
echo "\tmc5=\\E[5i, mc4=\\E[4i," >>vt220.src
tic vt220.src
vi /etc/termcap
find the vt220 entry, go to the end of the last line in the vt220 entry
and add a singe backslash immediately followed by a carriage return, then a
tab, then this:
:PN=\E[5i:PS=\E[4i:
now, at this point you should have a working lprint command,
echo "this is a test" |lprint
also try
echo "this is a test" |lp -L local
now... All that is nice and good so far, but many applications cannot
actually print to a local printer using passthru print via lprint or lp -L
local because they write to the screen at the same time they write to the
printer, like a little "busy" or progress indicator like "now printing
record 1 ...2 ...3 etc..." if the application does not know that the print
data is actually going through the same channel as the screen, and that the
screen has been shunted to the printer for the moment, that screen display
data will go to the printer and mess up the print job. In these cases,
usually the application provides it's own means of passthru printing, and
you have to tell the *application* that your printer is using passthru, and
you must tell the *application* what the escape codes are it should use.
often this is in the form of a termcap file similar to /etc/termcap, but
which comes with the application, and resides somewhere in the applications
home directory, and which is only used by the application. Or, sometimes the
application has a config file or a setup screen somewhere where you can
define the printer on/off sequences.
If the computer has a multi-port serial card, (specialix, digiboard,
equinox, cyclades...) then you have another option that sidesteps all of the
above. you can put the modem on one of the serial ports on the multiport
adapter (instead of one of the motherboard built-in ports) and define a new
local printer on a special "printer" device that corresponds to the serial
port the modem is on.
taking an example from an Equinox, #6 port has all these device names
associated with it
/dev/tty1a6 plain serial line, without modem control
/dev/tty1A6 serial line with modem control
/dev/tty1a6p printer on port 6 without modem control
/dev/tty1A6p printer on port 6 with modem control
they all are ways to access the same physical port, but depending on which
device you use, determines how the serial line is accessed. connecting to
/dev/tty1a6 simply means that the operating system ignores a few of the
signals in the serial port, namely, the ones that are usually only used by a
modem to tell the computer that it is on or off hook, or has carrier detect
, these are not necessary for direct connected terminals so this is a way to
ignore them. However, if you are connecting via a modem, you it is for all
intents and purposes necessary to use the modem control form of the device,
so that when the modem loses carrier, the operating system is notified and
can kill any processes that might have been running and reset the modem to
accept the next incoming call and allw the caller to login.
the devices with the p added are special virtual devices provided by the
multiport adapter driver software.
When you send data to them, the serial driver automatically handles sending
the escape sequences and data for passthru printing, and this *does* work
even for applications that try to print to both the screen and the printer
at once. The serial driver takes in data on both devices, and you do *not*
tell the application anything about passthru printing, nor do you use lprint
or lp -L local, you simply send data to the ...p device whenever you want,
including sending data to both devices at the same time, and the serial
driver simply sends a little from each channel either with or without escape
codes around it as needed.
the actual names of the serial devices and the actual names of the
printer-only versions are different for each brand of serial card, but the
idea is the same. You may need to run some kind of port setup utility that
came with the serial card to turn this feature on, oradjust it in some way.
For Equinox, the programs is ssdiag, I forget what it is for digiboard but I
know it's very similar in operation.
Then you define a printer like usual either in the application, or in
scoadmin, or both, and you say that the printer is on "/dev/tty1A6p", don't
say anything about passthru or local print, and the serial drive takes care
of everything from then on... this way also has one other really handy
advantage, doing it this way means anyone can print to this printer. As long
as the computer is turned on and the terminal is connected (even if it's not
logged in, so long as it is connected (IE: sitting at the the login prompt)
then other users or background processes can print to the printer if you so
desire, not just yourself. It opens up some nifty possibilities.
Brian K. White -- brian@aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)
| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 3 | 3 | 13 | 206 | 1,535 |
/Bofcusm/778.html copyright 1997-2004 (various authors) All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Add your comments