Menu

#366 Incompatibility bug in FreeDOS EDIT.EXE compared to EDIT.EXE from MS-DOS

freedos20
open
nobody
None
5
2022-08-19
2022-08-01
Oliver
No

Create a TXT File with 2 lines without pressing return at the end of the second line:

TEST1
TEST2

The TXT file must have the following HEX Code (when opened with a HEX Editor):

54 45 53 54 31 0D 0A 54 45 53 54 32

Save the file and close the Editor. This is an important step, do not forget it, even if you think it doesn't make much sense to end an editor and restart it again! It this case it does make sense.

Now open the file with EDIT.EXE from FreeDOS.
When you now try to press the Cursor DOWN key 2 times, then the cursor stays
at the position of the 'T' of the second TEST2 entry. The cursor does not move to the third line.
In EDIT.EXE from MS-DOS 6.2 and every other modern editor this behavior is different.
When you press the Cursor DOWN key 2 times in EDIT.EXE from MS-DOS, than the cursor
will reach the next line, below the word TEST2.

This is an important usability behavior, because it makes adding new entries much easier.
It allows you to start writing new lines without moving the cursor to the end of the last line and pressing the return key.
So this should get fixed.

But there is another bug.
If you try to work around that bug in EDIT.EXE from FreeDOS by moving the cursor with the Cursor RIGHT key to the right in the line with the word TEST2 to press the return key at the end or to add another character at the end of the line, the cursor stays at the 2. You can't add a new character after the 2 without overwriting the 2.
This is the second wrong behavior of EDIT.EXE from FreeDOS.

In EDIT.EXE from MS-DOS you can move the cursor with the cursor RIGHT key after the TEST2 word an unlimited amount of character blanks, while this is also not the best behavior of an editor, it does at least make adding new entries in the same line easier.
The correct behavior or the correct way to implement this, is to allow the cursor to move at least ONE character further than the last character in the line, Thus the cursors ends in our example behind the 2 of the word TEST2.

This allows the user to add new characters without overwriting the last character.
It also allows the user to press the RETURN key to move the cursor to the next line without moving the last character into the next line.
This kind of behavior is implemented that way in every modern editor you can find. In FreeDOS the editors FED and PICO do it that way. In DR DOS the editor EDITOR.EXE does it that way too.

Discussion

  • Robert Riebisch

    Robert Riebisch - 2022-08-09

    The cursor does not move to the third line, because there is no third line in your test text file.

    "You can't add a new character after the 2 without overwriting the 2."
    -> I can add new characters or CR here in FreeDOS Edit 0.9a from FreeDOS 1.3.

     
  • Robert Riebisch

    Robert Riebisch - 2022-08-19

    Every modern editor, including the old MS-DOS EDIT.EXE can move into the third line because they use some sort of virtual third line, even if there is no real third line.
    And's that my bug report is about, besides the other issue.

    You're right. It is a compatibility bug, because it differs from the behavior of MS-DOS EDIT.

    "I can add new characters or CR here in FreeDOS Edit 0.9a from FreeDOS 1.3."
    No, you can't. You will overwrite the 2 or you will put a char between the 2 and the the 't'.

    You're right again. I didn't follow your guide. This time I created the test file using DEBUG. :-D

     
    👍
    1
  • Jim Hall

    Jim Hall - 2022-08-09

    I am confused by this bug report. FED does not operate exactly like EDIT, but also edlin and vi and emacs do not operate like EDIT either. Every editor is slightly different. FED is a programmer's editor so it lets you create a file without a trailing newline if the programmer needs that. So that's as designed.

    I created a new test file like you suggested. My file was:

    Hello
    World

    (no newline after "world")

    I saved this and opened it with FreeDOS EDIT. It's a text file, so I could open it. As you described, if I used the Down key on the keyboard to go the start of "World" and used the Right key to move the cursor over, I can only put it on on the "d" at the end of "World" .. and to me, that's expected behavior because there is nothing after "d" in "World". But if I press the End key, the cursor jumps after the "d" and I can add new text there.

    I can replicated the behavior you describe, but I don't think it is a "bug."

     
  • Robert Riebisch

    Robert Riebisch - 2022-08-19

    It's a bug, when EDIT.EXE from FreeDOS should behave the same as EDIT.EXE from MS-DOS.

    Exactly.

     

Log in to post a comment.