Notepad To Support Unix Line Endings

Notepad is one of the classic Windows apps that Microsoft updates rarely. The last time it was updated was with Windows 2000, almost 20 years ago, with the ability to use hotkeys and Unicode support. Now, in Windows 10 Build 17661, Microsoft has made one silent improvement to the app. It now recognizes Unix line endings.

Account Info In NotepadIn Unix/Linux, line endings are quite different from what Windows uses.
In Windows, there are two symbols used for that purpose: char(10), known as the Carriage Return (CR), and char(13), known as Line Feed (LF). Linux uses only LF for line endings.

For years, Notepad supported only the CRLF scheme, making it impossible to read and edit Linux text files. Probably, thanks to integration of Windows Subsystem for Linux, Notepad in Windows 10 build 17661 can recognize Linux line endings.

The edit control used in Notepad now accepts new window messages. The sample code looks as follows:

SendMessageW(hwndEdit, 0x150A, 3, WindowsOnlyEOL ? 0 : 3);
SendMessageW(hwndEdit, 0x150A, 4, PasteOriginalEOL ? 0 : 4);

So, if you are a WSL user, soon you'll be able to edit its configuration and other files right in Notepad without issues. Also, this change is great for all dual-boot users.

Source: WalkingCat

3 thoughts on “Notepad To Support Unix Line Endings

  1. the curious

    That’s great news. As a developer, I find myself having to view source code files from GitHub and such in another editor. What I usually do is open the file in wordPad (which seems to support those already (probably by converting them to crlf format) for some reason), and then just copy the text from there over to notepad.
    If anyone has this insider build, could they provide the new notepad (would an executable be enough?), so that people who aren’t on the insider program (including me) can take advantage of this nice feature, without having to wait another ~6 months for another big update? I’d appreciate it very much.

    Reply
  2. the curious

    They should’ve also made it possible to save files without a bom while they were at it. Bom tends to break some stuff like php/html pages.

    Reply
  3. AW

    Yay! Finally!!!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *