11 ms·
Edit is now open source
- QuiCasseRien 1y ago[flagged]
- free_bip 1y agoWhat's wrong with a terminal app being written in Rust?
- lblume 1y agoI can see why people don't like to write Rust. It is more tedious, harder because of the ownership model, and has a very steep learning curve. What I don't get is what people have against programs written in Rust from the bottom up. They are safer to use, introduce far fewer vulnerabilities, and you can even locally reason about the code much better than in typical 'unsafe' languages like C++.
- teddyh 1y agoThe non-stable ABI, forcing all-statically linked binaries, is also a thing.
- tadfisher 1y agoWhich has next to zero impact on Windows applications, which ship their own DLLs anyway (besides stuff like DirectX).
- eikenberry 1y agoIt seems like your first paragraph answers the question in the second. If it is harder to use and learn then that reduces the value of free software released using it as that software is then harder to modify, fix, contribute to, etc. The tradeoff for Rust being hard should be more security and fewer bugs. The additional cost here, and the one that the OP is probably annoyed with, is that it moves away from the languages/platforms that MS has traditionally used and that developers who work on that platform expect.
- koakuma-chan 1y agoIs Rust harder than C++?
- npalli 1y agoYes.
- Guekka 1y agoThat answer lacks some nuance Yes, it is harder to get a Rust program to compile. But it also is easier to accomplish the desired task safely
- eikenberry 1y agoIf the OP already knows C++ then it would obviously be harder for them. Given the nature of their post, this was my interpretation.
- haiku2077 1y agoIt's harder to do simple things and easier to do complicated things.
- amenhotep 1y agoNo.
- 90s_dev 1y ago> and you can even locally reason about the code much better than in typical 'unsafe' languages like C++. Do you have an example of this? I'm just a TypeScript guy who never had a fair chance to use C++ or Rust for long, so I'd be curious how what you say is true.
- lblume 1y agoOne of the strongest example for me is newtypes. I strongly believe in Parse, don't validate (https://news.ycombinator.com/item?id=21476261 https://news.ycombinator.com/item?id=21476261) and think Rust's newtype pattern is able to really enforce this strongly. When writing a Rust program, I can often basically express it as a single value (the input) being sequentially converted in type. The typestates, if you choose this name, allow great compile-time verification of most desired properties. You are really forced to describe the way the core logic flows in a modular way. However this is just one and likely not even the most prominent aspect making Rust so great. Local reasoning also becomes easier via explicit opt-in mutability, and function signatures always being the only relevant source of truth when regarding their compile-time evaluatability (especially compared to C++ templates). No accessing uninitialized memory, a very simple implied notion of a constructor as merely a method without a self parameter, soundness of all received types, likely much more...
- sedatk 1y ago> Why Why Why? Less memory overhead and no runtime dependencies?
- arghwhat 1y agoYay for finally having a default text editor that works over ssh. Managing windows servers over ssh is a bit of a pain without. They could just have packaged nano, but oh well.
- 6c696e7578 1y agoI am truly behind the times. I didn't know you can ssh into a Windows system.
- e12e 1y agoSince windows 10/windows server 2019 afaik. https://news.ycombinator.com/item?id=15904265 https://news.ycombinator.com/item?id=15904265
- 6c696e7578 1y agoThanks! It always bugged me that Windows didn't have a sshd, since it's so popular outside of Windows. I thought the reason for it not being added would be admitting a failure somewhere - RDP not winning or something. Seemed odd to prevent a way into Windows Server.
- JdeBP 1y agoNo. It was a fundamental conceptual difference in the operating system. After Xenix, Microsoft did not use a terminal paradigm in its operating systems. They all had a "console" paradigm, where instead directly attached VDUs, keyboards, and mice had explicit API support as first-class devices. Because they targetted "personal computers" where one knew from the firmware up that the machine had a VDU, a keyboard, and (possibly) a mouse. * https://jdebp.uk/FGA/tui-console-and-terminal-paradigms.html https://jdebp.uk/FGA/tui-console-and-terminal-paradigms.html For a long time, so long that I had a widely used 2 decades old Frequently Given Answer about it, Windows NT had no way to capture console I/O, no way of waiting on consoles for buffer changes and to inject back-end input events. No way to do what a SSH server would need to do in order to capture and send/receive that I/O over a network. Then along came Windows Terminal, and I finally got to change the answer in 2018. * https://jdebp.uk/FGA/capture-console-win32.html https://jdebp.uk/FGA/capture-console-win32.html
- andrewstuart 1y agoEdit for DOS was my favorite editor. All the keys worked as you expect. You could select text with shift. It had find and a replace. That’s a lot more than most editors give you without config fiddling and arcane key commands. Those simple things get almost everything I need for operating system maintenance. Edit was the pure distilled essence of an editor. It was a work of art really.
- sedatk 1y agoIt was okay when it came out because the alternative was EDLIN (DOS version of ed). But IIRC, it had a 64KB file size limitation which was a problem.
- JdeBP 1y agoIt came out with MS-DOS 5, and by that time there were loads of alternatives already available. There were ports of Unix and Big Iron editor programs. There were loads of native PC text editors, too. SemWare's QEdit had been around since 1985, for example. DR-DOS had had EDITOR for a while, which might indeed have spurred Microsoft into action. Boxer was a contemporary with MS-DOS EDIT, but that name was a pun on the name of an earlier widespread DOS text editor named Brief, also around for years before EDIT came along.
- mixmastamyk 1y agoWhat happened to shipping yedit? From the yori project, which I recommend to everyone on windows. Why wait when it has been available for years? (Someone mentioned ssh, which leads me to believe this one is using ansi instead of the console API.)
- tored 1y agoOh nice! Can't wait to replace nano. Plugin support in lua?
- 90s_dev 1y agoI hope someone adds typed Lua support and sends a PR!
- trinix912 1y agoI wonder what prevented them from porting the ms-dos EDIT.COM to 64bit Windows back then. There's still EDLIN.COM in the 32bit version.
- tadfisher 1y agoThey canceled the 64-bit port of NTVDM (virtual DOS machine), which is what handles all those INT 21h syscalls from DOS applications. Without that, there's honestly not much to port, and it's easier to just make a new NT-native CLI app.
- 90s_dev 1y agoDid they cancel it because dosbox exists? If so, that's smart.
- kmeisthax 1y agoMost likely because Microsoft didn't consider it a valuable use of engineering time in general. AMD's 64-bit extensions explicitly forbade dropping to 16-bit code. Once you enter 64-bit mode you lose access to all the modes which NTVDM needs to run MS-DOS or 3.x apps. AFAIK the virtualization extensions added in 64-bit (known as VT-x etc) do allow 16-bit code, but that would require rebuilding NTVDM as a Hyper-V client (ala WSL2) instead of using 32-bit protected mode as a way to virtualize 16-bit code. However, these extensions didn't exist until way later and they didn't get support for booting 16-bit guests until later than that. You could software emulate x86 to do NTVDM stuff. In fact, there's a FOSS program that does this, called WineVDM[0]. The MIPS/Alpha/PPC ports of NT used software emulation in NTVDM, so it is feasible. [0] https://github.com/otya128/winevdm https://github.com/otya128/winevdm Interestingly, they also recommend using DOSBox for DOS apps.
- EvanAnderson 1y agoNTVDM has been unofficially built for x64[0] and it works (or rather, worked until MSFT started ripping-out USER32 APIs that are necessary for running Win16 apps). [0] https://github.com/leecher1337/ntvdmx64 https://github.com/leecher1337/ntvdmx64
- 90s_dev 1y agoInteresting how we always go in circles. edit.cmd was one of the first programs I ever used. Now it's back rewritten as a Windows 10+ program in Rust? Yet it looks and works just the same as 30 years ago!
- nichos 1y agoYou probably mean edit.com, which is what I thought of when I saw this post. https://en.m.wikipedia.org/wiki/MS-DOS_Editor https://en.m.wikipedia.org/wiki/MS-DOS_Editor
- MonkeyClub 1y agoAnd it is, according to their GH page, an homage to EDIT.COM.
- computatrum 1y agoIt not only written in Rust, but they avoid basically any dependencies to third-party crates (beside the obligatory windows-sys/libc), optimizing probably for binary size. To achieve this, they seem to re-implement considerable parts of the rust ecosystem (own TUI library implementation, own unicode handling, own arena implementation, ...).
- 01HNNWZ0MV43FF 1y agoI'd say the windows crate is even technically first-party since the OS vendor publishes it
- porcoda 1y agoI’m guessing this isn’t just to optimize for binary size. If you have the resources to avoid third party dependencies you eliminate the burden of having to build a trust case for the third party supply chain. That is the number one reason we sometimes reimplement things instead of using third party packages where I work: the risk from dependencies along with the effort required to establish that we can trust them is sometimes (not always) greater than just replacing it in house.
- criddell 1y agoMicrosoft has recently said AI writes 30% of their code. Reimplementing things isn’t as expensive as it once was.
- deleted 1y ago[deleted]
- dymk 1y agoMaybe a tenth the total cost is getting the code into the terminal, the other nine tenths is maintaining way more code than you'd otherwise have to.
- ItsHarper 1y agoThat was absolutely not what was said. The way it was phrased indicates it only applies to a subset of projects, plus there were weasel words to indicate that maybe it's not actually quite that high, plus AI was not explicitly mentioned and it easily could include a lot of traditionally-generated code.
- GuinansEyebrows 1y agocute. extremely NIH in a field with many existing options, but very cute :)
- dbuxton 1y agoI can't wait for the Rust port of QBasic Gorillas
- red_admiral 1y agoThis is a denial-of-service attack on my productivity :) I fondly remember the times of editing the explosion radius to "tactical nuclear banana".
- Ericson2314 1y agoWill the old one from DOS be replaced entirely with this?
- fredoralive 1y ago64 bit Windows, the only sort now with W11, doesn’t have MS-DOS support, so doesn’t have the old edit to start with.
- Ericson2314 1y agoDidn't know 32-bit Windows was completely gone.
- JdeBP 1y agoIt's not even that 32-bit Windows is gone. It's that NTVDM is (years ago) gone. See discussion elsewhere on this very page.
- fredoralive 1y agoAFAIK all 32-bit x86 versions of Windows 10 have NTVDM as an option, it's the dropping of 32-bit kernel Windows with Windows 11 that finally killed it.
- mixmastamyk 1y agoDOS was extended to 16-bit. ;-)
- massysett 1y agoNitpick - this is a text user oriented (TUI) or a screen editor, not a CLI editor. A CLI editor is ed(1), or ex(1), or EDLIN for MS-DOS lineage.
- croes 1y agoAnd again a case of bad naming from MS because it’s too basic to be distinguishable.
- JdeBP 1y agoDistinguishable from the tool of that name, that came with the operating system (and prior Microsoft ones) for many years, that it is deliberately intended to provide a rough workalike 64-bit replacement for?
- croes 1y agoIf it’s not the same then it’s a bad idea to give it the same name. Imagine searching for a tutorial or a bug fix.
- JdeBP 1y agoOne would be in nothing more than the very same situation, which apparently has been problematic in your way for pretty much no-one, of Microsoft's various different programs all named CHKDSK. There have been at least 3, one of which we were told for years was superseded, which was not true for the next two, and the third of which has had four different flavours in the past 30 years. Or command names that are common words like MORE, BREAK, DATE, CALL, IF, MODE, MOVE, PROMPT, SORT, TIME, COPY, and PATH for that matter. What you are telling us is that the only way that you can think of to look this stuff up is by putting single words into a general-purpose WWW search engine. Instead of the intelligent way of finding the index of a command reference for Microsoft operating systems and looking up the EDIT command there. Microsoft has published its own command reference for decades, and there have been many others, including entire books on commands in Microsoft operating systems, for even longer.
- croes 1y ago>What you are telling us is that the only way that you can think of to look this stuff up is by putting single words into a general-purpose WWW search engine. Like most people do. >Or command names that are common words like MORE, BREAK, DATE, CALL, IF, MODE, MOVE, PROMPT, SORT, TIME, COPY, and PATH for that matter. Same problem >Microsoft has published its own command reference for decades And changes the URLs to that references multiple time. More than one old links lead to nowhere now >including entire books on commands in Microsoft operating systems, for even longer. Books with a hefty price tag
- lhecker 1y agoHey all! I made this! I really hope you like it and if you don't, please open an issue: https://github.com/microsoft/edit https://github.com/microsoft/edit To respond to some of the questions or those parts I personally find interesting: The custom TUI library is so that I can write a plugin model around a C ABI. Existing TUI frameworks that I found and were popular usually didn't map well to plain C. Others were just too large. The arena allocator exists primarily because building trees in Rust is quite annoying otherwise. It doesn't use bumpalo, because I took quite the liking to "scratch arenas" (https://nullprogram.com/blog/2023/09/27/ https://nullprogram.com/blog/2023/09/27/) and it's really not that difficult to write such an allocator. Regarding the choice of Rust, I actually wrote the prototype in C, C++, Zig, and Rust! Out of these 4 I personally liked Zig the most, followed by C, Rust, and C++ in that order. Since Zig is not internally supported at Microsoft just yet (chain of trust, etc.), I continued writing it in C, but after a while I became quite annoyed by the lack of features that I came to like about Zig. So, I ported it to Rust over a few days, as it is internally supported and really not all that bad either. The reason I didn't like Rust so much is because of the rather weak allocator support and how difficult building trees was. I also found the lack of cursors for linked lists in stable Rust rather irritating if I'm honest. But I would say that I enjoyed it overall. We decided against nano, kilo, micro, yori, and others for various reasons. What we wanted was a small binary so we can ship it with all variants of Windows without extra justifications for the added binary size. It also needed to have decent Unicode support. It should've also been one built around VT output as opposed to Console APIs to allow for seamless integration with SSH. Lastly, first class support for Windows was obviously also quite important. I think out of the listed editors, micro was probably the one we wanted to use the most, but... it's just too large. I proposed building our own editor and while it took me roughly twice as long as I had planned, it was still only about 4 months (and a bit for prototyping last year). As GuinansEyebrows put it, it's definitely quite a bit of "NIH" in the project, but I also spent all of my weekends on it and I think all of Christmas, simply because I had fun working on it. So, why not have fun learning something new, writing most things myself? I definitely learned tons working on this, which I can now use in other projects as well. If you have any questions, let me know!
- steveklabnik 1y agoI’d love to hear about the use of nightly features. I haven’t had time to dig into the usage, but that was something I was surprised by!
- zerr 1y agoIs there anything in EDIT.EXE for MS-DOS that inherently hinders porting to x64? I wish they have implemented the same color theme as well.
- JdeBP 1y agoThere is no EDIT.EXE. If you have an EDIT.EXE you probably need to check for malware. (-: It was EDIT.COM, and in the days of long ago that was just a way of invoking QBASIC with the /EDIT command-line option. At which point the project becomes one of porting an old MS-DOS full programming IDE to 64-bit Windows, just for its text editor part. Also, much of MS-DOS was written in 16-bit 8086 assembly language; so porting MS-DOS programs is not a mere matter of compiling a high level language with a compiler that targets the new platform and processor architecture and tweaking whatever breaks.
- zerr 1y agoSure about that? So in 32bit Windows where we still have EDIT, do we also have QBASIC?
- nikbackm 1y agoWho knows? Can't imagine anyone here using 32bit Windows and limiting themselves to 4GB of RAM. Are there even any cheap laptops sold with that little nowadays?
- JdeBP 1y agoYes. In those days of long ago, I saw the .COM extension with my own eyes and ran QBASIC /EDIT directly just for kicks. Once upon a time, this knowledge was one of those non-secret secrets that made it onto the letters pages of the computer magazines and into every "MS-DOS secrets" book out there. (-: And yes, Windows NT 4 had the MS-DOS QBASIC.
- zerr 1y agoOn well, now I have to roll out a 32bit Win7 vm to confirm this :)
- bitbasher 1y agoIt's 2025 and Windows got what *nix got in the 1970s. Better late than never!
- JdeBP 1y agoThe ironic thing is that people said the same as you just did when EDIT originally came along in the 1990s. DR-DOS had had EDITOR for a while, and there was also a healthy shareware trade in DOS text editors, including even some DOS ports of Stevie. It was late then. But the computer magazines fawned over it.
- TZubiri 1y agoVery nice, I'll unironically add it to my repertoire of main code editing tools: nano and notepad. Notepad had recently become infected with ai features and logins and tabs which I just hate, win some lose some ig
- Bilal_io 1y agoWhy didn't they make this a package available ia winget? Did it have to be part of the OS?
- mixmastamyk 1y agoYes, one use case is crash recovery.
- agrmohit 1y agoIt is available via winget https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/Microsoft/Edit https://github.com/microsoft/winget-pkgs/tree/master/manifes... Could be installed with winget install Microsoft.Edit
- Bilal_io 1y agoThank you. I looked and failed to find it in the Edit repo
- andyferris 1y agoI have to say, I really miss MS-DOS TUI apps like edit, the qbasic editor, and xtree-gold. The linux-terminal based ones just seem a bit off in comparison. Maybe it's mouse and keyboard support in terminals (shift-enter support, anyone?) aren't great? People have different aesthetics? I don't know... Next stop: VS-EDIT would be pretty cool :) (This with LSPs)
- JdeBP 1y agoIt's definitely for that reason. It is amazingly hard to portably do something as trivial in the DOS world as recognize [Shift]+[Ins]. The terminal paradigm is very different to the console paradigm in some areas. In the days when a Tektronix terminal was a real physical thing that one sat in front of, the TUIs that one used didn't look at all like the ones in the contemporary personal computer world. Ironically, an old Tektronix or DEC VT user transported into the future would be very at ease with what you get in the Linux-based operating system world today. All that said, the Windows Terminal people have worked pretty hard to get even some of the obscure ECMA-48, ITU T-416, DEC VT, and XTerm stuff into Windows Terminal, so at least TUI applications writers who are prepared to write all of the bizarre hooplah to have things like recognition of [Control]+[Home] and correctly operating reverse video, actually will get them.
- deleted 1y ago[deleted]
- int_19h 1y agoDOS was the golden age for TUI apps because its ultimate API was both simple and powerful: direct video memory access in text mode. So you just get a linear chunk of memory where each character on screen corresponds to two bytes: one for the glyph, one for foreground/background color (4 bits each). For input you had some BIOS helper interrupts, but then again it was easy enough to read scancodes directly (and they were standardized on PC). So you can handle any key or key combo however you want, and you can put any characters anywhere you want without weird corner cases like autoscrolling.
- mayli 1y agoPretty cool, at least much more user friendly and doesn't lag when opening large files. And more features than notepad.
- thaumasiotes 1y agoWeird choice of name for their new software, given there is already a pretty prominent editor from Microsoft named "edit". https://en.wikipedia.org/wiki/MS-DOS_Editor https://en.wikipedia.org/wiki/MS-DOS_Editor They seem to have given it the same name because they want to preserve the command. But the headline is... misleading.
- DangitBobby 1y agoI love that it has a toolbar with shortcut keys highlighted at the top. I wish more TUI programs had that, especially vim!
- jerrygenser 1y agoZellij is a good example of a tui with shortcuts in the UI. Helped me learn them way better than I would have otherwise
- Sammi 1y agoYes! GUI menus with keyboard shortcuts written on the menu items are a great way to explore and learn new software.
- eviks 1y ago> While it is relatively simple to learn the magic exit incantation, it’s certainly not a coincidence that this often turns up as a stumbling block for new and old programmers. What’s even simpler is changing the awful defaults and adding the menu to make this a non-issue at a tiny fraction of the time it would take to write a new editor. > we decided that we wanted a modeless editor for Windows (versus a modal editor where new users would have to remember different modes of operation and how to switch between them) New users could do everything in insert mode with the power of modes always in the background. Also you don’t need to remember how to switch as you can just show those key binds in either your menu or status bar if you think it’s very important, there is plenty of space looking at the screenshots Such a wasted opportunity to use something powerful and extensible for rather flimsy reasons
- int_19h 1y agoNew users accidentally end up in the wrong mode because they press the wrong key, and then get stuck because they don't know what a "mode" is. There's really no reason for a basic lightweight text editor to have modes. If you as a power user want one, Vim can be installed as needed.
- eviks 1y ago> they press the wrong key No they wouldn't, if you believe there are so many terminal editor users that can't be taught what modes are, you simply guard it via settings so that unless you enable it explicitly you can't press the wrong key > There's really no reason for a basic lightweight text editor to have modes There is - having the power in every single Windows installation, including all the VMs and other people's machines.
- pwdisswordfishz 1y agoAnd here I was hoping for the original MS-DOS Editor of Windows 95.
- JdeBP 1y agoI have, as they say in the theatre, notes. Lots of notes. Possibly beginning with a request to stop calling these "VT" sequences. Quite a lot of this wouldn't work on an actual DEC Video Terminal. One of the questions I haven't yet answered from research is whether it supports [Control]+[P]. That's another of the non-secret secrets of the original EDIT.
- pwdisswordfishz 1y ago> Possibly beginning with a request to stop calling these "VT" sequences. Quite a lot of this wouldn't work on an actual DEC Video Terminal. That is incredibly pedantic even by your standards.
- JdeBP 1y agoAnd that is a personal attack, which I'm sure Thomas Dickey would not appreciate being the target of, since this is M. Dickey's oft-made point. Read https://invisible-island.net/ncurses/ncurses.faq.html#vt100_color https://invisible-island.net/ncurses/ncurses.faq.html#vt100_... and learn.
- precompute 1y ago"Edit". Really? Was that the only name available? I am sick of these companies repurposing very common computing terms for their mediocre products.
- int_19h 1y ago"edit" has historically been the command used to invoke the built-in editor in Microsoft operating systems since DOS 5.0. Why should it suddenly change?
- precompute 1y agoThat's irrelevant. That was a command and a program and this is a product.
- MonkeyClub 1y agoThe new Microsoft Edit is good. It's not as good as EDIT.COM, but it gets the job done. A couple of peeves: it lacks word count (which would be very useful), and there is no way to escape to shell (which would render it more usable for light scripting tasks). I don't mind it too much, but I dislike how it hijacks the selected terminal font in Windows Terminal, how you can't hit Esc to close the menus in a Linux terminal, and how not all functions can be accessed using the keyboard with direct shortcuts. For example, to change which file you're editing, you have to select View > Focus Statusbar, press the left arrow, hit Enter to select the list of edited files, select the file you want to switch to, and press enter. I wonder why there's no shortcut for that, which would be a common use case. For a side project, it's very nice all around. If these issues were to be fixed, it would be a perfectly adequate editor. Then the only feature missing would be an embedded Lisp interpreter used for automation and extensibility. :) Edit: It has no telemetry, right?
- ladyanita22 1y agoWhy is it not as good as EDIT.COM?
- brohim 1y agodoes it support vim motions?