DOS edit.com crashes with error 4001h when launched in Terminal 1.8 #14206

Closed
opened 2026-01-31 04:03:47 +00:00 by claunia · 5 comments
Owner

Originally created by @metathinker on GitHub (Jun 11, 2021).

OK, this bug report is a bit silly - but after I saw that Terminal had Win32 console mouse support, I figured I just had to try my favorite basic editor. It even comes with Windows!

Windows Terminal version (or Windows build number)

1.8.1521.0 running on Windows 10.0.19042.985

Other Software

C:\Windows\System32\edit.com

Steps to reproduce

32-bit x86 build of Windows required.

  1. Start -> Run -> C:\Windows\System32\edit.com
  2. If prompted, follow the instructions to install "NTVDM".
  3. See the editor open. Hooray!
  4. Start Command Prompt or Windows PowerShell in Terminal.
  5. Run the same command: C:\Windows\System32\edit.com

Expected Behavior

Edit.com launches, and you can use Terminal's new mouse support to mouse around in it!

image

Actual Behavior

Edit.com doesn't start. Instead, you get this message:

image

---------------------------
16 bit MS-DOS Subsystem
---------------------------
NTVDM has encountered a System Error
NTVDM has encountered a System Error 4001h Choose 'Close' to terminate the application.
---------------------------
Close   Ignore   
---------------------------

If you click Close, "nothing" happens; the shell you used continues as if the program ran to completion without any output. If you click Ignore, then fun stuff happens - the shell continues, but it writes its prompt on top of the previous screen output, overwriting it.

Originally created by @metathinker on GitHub (Jun 11, 2021). OK, this bug report is a *bit* silly - but after I saw that Terminal had Win32 console mouse support, I figured I just _had_ to try my favorite basic editor. It even comes with Windows! ### Windows Terminal version (or Windows build number) 1.8.1521.0 running on Windows 10.0.19042.985 ### Other Software C:\Windows\System32\edit.com ### Steps to reproduce 32-bit x86 build of Windows required. 1. Start -> Run -> C:\Windows\System32\edit.com 2. If prompted, follow the instructions to install "NTVDM". 3. See the editor open. Hooray! 4. Start Command Prompt or Windows PowerShell in Terminal. 5. Run the same command: C:\Windows\System32\edit.com ### Expected Behavior Edit.com launches, and you can use Terminal's new mouse support to mouse around in it! ![image](https://user-images.githubusercontent.com/1039862/121632582-17b95a00-ca36-11eb-8f2c-b23e853a8ce9.png) ### Actual Behavior Edit.com doesn't start. Instead, you get this message: ![image](https://user-images.githubusercontent.com/1039862/121632090-35d28a80-ca35-11eb-9a09-5b374e5122bc.png) ``` --------------------------- 16 bit MS-DOS Subsystem --------------------------- NTVDM has encountered a System Error NTVDM has encountered a System Error 4001h Choose 'Close' to terminate the application. --------------------------- Close Ignore --------------------------- ``` If you click Close, "nothing" happens; the shell you used continues as if the program ran to completion without any output. If you click Ignore, then fun stuff happens - the shell continues, but it writes its prompt on top of the previous screen output, overwriting it.
claunia added the Resolution-By-DesignNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 04:03:47 +00:00
Author
Owner

@metathinker commented on GitHub (Jun 11, 2021):

Incidentally, I reported a similar problem with the older console window host in Feedback Hub: https://aka.ms/AAcwazk

I'm guessing the root cause is the same.

@metathinker commented on GitHub (Jun 11, 2021): Incidentally, I reported a similar problem with the older console window host in Feedback Hub: https://aka.ms/AAcwazk I'm guessing the root cause is the same.
Author
Owner

@DHowett commented on GitHub (Jun 11, 2021):

I know, I know. It would be really cool if we could run NTVDM applications in Terminal. Unfortunately, they require some things that were removed from the v2 console. The only correct way to run them is with the "legacy" v1 console host since it offers the pixel buffer and various other fun things the VDM's 16-bit emulator requires.

@DHowett commented on GitHub (Jun 11, 2021): I know, I know. It would be really cool if we could run NTVDM applications in Terminal. Unfortunately, they require some things that were removed from the v2 console. The only _correct_ way to run them is with the "legacy" v1 console host since it offers the pixel buffer and various other fun things the VDM's 16-bit emulator requires.
Author
Owner

@malxau commented on GitHub (Jun 12, 2021):

@metathinker I don't know how serious you are about edit.com being a "favorite" but I built a Win32 clone of the original DOS 5 edit: http://www.malsmith.net/edit/ (source at https://github.com/malxau/yori/tree/master/edit .) Being Win32 allows for a few enhancements over NTVDM - it can run at any terminal size without being limited to hardware video modes, for example.

@malxau commented on GitHub (Jun 12, 2021): @metathinker I don't know how serious you are about edit.com being a "favorite" but I built a Win32 clone of the original DOS 5 edit: http://www.malsmith.net/edit/ (source at https://github.com/malxau/yori/tree/master/edit .) Being Win32 allows for a few enhancements over NTVDM - it can run at any terminal size without being limited to hardware video modes, for example.
Author
Owner

@metathinker commented on GitHub (Jun 12, 2021):

@malxau Thanks for the pointer! Ironically I had yedit installed already (as part of Yori) but never realized I had it. I'm now trying it for the use case I was looking to fill with the DOS 5 editor. That is, when I run git commit from the command line, I want an editor that is friendlier than vi or Vim, but I don't want to switch to a GUI editor in a different window because I think it looks visually jarring.

@metathinker commented on GitHub (Jun 12, 2021): @malxau Thanks for the pointer! Ironically I had yedit installed already (as part of Yori) but never realized I had it. I'm now trying it for the use case I was looking to fill with the DOS 5 editor. That is, when I run `git commit` from the command line, I want an editor that is friendlier than vi or Vim, but I don't want to switch to a GUI editor in a different window because I think it looks visually jarring.
Author
Owner

@orcmid commented on GitHub (Jun 12, 2021):

..., when I run git commit from the command line, I want an editor that is friendlier than vi or Vim, but I don't want to switch to a GUI editor in a different window because I think it looks visually jarring.

I don't understand how edit.com being launched is less jarring, even if it appears to be in the same window. I use the GitHub desktop application for most of my commits, so I don't have that particular issue. I haven't bothered to figure out doing that from inside Visual Studio Code.

I do think being able to created DOS-style CUA apps using the WT VT option is very cool That and the support for Unicode is exciting [;<), whether or not Win16 .com emulation works.

Side question: what is it about an editor that lets a git command-line take a commit message from it?

@orcmid commented on GitHub (Jun 12, 2021): > ..., when I run `git commit` from the command line, I want an editor that is friendlier than vi or Vim, but I don't want to switch to a GUI editor in a different window because I think it looks visually jarring. I don't understand how `edit.com` being launched is less jarring, even if it appears to be in the same window. I use the GitHub desktop application for most of my commits, so I don't have that particular issue. I haven't bothered to figure out doing that from inside Visual Studio Code. I do think being able to created DOS-style CUA apps using the WT VT option is very cool That and the support for Unicode is exciting [;<), whether or not Win16 `.com` emulation works. Side question: what is it about an editor that lets a git command-line take a commit message from it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14206