Advertisement

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

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

3 thoughts on “Notepad To Support Unix Line Endings”

  1. 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.

  2. 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.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.