When using nvi I have a file that I want to exit but everytime I use :q it just opens this thing and I can't exit out of it. Does anyone know what it is and how to get rid of it?
Note: this is nvi and not vim, so hasn't been caused by accidentally typing q: or by a mapping to q:.

telnet users.deterlab.netgives meSSH-2.0-OpenSSH_7.2 FreeBSD-20161230@Mass, so it's probablynvi, which is the defaultvion FreeBSD. – Martin Tournoij Apr 09 '18 at 05:31<Esc><Esc>:q? What are the exact steps to reproduce this? – Martin Tournoij Apr 09 '18 at 05:35set cedit=^M.:q<Esc>in that situation will let you quit until you can fix your exrc. (And yeah, that's nvi.) – Antony Apr 09 '18 at 08:31ceditoption, which is empty by default. AFAIK there is no other way to access the command-line history in nvi. The .exrc or .nexrc files are the configuration files for nvi. Look in your home dir. Alternatively commands to be run at startup can be set in the EXINIT or NEXINIT environment variables, so maybe check those as well. – Antony Apr 10 '18 at 21:34