[comp.sys.ibm.pc] DOS line editing

brianc@cognos.UUCP (Brian Campbell) (01/16/87)

     I've got a question concerning some of the line editing provided by
MS-DOS/PC-DOS. 

     In almost every version I used up to and including 3.1, there has
been a Ctrl-U and Ctrl-W keystroke which is recognized.  [For those of
you who didn't know of or didn't have these features, Ctrl-U erases the
entire line (similar to ESC, but on the same line) and Ctrl-W erases
backward to the last non-alphanumeric character]. 

     The one day I was on a friend's machine running DOS 3.1 and found
that his copy did not support either function.  I did some quick
investigating and found that two short jumps in IBMDOS had been NOP'd
out.  I replaced them with the appropriate instructions and everything
worked as it used to [as I was used to]. 

     My question is why was this feature left out in some versions of
DOS (or, why was it included in mine?) I've since looked a little more
closely at the matter and found that the split is just about half and
half between haves and have-nots.  Any reasons? Ideas?

     Thanks.

reintom@rocky2.UUCP (Tom Reingold) (01/19/87)

[]
In article <307@cognos.UUCP>, brianc@cognos.UUCP (Brian Campbell) writes:
> 
>      In almost every version I used up to and including 3.1, there has
> been a Ctrl-U and Ctrl-W keystroke which is recognized.  [For those of
> you who didn't know of or didn't have these features, Ctrl-U erases the
> entire line (similar to ESC, but on the same line) and Ctrl-W erases
> backward to the last non-alphanumeric character]. 
> 
>      The one day I was on a friend's machine running DOS 3.1 and found
> that his copy did not support either function.  I did some quick
> investigating and found that two short jumps in IBMDOS had been NOP'd
> out.  I replaced them with the appropriate instructions and everything
> worked as it used to [as I was used to]. 
> 
>      My question is why was this feature left out in some versions of
> DOS (or, why was it included in mine?) I've since looked a little more
> closely at the matter and found that the split is just about half and
> half between haves and have-nots.  Any reasons? Ideas?
> 
I formatted our hard disk at work and noticed the same thing as you.  It is
not the version of DOS that is in question.  It is really a bug in the
format program because it happens only on some hard disks.  I was using
the original IBM floppy disk that had no write-enable notch.  There were
two differences between the system files on the floppy and the hard disk.
I patched the one on the hard disk to be the same as on the floppy and
the editing keys returned.

These editing features were not documented and have been removed from DOS
3.2  It seemed like a shame to me but I recently got a copy of CED, a
freeware command editor.  Having it is far better than having Ctrl-U and
Ctrl-W.  It gives command history and much more.  I suggest you get a copy.
It's really good.  You won't miss the editing keys.

-Tom
--
This paragraph is necessary because my postnews program does not permit me
to write *less* text than I am responding to.  Isn't that clever?  Now you
are reading this superfluous paragraph as a result.
-- 
Tom Reingold;  The Rockefeller University; 1230 York Av; NY 10021
PHONE: (212) 570-7709 [office]; (212) 304-2504 [home]
ARPANET: reintom@rockefeller.arpa BITNET: REINTOM@ROCKVAX
UUCP: {seismo|ihnp4|yale|harvard|philabs|phri}!cmcl2!rna!rocky2!reintom

cjdb@sphinx.UChicago.UUCP (Charles Blair) (01/21/87)

In article <307@cognos.UUCP> brianc@cognos.UUCP (Brian Campbell) writes:
>
>     I've got a question concerning some of the line editing provided by
>MS-DOS/PC-DOS. 
>
>     In almost every version I used up to and including 3.1, there has
>been a Ctrl-U and Ctrl-W keystroke which is recognized. 
>
>[...]
>     My question is why was this feature left out in some versions of
>DOS (or, why was it included in mine?) I've since looked a little more
>closely at the matter and found that the split is just about half and
>half between haves and have-nots.  Any reasons? Ideas?
>
>     Thanks.


I am, and have always been, a have-not. (I know this, because as a
frequent TOPS-20 user, Ctrl-U is instinctive.) How do I become a have?
(I.e., what's the patch?) I'm running DOS 3.2, so I'll need enough
context to find the code (if in fact I'll be able to apply the patch
at all).


Thanks.







-- 
Charles Blair   			    ..!ihnp4!gargoyle!sphinx!cjdb
The University of Chicago		          PMRCJDB@UCHIMVS1.Bitnet

kuo@skatter.UUCP (01/22/87)

In article <307@cognos.UUCP>, brianc@cognos.UUCP (Brian Campbell) writes:
> 
>      I've got a question concerning some of the line editing provided by
> MS-DOS/PC-DOS. 
> 
> [some text deleted]
>
>      Thanks.

I have ctrl-u on my DOS 3.1 but not on the DOS 2.1 I was using before!

brianc@cognos.UUCP (Brian Campbell) (01/23/87)

In article <321@rocky2.UUCP> reintom@rocky2.UUCP (Tom Reingold) writes:
>
>In article <307@cognos.UUCP>, brianc@cognos.UUCP (Brian Campbell) writes:
>> 
>>      In almost every version I used up to and including 3.1, there has
>> been a Ctrl-U and Ctrl-W keystroke which is recognized.  [For those of
>> you who didn't know of or didn't have these features, Ctrl-U erases the
>> entire line (similar to ESC, but on the same line) and Ctrl-W erases
>> backward to the last non-alphanumeric character]. 
>> 
>> 
>I formatted our hard disk at work and noticed the same thing as you.  It is
>not the version of DOS that is in question.  It is really a bug in the
>format program because it happens only on some hard disks.  I was using
>the original IBM floppy disk that had no write-enable notch.  There were
>two differences between the system files on the floppy and the hard disk.
>I patched the one on the hard disk to be the same as on the floppy and
>the editing keys returned.
>
>These editing features were not documented and have been removed from DOS
>3.2  It seemed like a shame to me but I recently got a copy of CED, a
>freeware command editor.  Having it is far better than having Ctrl-U and
>Ctrl-W.  It gives command history and much more.  I suggest you get a copy.
>It's really good.  You won't miss the editing keys.
>
>-Tom

Ridiculous!!!

Not only are the editing features available in DOS 3.20 (patch below), but
I find it *extremely* hard to believe that the format program could just
occasionally replace four different non-consecutive bytes of one of the system
files with NOP's (which is what the difference between having Ctrl-U & Ctrl-W
and not amounts to).

The following code fragment is identical in both DOS 3.10 and DOS 3.20 -- it
is located at offset (using DEBUG) 1DB9 in former and 1E96 in the latter.

   3C 17	CMP	AL,17
   74 5E	JZ	$+60
   3C 15	CMP 	AL,15
   74 51	JZ	$+53

All that is really necessary here are the two JZ instructions.  In some
versions of DOS it seems they were left out (but the CMP's are still done!)

Brian Campbell

reintom@rocky2.UUCP (01/26/87)

In article <324@cognos.UUCP>, brianc@cognos.UUCP (Brian Campbell) writes:
> In article <321@rocky2.UUCP> reintom@rocky2.UUCP (Tom Reingold) writes:
> >
> >In article <307@cognos.UUCP>, brianc@cognos.UUCP (Brian Campbell) writes:
> >> 
> >>      In almost every version I used up to and including 3.1, there has
> >> been a Ctrl-U and Ctrl-W keystroke which is recognized.  [For those of
> >> you who didn't know of or didn't have these features, Ctrl-U erases the
> >> entire line (similar to ESC, but on the same line) and Ctrl-W erases
> >> backward to the last non-alphanumeric character]. 
> >> 
> >> 
> >I formatted our hard disk at work and noticed the same thing as you.  It is
> >not the version of DOS that is in question.  It is really a bug in the
> >format program because it happens only on some hard disks.  I was using
> >the original IBM floppy disk that had no write-enable notch.  There were
> >two differences between the system files on the floppy and the hard disk.
> >I patched the one on the hard disk to be the same as on the floppy and
> >the editing keys returned.
> >
> >These editing features were not documented and have been removed from DOS
> >3.2  It seemed like a shame to me but I recently got a copy of CED, a
> >freeware command editor.  Having it is far better than having Ctrl-U and
> >Ctrl-W.  It gives command history and much more.  I suggest you get a copy.
> >It's really good.  You won't miss the editing keys.
> >
> >-Tom
> 
> Ridiculous!!!
> 
> Not only are the editing features available in DOS 3.20 (patch below), but
> I find it *extremely* hard to believe that the format program could just
> occasionally replace four different non-consecutive bytes of one of the system
> files with NOP's (which is what the difference between having Ctrl-U & Ctrl-W
> and not amounts to).
>
> [...]
>
> Brian Campbell

You say ridiculous.  I say yes it is.  Not that it is not true, however.
My statement was not based on conjecture.  It was based on measured
observation.  I am a programmer and it does seem terribly unlikely that a
bug like this would creep into a program but it seems to be the case.

My observation was that using the *same* IBM DOS disk, formatting different
hard disks created varying copies of the file called IBMDOS.COM.  (Either
that or IBMDOS.COM -- I don't remember which.)  I can't tell you why this
is.  I am not an adept disassembler of other people's code.  If I wrote a
format program, I think I would copy that system file over without
modifying it but I don't know what Microsoft or IBM intended to do.  I
am merely observing the end result.

Tom Reingold

This paragraph is necessary  because  my
postnews  program  does not permit me to
write *less* text than I  am  responding
to.   Isn't  that  clever?   Now you are
reading this superfluous paragraph as  a
result.




























































-- 
Tom Reingold;  The Rockefeller University; 1230 York Av; NY 10021
PHONE: (212) 570-7709 [office]; (212) 304-2504 [home]
ARPANET: reintom@rockefeller.arpa BITNET: REINTOM@ROCKVAX
UUCP: {seismo|ihnp4|yale|harvard|philabs|phri}!cmcl2!rna!rocky2!reintom

madd@bucsb.bu.edu.UUCP (02/06/87)

In article <267@skatter.UUCP> kuo@skatter.UUCP (Dr. Peter Kuo) writes:
>In article <307@cognos.UUCP>, brianc@cognos.UUCP (Brian Campbell) writes:
>> 
>>      I've got a question concerning some of the line editing provided by
>> MS-DOS/PC-DOS. 
>> 
>> [some text deleted]
>>
>>      Thanks.
>
>I have ctrl-u on my DOS 3.1 but not on the DOS 2.1 I was using before!

DOS 3.1 and 3.2 have ^U and ^W as they work in UNIX.  As dos progresses,
it seems to get more and more unix-like.  Nice to be able to switch systems
and have at least a couple of things stay the same!

If you really want good line editing, I recommend CED, which is public
domain (or maybe shareware -- I haven't had it installed on my system,
so I forget).  The only thing annoying about CED is that is does NOT
support ^U/^W deletes.  But since it DOS support the cursor keys, that's
fine.  Along with it's other features, it's a great program.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                   - Jim Frost * The Madd Hacker -
UUCP:  ..!harvard!bu-cs!bucsb!madd | ARPANET: madd@bucsb.bu.edu
CSNET: madd%bucsb@bu-cs            | BITNET:  cscc71c@bostonu
-------------------------------+---+------------------------------------
"Oh beer, oh beer." -- Me      |      [=(BEER) <- Bud the Beer (cheers!)

grunau_b@husc4.UUCP (02/06/87)

In article <725@bucsb.bu.edu.UUCP> madd@bucsb.bu.edu.UUCP (Jim "Jack" Frost) writes:
>In article <267@skatter.UUCP> kuo@skatter.UUCP (Dr. Peter Kuo) writes:
>>In article <307@cognos.UUCP>, brianc@cognos.UUCP (Brian Campbell) writes:
>>> 
>>>      I've got a question concerning some of the line editing provided by
>>> MS-DOS/PC-DOS. 
>>> 
>>> [some text deleted]
>>>
>>>      Thanks.
>>
>>I have ctrl-u on my DOS 3.1 but not on the DOS 2.1 I was using before!
>
>DOS 3.1 and 3.2 have ^U and ^W as they work in UNIX.
. . .
>domain (or maybe shareware -- I haven't had it installed on my system,
>so I forget).  The only thing annoying about CED is that is does NOT
>support ^U/^W deletes.  But since it DOS support the cursor keys, that's
>fine.  Along with it's other features, it's a great program.
>
. . .
>                   - Jim Frost * The Madd Hacker -
>UUCP:  ..!harvard!bu-cs!bucsb!madd | ARPANET: madd@bucsb.bu.edu
>CSNET: madd%bucsb@bu-cs            | BITNET:  cscc71c@bostonu
. . .

Anyway, at work we have a nice little terminate-and-stay-resident program
called dosedit, that implements a nice quasi-history feature much nicer than
IBM's hideous Function-key thing.  It allows you to use the up and down arrow
keys to step through all the commands you have done, and then re-execute or
edit them.  It also actually erases your line when you hit ESC instead of
printing a slash and line feed (shades of tty).  It uses ESC and control-left-
arrow and control-right-arrow for ^U and moving left/right one word.

									JJMG
grunau@husc4.UUCP

or

--- !seismo-----
		\
--- !rutgers----- !husc6!husc4!grunau
	    	/
--- !decvax!ihnp4

or

For BITNET, I believe the hostname is "harvard".