[comp.binaries.ibm.pc.d] ms_sh-1.6.4 question

thewalt@canuck.ce.berkeley.edu (C. Thewalt) (01/22/91)

I recently grabbed a copy of ms_sh version 1.6.4 from
comp.binaries.ibm.pc and it is really nice, but I have a configuration
question.  I am trying to rebind the keys (to act like emacs mode for
a variety of unix shells) in sh.ini and all was going really well
until I tried to bind Previous to ^P.

It seems to me that ms_sh tries to start echoing stuff to the printer
on a ^P, even if I use it for something else in the sh.ini file.  Is
there a way to use ^P for Previous?  Please don't suggest binding
Previous to something else, it is almost reflex for me to use that and
I keep hanging the shell when I do it (bound or not).  Somehow or
other I have to disable this printing stuff.

I do have the source, but don't have MSC. Anyone know if it works with TC?

Chris
--
Christopher Robin Thewalt               These opinions are not necessarily
thewalt@ce.berkeley.edu                 shared by my employer...
University of California, Berkeley

scott@cs.hw.ac.uk (Scott Telford) (01/22/91)

In article <THEWALT.91Jan21100752@canuck.ce.berkeley.edu> thewalt@canuck.ce.berkeley.edu (C. Thewalt) writes:
>... I am trying to rebind the keys (to act like emacs mode for
>a variety of unix shells) in sh.ini and all was going really well
>until I tried to bind Previous to ^P.
>
>It seems to me that ms_sh tries to start echoing stuff to the printer
>on a ^P, even if I use it for something else in the sh.ini file.  Is
>there a way to use ^P for Previous?  Please don't suggest binding...

I've found this problem too. Some bit of DOS (probably deep down in the
BIOS) intercepts ^S, ^P & ^N which is a bit of a pain for us Emacs/tcsh
addicts who keep turning the printer echo on when we hit ^P or ^N. Has
anybody found a fix for this? It can't be completely impossible since
the MKS Toolkit Korn Shell doesn't have this problem.

>I do have the source, but don't have MSC. Anyone know if it works with TC?

No. I think it would be fairly non-trivial to make it compile under
Turbo C.
 _____________________________________________________________________________
| Scott Telford, Dept of Computer Science,               scott@cs.hw.ac.uk    |
| Heriot-Watt University, Edinburgh, UK.                 scott%hwcs@ukc.uucp  |
|_____ "Expect the unexpected." (The Hitch-Hiker's Guide to the Galaxy) ______|

thewalt@canuck.ce.berkeley.edu (C. Thewalt) (01/24/91)

In article <2034@odin.cs.hw.ac.uk> scott@cs.hw.ac.uk (Scott Telford) writes:
   In article <THEWALT.91Jan21100752@canuck.ce.berkeley.edu> thewalt@canuck.ce.berkeley.edu (C. Thewalt) writes:
>>... I am trying to rebind the keys (to act like emacs mode for
>>a variety of unix shells) in sh.ini and all was going really well
>>until I tried to bind Previous to ^P...

> I've found this problem too. Some bit of DOS (probably deep down in the
> BIOS) intercepts ^S, ^P & ^N which is a bit of a pain for us Emacs/tcsh
> addicts who keep turning the printer echo on when we hit ^P or ^N. Has
> anybody found a fix for this? It can't be completely impossible since
> the MKS Toolkit Korn Shell doesn't have this problem.

Hmm. The ^S and ^N work for me (bound to ScanForeward and next
respectively) but the ^P is making my life miserable.

Chris
--
Christopher Robin Thewalt               These opinions are not necessarily
thewalt@ce.berkeley.edu                 shared by my employer...
University of California, Berkeley

scott@cs.hw.ac.uk (Scott Telford) (01/25/91)

In article <THEWALT.91Jan23085505@canuck.ce.berkeley.edu> thewalt@canuck.ce.berkeley.edu (C. Thewalt) writes:
>In article <2034@odin.cs.hw.ac.uk> scott@cs.hw.ac.uk (Scott Telford) writes:
>> I've found this problem too. Some bit of DOS (probably deep down in the
>> BIOS) intercepts ^S, ^P & ^N which is a bit of a pain for us Emacs/tcsh
>> addicts who keep turning the printer echo on when we hit ^P or ^N. Has
>> anybody found a fix for this? It can't be completely impossible since
>> the MKS Toolkit Korn Shell doesn't have this problem.
>
>Hmm. The ^S and ^N work for me (bound to ScanForeward and next
>respectively) but the ^P is making my life miserable.

Umm... yes. I'm not sure where I got ^N from. I think I read it in an old
Dell DOS manual. Anyway, DOS *does* eat ^S (freeze screen) and ^P (toggle
printer). Pressing "^S <any key> ^S", will generate a ^S though. Looking
at the source, sh seems to use the Microsoft library function getch() to
read the keyboard, which according to the sh manual, uses DOS function
8h. I think it could be fixed by replacing this with a BIOS call, or
perhaps using the DOS ioctl function to set RAW mode on the CON: device
beforehand.

And now for another question...
Has anybody got sh 1.6.4 to run using XMS to swap to under Windows 3.0?
I've got 1Mb of extended, the HIMEM.SYS driver supplied with Win3 and
the line "swap extend" (*not* "extent" as in the manual) in my
/etc/profile.sh.

This works OK outside Windows, but when run from Windows I get the
message "PANIC: Error reloading from swap-file" (or words to that
effect) whenever sh tries to swap back in after executing anything.

I've tried fiddling with the PIF to no avail.

Strange as it sounds, I find the combination of Windows + Bourne Shell
very comfortable....
 _____________________________________________________________________________
| Scott Telford, Dept of Computer Science,               scott@cs.hw.ac.uk    |
| Heriot-Watt University, Edinburgh, UK.                 scott%hwcs@ukc.uucp  |
|_____ "Expect the unexpected." (The Hitch-Hiker's Guide to the Galaxy) ______|

jpn@genrad.com (John P. Nelson) (01/26/91)

>>It seems to me that ms_sh tries to start echoing stuff to the printer
>>on a ^P, even if I use it for something else in the sh.ini file.  Is
>>there a way to use ^P for Previous?  Please don't suggest binding...
>
>I've found this problem too. Some bit of DOS (probably deep down in the
>BIOS) intercepts ^S, ^P & ^N which is a bit of a pain for us Emacs/tcsh
>addicts who keep turning the printer echo on when we hit ^P or ^N.

I've been holding off from replying to this because I assumed that
there would be a flood of answers.

No, it isn't the BIOS doing ^P and ^S processing (I don't think ^N does
anything, does it?), it is the DOS CON: driver.  There are two very simple
ways for a programmer to avoid this effect:  #1:  instead of asking DOS
for input characters, you can use the BIOS functions to read the keyboard
(Actually, certain DOS functions will bypass the ^P ^S processing, too).
#2, the special processing can be disabled by using the MSDOS "IOCTL"
function:  IOCTL can be used to put the console into RAW mode, so it
won't do any special processing of input characters.

If someone's emacs or communications program is using the COOKED DOS
input functions to get keyboard data, then that program is BUGGY, and
should be FIXED.

     john nelson

uucp:	{decvax,mit-eddie}!genrad!jpn
domain:	jpn@genrad.com

roeve@cip-s01.informatik.rwth-aachen.de (Michael Roevenich) (01/30/91)

jpn@genrad.com (John P. Nelson) writes:

>>>It seems to me that ms_sh tries to start echoing stuff to the printer
>>>on a ^P, even if I use it for something else in the sh.ini file.  Is
>>>there a way to use ^P for Previous?  Please don't suggest binding...
>>
>>I've found this problem too. Some bit of DOS (probably deep down in the
>>BIOS) intercepts ^S, ^P & ^N which is a bit of a pain for us Emacs/tcsh
>>addicts who keep turning the printer echo on when we hit ^P or ^N.

>No, it isn't the BIOS doing ^P and ^S processing (I don't think ^N does
>anything, does it?), it is the DOS CON: driver.  There are two very simple
>ways for a programmer to avoid this effect:  #1:  instead of asking DOS
>for input characters, you can use the BIOS functions to read the keyboard
>(Actually, certain DOS functions will bypass the ^P ^S processing, too).
>#2, the special processing can be disabled by using the MSDOS "IOCTL"
>function:  IOCTL can be used to put the console into RAW mode, so it
>won't do any special processing of input characters.

>If someone's emacs or communications program is using the COOKED DOS
>input functions to get keyboard data, then that program is BUGGY, and
>should be FIXED.

Unfortunately, you're not quite right. I wrote a keyboard driver some time ago
and did some snooping in the way KEYB handles certain Controls. Some keypresses
are directly handled by the INT9-driver, which means, they are transferred
directly to the BIOS. These are PrtScr, Pause, some others (I can't remember
at the moment all of them), and Ctrl-P, which initiates Printer-Echoing.

I'm not sure at the moment whether the keyboard-driver passes the scan-Codes
of those keys onto the INT16-handler or into the buffer... you might have
to mangle with the INT9-driver itself to solve your emacs-problem.

Greetings from FRG

Michael Roevenich 



Internet: roeve@rwthi3.informatik.rwth-aachen.de
UUCP:     ...unido!rwthi3!roeve
FIDO:     2:242/42.1 (Michael Roevenich)