Sample Header Ad - 728x90

Why can't ed be exited with C-c?

29 votes
4 answers
23625 views
The program ed, a minimal text editor, cannot be exited by sending it an interrupt through using Ctrl-C, instead printing the error message "?" to the console. Why doesn't ed just exit when it receives the interrupt? Surely there's no reason why a cryptic error message is more useful here than just exiting. This behavior leads many new users into the following sort of interaction: > $ ed > hello > ? > help > ? > exit > ? > quit > ? > ^C > ? > ^C > ? > ? > ? > ^D > $ su > # rm -f /bin/ed Such a tragic waste—easily avoidable if ed simply agreed to be interrupted. Another stubborn program exhibiting similar behavior is less which also doesn't appear to have much reason to ignore C-c. Why don't these programs just take a hint?
Asked by lily (413 rep)
Aug 17, 2014, 12:25 AM
Last activity: Nov 29, 2023, 12:19 PM