----- Original Message -----
From: "Andrew Joakimsen"
I have an old DOS program running under dosemu. Everything works ok except for printing. I was wondering how I can redirect the printer output via SSH (but not using port forwarding) It seems to be possible on the client side but I can't figure out how to redirect the printer on the server side.
According to the SSH client's docs:
"A lot of VT100-compatible terminals support printing under control of the remote server. PuTTY supports this feature as well, but it is turned off by default.
To enable remote-controlled printing, choose a printer from the "Printer to send ANSI printer output to" drop-down list box. This should allow you to select from all the printers you have installed drivers for on your computer. Alternatively, you can type the network name of a networked printer (for example, \\printserver\printer1) even if you haven't already installed a driver for it on your own machine.
When the remote server attempts to print some data, PuTTY will send that data to the printer raw - without translating it, attempting to format it, or doing anything else to it. It is up to you to ensure your remote server knows what type of printer it is talking to."
And that is exactly what I need to do... redirect LPT1 in dosbox to the SSH client's printer.
That's not what you seem to think it is. That's just plain old ansi printer sequences. Also called "passthru" printing. All that means is this: If your terminal impliments the feature, as putty and almost every other terminal and terminal emulator does, then you can send data from the server to the terminals printer by wrapping the data in the ansi printer escape sequences. Go into putty config and specify some printer for the ansi passthru printing. Make sure it's a printer that understands pcl5 or lower, or plain text on it's own, it can't be a windows gdi printer or even a pcl6 one unless it happens to also have pcl5e or less. An awful lot of printers will not work this way. And generally if it was cheap, then it won't work. Now from the server send a small print job: echo -e "This text will be on the screen.\n\033[5iThis text should go to the printer.\r\n\033[4iThis text is on the screen." If your printer isn't a piece of junk then you should have got a line of text printed out. The data came in-band down the same tty that is used to draw text on your screen, but your terminal recognized "Esc[5i" and as redirected all incoming data to a print job instead of the screen until it saw the "Esc[4i". It's just a form of markup really. You can't practically use passthru printing to do what you want. Generally it is used by applications that have built in support specifically for it. The application uses the printer control sequences itself just the way it uses everything else it gets from termcap or terminfo such as the codes for changing text colors etc... No dos program is going to understand ansi printing. You could set up a script that acts as a virtual printer that sends print jobs to your tty from the background, except you can't because that background process has no way to ensure that the forground process does not print any characters or other data to the tty while the print job is transferring. Also, putty is the worst of any terminal emulator in existence for ansi printing because unlike every other terminal, it has no print job flush timer. Most terminals have a print job timer where whenever a print job comes through, when the printer-off sequence comes along, the print job is still held open on the terminal and a timer starts counting down in the background while outwardly the terminal resumes normal interactive use. If a printer-on comes along before the timer runs out, then the new data is merely appended to the already pending job, when the printer-off comes again, the timer is reset and starts counting down from the top again. Only when the timer reaches 0 does the terminal close the print job, resulting in the page eject. Programs the use passthru printing will send printer-on-off codes possibly many times per second, sending a little data to the printer, a little to the screen, a little more to the printer etc.. all during say, printing a report. In most terminal emulators, the typically 5 second flush timer means all the little tiny snips of print data are coelesced into one actual print job. In putty, depending on the application, you can get a page eject for every line of a report. aside: I have actually paid a developer to add a flush timer and a few other features to putty for me but he's taking a ridicuous number of weeks. The flush timer happens to be the one thing he did so far but I'm not ready yet to put the results back out into the public. In fact, I don't even have the modified source yet anyways. The only sensible way to get your dos app to print to a remote windows pc is via network. Share the printer and then either via vpn or ssh tunnel or plain port forwarding, make that share reachable from the server. You absolutely do not want to allow samba access from the internet, but there is also print services for unix (windows lpd server) and exernal print servers that can be used by a number of different protocols like raw tcp, ftp, email. Then configure dosemu to associate lpt1 with the cups queue. If your dos app has a config option to define a command to run for printing, maybe then you could use passthrough, as long as the application runs the print program in the foreground so that nothing else can access the tty while the print program is running. Then you could define a print command that is just a little script that sends the printer escape sequence, the data, and the closing printer sequence. I extremely doubt you are going to find any such option. Possibly there is a way to get dosemu to do what the app never imagined. Dosemu should be able to block off access to the tty while it sends a passthru print job, even if the app tries to write to the tty at the wrong time, except I don't think it actually has the necessary options. -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org