It dates back to the rlogin command from 4.2BSD in 1983.
Technically, the return key isn't part of the sequence. An escape sequence in rlogin is defined as a line where a tilde, or (more properly) the escape character (since it can be changed with a command-line option), is the first character that is typed at the start of a line.
* https://docs.oracle.com/cd/E19683-01/816-0210/6m6nb7mjg/inde...
* http://www.gnu.org/software/inetutils/manual/html_node/rlogi...
rlogin wasn't the only command where a line starting with an escape character was special. When Berkeley Mail was in compose mode, one could do various things with such lines.