
Introducing extended line endings support in Notepad - dEnigma
https://blogs.msdn.microsoft.com/commandline/2018/05/08/extended-eol-in-notepad/
======
maltalex
I don't understand all the negativity in this thread.

Is this Microsoft's crowning achievement? No, it's just a stupid little
historic decision that someone remembered and decided to fix. They even took
the time to enable admins and power users to use the old behavior. I too don't
see who'd want it, but who knows? People do unexpected things sometimes.

Why bash them for that? There are enough good reasons to bash Microsoft...
There are Microsoft products that fill me with a fiery rage of a thousand
suns. But they did something cute here, someone there deserves a good word.

~~~
ajross
I think it's mostly humor. Bugsmithing and interoperability impedance of this
form was almost Microsoft's raison d'etre in the 90's. Stuff that was simple
and obvious everywhere else _just didn 't work_ on windows, even though the
fix would be 100% trivial and probably result in better standards compliance.
And MS liked it that way.

So sure, this is good. It doesn't exactly undo all those decades of grief. So
we're laughing grimly at the "progress".

~~~
jameshart
It's a very parochial read of the 1990s that remembers Microsoft Windows as a
place where 'obvious things' just 'didn't work'.

From Microsoft's point of view, when they held >90% of the PC market, what
would be the point of even _thinking_ about interop?

~~~
ajross
Because PC's were maybe only 60% of the actual software development market and
there were a _lot_ of us hackers whose "parochial" needs involved getting
stuff to work across both platforms. Were you actually there?

I mean, Notepad is a silly thing, sure. But the crazy spec incompatibilities
between MSVC and the C9x and C++03 standards were a _huge_ source of grief for
me personally. And the mess caused by Microsoft's "Java" implementation was
straight up evil.

~~~
pjmlp
I had lots of hair pulling fun trying to write portable C and C++ code across
commercial UNIXes back then (hello aCC). Microsoft wasn't alone.

------
joshuaeckroth
Almost feels like an April Fool's joke. For 30 years Notepad had this bug and
I've always wondered why they never fixed it. It was just "one of those
things" like the unusual arguments to Unix find or tar commands. I find it
very surprising that someone finally bothered to fix it!

~~~
yiyus
I would not consider it a bug. It was working as intended. This is a new
feature.

~~~
rogerbinns
Correct. The existing Notepad is top level Window and menu bar around the
existing [edit control]([https://msdn.microsoft.com/en-
us/library/windows/desktop/aa3...](https://msdn.microsoft.com/en-
us/library/windows/desktop/aa368342\\\(v=vs.85\\\).aspx)). It has always had
the same limitations - eg in way earlier versions of Windows it was limited to
64kb of text.

Addressing the "bug" is not simple - the edit controls behaviour could be
changed in which case it could cause existing programs to behave differently,
or extra code would have to be written for notepad to do its own text editing.
Microsoft takes backwards compatibility very seriously.

Anyone curious about the Microsoft side of this should find Raymond Chen's Old
New Thing blog interesting (about 5 posts a week). For example here is content
tagged history:
[https://blogs.msdn.microsoft.com/oldnewthing/tag/history](https://blogs.msdn.microsoft.com/oldnewthing/tag/history)
and here is how there are actually two copies of Notepad on each system:
[https://blogs.msdn.microsoft.com/oldnewthing/20090312-00/?p=...](https://blogs.msdn.microsoft.com/oldnewthing/20090312-00/?p=18843/)

~~~
simonh
>…the edit controls behaviour could be changed in which case it could cause
existing programs to behave differently…

You just add a new mode to the control that enables the new behaviour.
Existing programs using it would work fine.

~~~
mark-r
Adding new features to an existing Windows control, particularly one that has
existed since the dawn of time, is a _much_ bigger deal than adding to a
simple utility. The last time that happened they added a whole new control,
the Rich Edit.

~~~
simonh
Oh come on, framework libraries add new features to controls in a backwards
compatible way all the time.

------
jakobegger
Microsoft really goes the extra mile when it comes to backward compatibility.
"Just in case you depend on Notepad being broken, we added a setting for you!"

~~~
dmannorreys
And they even made the setting easily accessible, just hit
[HKEY_CURRENT_USER\Software\Microsoft\Notepad] and change some registry key

~~~
Spivak
I don't know if this is sarcasm or not but that's pretty standard in the
Windows world. Your ops team wouldn't blink at tweaking reg values.

~~~
eterm
Indeed, the registry is actually a good feature, it's a configuration
_database_ rather than relying on flat files as in the "just go to
/etc/<package>/<package>.config or /home/<user>/.package/<package>.config" of
the linux world.

The problem is that when it was first introduced in windows 95 the registry
would easily and often corrupt causing many issues so some people still
associate the registry with being a bad design, when it was actually just a
bad implementation of a good design.

~~~
Hello71
if it's trying to be a database, it's doing a terrible job. all the problems
of not being files (can you do "find HKEY_CURRENT_USER -name mypackage" to see
what the uninstaller left behind?) with none of the benefits of a database
(ACID).

~~~
mappu
> _can you do "find HKEY_CURRENT_USER -name mypackage" _

Powershell comes with a kind of FUSE mount for the registry:

    
    
        PS C:\> Set-Location HKCU:
        PS HKCU:\> Get-ChildItem -Recurse | where-object { $_.Name -match "HeidiSQL" }

~~~
Slackwise
Or for those who come from Unixland and see way too much typing, PowerShell
has aliases that make this much shorter:

    
    
        cd HKCU:
        ls -r -i *HeidiSQL*
    

Or if you really want to use the match operator, regex, or other expression,
you can still pipe it through the Where-Object alias:

    
    
        ls -r | ? {$_.Name -match "HeidiSQL"}

------
swebs
It's really surreal to see how far behind basic Windows tools are compared to
counterparts in other operating systems. Compare Notepad to something like
Gedit or Kate that comes with most Linux distros and are much more advanced. I
just assumed any programmers still on Windows would be using Notepad++ or some
sort of IDE. It's also pretty silly that you have to hack registry keys just
to change some basic settings.

~~~
Analemma_
> Compare Notepad to something like Gedit or Kate

This is the wrong comparison. Notepad is like nano or ed. More powerful
editors are available on Windows too.

> I just assumed any programmers still on Windows would be using Notepad++ or
> some sort of IDE.

Usually we do. But notepad can be invoked quickly from the command line, tends
to handle huge files better than N++ or other IDEs, and is opened by default
by a lot of utilities like git (you can change this, of course, but you might
miss one). So it ends up getting used a lot for quick one-line changes and
improvements are still welcome.

~~~
liveoneggs
notepad isn't even close to ed in functionality

~~~
Spivak
There's a reason ed is the standard text editor. Everything is possible in ed.

~~~
krylon
> Of course, on the system I administrate, vi is symlinked to ed. Emacs has
> been replaced by a shell script which 1) Generates a syslog message at level
> LOG_EMERG; 2) reduces the user's disk quota by 100K; and 3) RUNS ED!!!!!!

SCNR

------
jimnotgym
There was a thread on here at the weekend criticising Windows 10 for not
making enough progress, and also MS for not properly testing updates. I hope
this silences those critics. A thoroughly tested change that is fully
backwards compatible, but also adding genuinely useful new features. If you
were wondering whether to upgrade to Windows 10 I think this settles it.

~~~
seba_dos1
Not sure how you go from "finally catching up with support of a basic text
format that's around for decades" to "making enough progress". This won't
silence anyone - it just shows that Microsoft is finally starting to do things
it should have done 20 years ago.

~~~
Moru
I see it more as a platform war that's finally settled. No more
Mac/Linux/Windows linebreaks, now we can at last talk about "Linebreak".

I mean there is only so many ways of putting together two different
characters. Is it supposed to be \n\r or \r\n? Or just \n? Or mabe it's \r? So
much of the last 35 years have gone to writing the wrong line endings for the
intended platform...

~~~
pjmlp
Only if you ignore mainframes.

------
dash2
So, today the Google news is "robots that automatically phone businesses and
have conversations on your behalf", and the Microsoft news is "Notepad can now
cope with Unix line endings". Symbolic or what?

~~~
Zelizz
Pretty sure that Google is advertising a service that you might pay for,
whereas Microsoft is adding a new feature (in reality, many features) to an OS
you already paid for.

Full disclosure, I work for Microsoft, this post doesn't reflect my employer
in any official capacity, etc.

------
jimrandomh
For pretty much as long as I can remember, it's been a fact of life that
Windows had these little embarrassments, and Microsoft was too dysfunctional
to address them. Everyone just sort of learned that Notepad didn't work and
you weren't supposed to use it, then forgot it was there.

~~~
kerng
I think Notepad is used pretty extensively. A lot of people are joking about
it and its quirks, but use it at the same time. Its like this little weird
thing people become fond of.

------
sebazzz
The most common case for needing an external editor on Windows Server is
default Notepad not supporting non-CRLF line endings. Unfortunately licensing
would not allow transplanting the insider Notepad.exe to Windows Server,
preventing the need for installing external software on the OS.

~~~
ams6110
I thought wordpad was also part of a standard windows install? It does support
the unix style line endings. Or am I misremembering and wordpad was an add-on?

~~~
Someone1234
Wordpad is part of Windows Server, but it is a rich text editor not a plain
text editor. Therefore there are some file formats that it will interpret and
corrupt on save.

------
edgarvaldes
I dual boot on my work and home computers (Windows 10, Linux). I use a lot of
txt files as todo list, reminders, quick notes, etc. This are good news for
me.

------
jdblair
It's worth pointing out that CR-LF is the original ascii standard behavior,
from electro-mechanical teletype. It took two characters worth of time to
return the print carriage to the left of the paper. Rather than implement
buffering (expensive at the time) the designers split the operation into two
characters (Carriage Return and Line Feed).

------
andyjpb
It's a welcome addition but all was not lost on a Windows install before.
write.exe has managed to do this even if notepad.exe couldn't.

------
nextweek2
I cannot fathom a reason why someone would disable this feature.

It has been 25+ years in the making.

~~~
lopmotr
You sort of answered your own question. People's workflows tend to morph
around the idiosyncrasies of their tools. There'll be somebody doing something
weird like using LF to keep lines separate for Linux but wanting them
condensed to fit on one screen in Notepad. Notepad does preserve LF
characters, just doesn't display them, so you can think of it as a no-wrapping
display mode.

~~~
userbinator
More practically, it could be as simple as checking whether text files
actually have CRLF line endings. That's one thing I personally use Notepad
for.

------
mixmastamyk
Hard to believe, but the neglected issues of DOS/Windows are being squashed
one by one, almost thirty years later.

Too bad about the telemetry and lack of privacy, or I might actually be
tempted to use it. :-/

~~~
pjmlp
Better stay away from Google OSes then.

~~~
mixmastamyk
I do.

------
ComputerGuru
We developed an open source notepad clone (feature, keyboard shortcut, and
look compatible) replacement basically to address this one gripe with an
otherwise fast and barebones text editor. It’s nice to (mostly) no longer need
this!

[https://neosmart.net/blog/2017/hello-
betterpad/](https://neosmart.net/blog/2017/hello-betterpad/)

(Only other features iirc are hyperlinked URLs and unsaved document
persistence after reboot/kill a la text edit on macOS.)

------
m_fayer
This year's build is rather underwhelming.

~~~
cptskippy
Yes. I'd have much rather they just used the release to fix all of the little
quirky annoyances about Windows like this.

------
AdmiralAsshat
Microsoft was clearly upset at the number of SysAdmins installing Notepad++
onto their freshly-imaged Windows PC's.

~~~
kalleboo
Or rather Microsoft's own engineers were upset at Notepad being useless at
debugging their new linux subsystem on clean testing VM installs

------
kristianp
I imagine the reason this was done after all these years is to improve
compatibility with Bash for Windows/WSL.

------
pcunite
Nice, I actually had a customer ask about a configuration file (that one of
our product produced) as not being readable anymore.

Turns out that an update did not properly write out "\r\n" but rather "\n".
Looked fine in Notepad++ of course, but sure enough in MS Notepad ... things
look garbled.

------
lopmotr
This change will eliminate most of my need for Notepad++.

It feels a bit wrong that it supports old MacOS CR though. Isn't that
thoroughly obsolete, and encouraging its use only going to prolong its death,
making it harder for everyone else to have to keep supporting it?

~~~
PhasmaFelis
You could say the same about using CRLF instead of just LF.

~~~
lopmotr
No because it already supported CRLF so that would be a step backwards for
CRLF users. CR is a new feature so it would be no worse than before if they
didn't add it.

------
Wildgoose
Hallelujah!

I am so sick of having to tell people not to use Notepad because it is badly
broken and always has been.

You shouldn't have to tell people to download Notepad++ or use WordPad if they
want to read a text file.

------
gymshoes
MS is on track.

Edge, WSL, open source powershell, open source dotNet Core, VS Code and now a
Notepad with line endings.

Windows is consistently getting better as a developer's Operating System.

------
nvr219
This will, surprisingly, make my life easier. Awesome.

------
pradn
Notepad seems like the perfect candidate for open-sourcing. It provides no
competitive advantage to Windows. So might as well have the OSS community
improve it. It's possible it might be too hard to remove it from the Windows
code base and put it online.

~~~
userbinator
Notepad is literally just the Windows EDIT control with some trivial code to
transfer the data in it to/from files, and a menu to change some of the edit
control's options.

I don't think it needs much improvement, really. Anything besides fixing bugs
in its own code (i.e. this "extended line endings support" is in the edit
control) would go against its core principle. There's Notepad++ and all the
other "heavier" editors if you want more features.

------
tbob
Can't understand why Window still uses CRLF line endings. Just to be
different?

~~~
vbezhenar
Why not? If something works, why break it? HTTP uses CRLF as well. Should we
redesign it?

~~~
cesarb
> HTTP uses CRLF as well. Should we redesign it?

We did:
[https://en.wikipedia.org/wiki/HTTP/2](https://en.wikipedia.org/wiki/HTTP/2)

------
colanderman
No love for U+2028?

(I slightly kid; that's the official Unicode "line separator". Never actually
seen it in the wild, and not entirely sure how the Unicode consortium expected
it to come into usage.)

------
AnnoyingSwede
I could have really used this feature when editing php back in the day.. Now,
not so much. It's mildly amusing that such a trival feature took this long.

------
hzhou321
Will I be able to find an exe download and fix my old PC?

------
skullt
Now just let us change the tab width.

~~~
teddyh
No! Just add elastic tabstops support!

[http://nickgravgaard.com/elastic-tabstops/](http://nickgravgaard.com/elastic-
tabstops/)

------
calebm
I appreciate this gesture of heterogeneity.

------
omarforgotpwd
This is huge.

------
reaperducer
Welcome to 1974, Microsoft.

------
NVRM
[FIXED] « The default editor can't read text files »

