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