(This is a guest post by Antoni Sawicki aka Tenox)
In a recent blog post Wanted: Console Text Editor for Windows I lamented about lack of a good console/cmd/PowerShell text editor for Windows. When researching for the article I made rather interesting discovery. There in a fact has been a native Windows, 32bit, console based text editor. It was available since earliest days of NT or even before. But let’s start from…
…in the beginning there was Z editor. Developed by Steve Wood for TOPS-20 operating system in 1981. Some time after that, Steve sold the source code to Microsoft, which was then ported to MS-DOS by Mark Zbikowski (aka the MZ guy) to become the M editor.
The DOS-based M editor was included and sold as part of Microsoft C 5.1 (March 1988), together with the OS/2 variant, the MEP editor (perhaps M Editor Protected-mode). The official name of M/MEP was simply Microsoft Editor. The same editor was also available earlier (mid-1987) as part of the MS OS/2 SDK under a different name: SDKED. Note that normally SDKED insists in operating in full screen mode. Michal Necasek generously spent his time and patched it up so that it can be run in windowed mode for your viewing pleasure.
However my primary interest lies with Windows NT. The NT Design Workbook mentions that in the early days a self-hosting developer workstation included compiler, some command line tools and a text editor – MEP. Leaked Windows NT builds sometimes include IDW, Internal Development Workstation, which also seem to contain a variant of the same editor. In fact some these tools including MEP.EXE
can be found on Windows NT pre-release CD-ROMs (late 1991) under MSTOOLS. It was available for both MIPS and 386 as a Win32 native console based application.
The editor was later also available for Alpha, i386, MIPS, and PowerPC processors on various official Windows NT SDKs from 3.1 to 4.0. It survived up to July 2000 to be last included in Windows 2000 Platform SDK.
The Win32 version of MEP also comes with an icon and a file description which calls it M Editor in NT 3.1 SDK and later Microsoft Extensible Editor.
From time perspective, it was rather unfortunate that this gem was buried in the SDK rather than being included on Windows NT release media. However I can understand that the editor wasn’t very user friendly or intuitive, compared to say edit.com
from MS-DOS. It came from a different era and similar to VI or Emacs, didn’t have “PC user friendly” key bindings or menus.
But that’s not the end of the story. The editor of many names survives to this day, at least unofficially. If you dig hard enough you can find it on OpenNT 4.5 build. For convenience, this and other builds including DOS M, OS/2 MEP and SDKED, NT SDK MEP can be downloaded here.
Digging through the archive I found not one but two copies of the editor code, lurking in the source tree. One under the name MEP inside \private\utils\mep\
folder and a second copy under name Z (which was the original editor for TOPS) in \private\sdktools\z
folder. MEP was included in Platform SDK, while Z was only available as part of IDW.
Doing a few diffs I was able to get some insight on the differences. Looks like MEP was initially ported from OS/2 to NT and bears some signs of being an OS/2 app. The Z editor on the other hand is a few years newer and has many improvements and bug fixes over MEP. It also uses some specific NT only features.
Sadly the internal Z editor was never released anywhere outside of Redmond. All the versions outlined so far had copyrights only up to 1990, while Z clearly has copyright from 1995. Being a few years newer and more native to NT I wanted to see if a build could be made. With some effort I was able to separate it from the original source tree and compile stand alone. Being a pretty clean source code I was able to compile it for all NT hardware platforms, including x64, which runs comfortably on Windows 10. You can download Z editor for Windows here.
But how do you even use this thing?
Platform SDK contains pretty solid documentation in tools.chm.
Here is a handy cheat sheet:
Last but not least there is a modern open source re-implementation of Z editor named K editor. It’s written from scratch in C++ and LUA and has nothing to do with the original MEP source code. K is built only for x64 using Mingw. There are no ready to run binaries so I made a fork and build.
The author Kevin Goodwin has kindly included copies of original documentation if you actually want to learn how to use this editor.
I know the OpenNT stuff was is likely from the leaked NT4 code from the early 2000s, but wow is there some neat stuff in there. Particularly around the OS/2 subsystem. The docs and code suggest the 2.0 32 bit stuff was completed (and even working on MIPS) and the 1.3 support that was shipped an after thought. The plan was to allow 32-bit OS/2 apps to run side by side with the Win32 apps (I couldn’t tell if that was implemented or not), rather than the dodgy presentation manager that ran its own VGA driver.
I wonder if theres enough there to compile back in the OS/2 2.0 support…
MS-OS/2 2.0 was a quite different beast from released the IBM OS/2 2.0 (and it is not binary compatible with it); Windows NT OS/2 added some restrictions, e.g. banning mixed 16-32 bit executables. Even assuming it were feasible, what would it be useful for?
It would still multitask MS-DOS pretty well, which honestly was the best feature of OS/2 2.x
At this point it’s more historical interest in how far along it was, how usable it was..
Looking at the football/pigskin OS/2 1.0 betas from 1987 that could multitask MS-DOS, clearly the capability and framework really was in place from the start, but was suppressed by the elephant in the room who wanted to deliver on the 286, and saw 32bit desktops as a threat to their mid-range market.. although rightfully so.
I was refering to the “MS-OS/2 2.0” subsystem code in OpenNT.
I did not know their early version of Microsoft Editor. This version earlier than Microsoft Editor from MS-DOS 5.00.224 Beta release in June 1990.
Do you have a sample copy of TOOLS.INI for the Z editor?
There’s a simple tools.ini in the SDK. Unfortunately it looks like MEP is infinitely flexible so the bundled .INI file doesn’t really do justice to what it can do.
https://archive.org/download/Microsoft_Developer_Network_Developer_Platform_Disk_2_of_3_Win32_SDK_1995/Microsoft%20Developer%20Network%20Developer%20Platform%20Disk%202%20of%203%20%28Win32%20SDK%29%20%281995%29.ISO/WIN32SDK%2FMSTOOLS%2FINIT%2FTOOLS.INI
I found two different tools.ini for mep and z, the one for z also includes [mep] section inside
Thanks – I figured out what I was doing wrong – the manual says to use [Z] in tools.ini as the header – that only works if the binary is named Z.exe. I renamed the binary so then tools didn’t work. Once I realized my mistake, everything was fine with one BIG exception:
If I enter a F-key that is not defined, Z freezes – it says to enter any key to continue, but that fails completely. Try entering F5 and see what happens.
I am using the 32-bit version of Z (z-x86.exe) posted on GitHub and O/S Windows 10 32 bit…Any ideas here? Maybe I should switch to the SDK 2000 version?
turns out mep-x86.exe works fine…It doesn’t freeze when an unrecognized Fkey is pressed like z-x86 does…Just thought I would add this…
I just installed Watcom 10.6 on a machine, and sure enough MEP from 7/11/1995 is included. It’s tagged version 3.51.1016.1 which means it’s from the NT 3.51 SDK.
So yeah Watcom put it on their CD-ROM’s!
I might have missed it in the links, but I think Neozeed has a slightly newer version of the documentation for M/MEP/Z in his gopher site than the documentation I saw in this page…
gopher://gopher.superglobalmegacorp.com:70/00/mspl/common/msedit
the MSPL I have on there was from version 1.3, which I put onto archive.org.
I need to dump the 1.1 that is floating around, as it has Windows 2.0 API stuff!
I believe the rest of the CD is the same, but diff is the best way to tell.