However, there is a -p option that causes it to display a prompt when you are in command mode
The -p
option is meant to set a different prompt. When used, a side-effect is that ed starts in addition with prompt enabled.
Why is the default to have no prompt?
There is a default, *
(asterisk); it's just not switched on. Prompt display can be toggled by applying a P
command (*1).
Ed is meant as well for automated (scripted) use (*2). Having the prompt displayed for each command entered is at least annoying; on a real TTY it will waste a lot of paper.
To display no prompt by default seems sensible in an early environment, doesn't it?
In addition, it might be good to keep in mind that programming back then, especially when done online, was handled mostly in the head, not on a screen or alike. When using ed, one had to have a proper image present. Printing the whole file or just parts thereof would eat up a lot of paper and even more important time. Listing just a page would easily take a minute or two.
With that background it's rather trivial to keep aware what mode one is in. After all, it's not complicated, as default is command and input is only activated on request.
*1 - The prompt is a rather new addition as Stephen Kitt mentioned.
*2 - I always loved the feature to 'open' any shell command as an input 'file'.
In fact, ed even predates next to all other Unix tools as well as basic output direction itself (which was a shell feature until pipes were added in V3 (?)). So the standard way to capture a program output was to 'open' it as ed input file and save it as text file:
$ ed
r !ls -l
w directory_listing
q