2

enter image description here

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:.

Antony
  • 2,570
  • 11
  • 19
smmr
  • 21
  • 1
  • 1
    The solutions in that thread don't work. q just makes a smaller version of that windo popup. – smmr Apr 09 '18 at 04:24
  • this doesn't look like vim at all, how did you get here? – Mass Apr 09 '18 at 04:26
  • I'm using putty to ssh into a testing environment. I put the contents of a find command into a file named log and used vi log to open it. This is the result of trying to exit with :q. – smmr Apr 09 '18 at 04:28
  • 2
    telnet users.deterlab.net gives me SSH-2.0-OpenSSH_7.2 FreeBSD-20161230 @Mass, so it's probably nvi, which is the default vi on FreeBSD. – Martin Tournoij Apr 09 '18 at 05:31
  • 3
    That being said, it's not clear to me what exactly I'm looking at? Did you try pressing <Esc><Esc>:q? What are the exact steps to reproduce this? – Martin Tournoij Apr 09 '18 at 05:35
  • 1
    What's your .exrc (or .nexrc)? Sounds like you have set 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:31
  • FWIW, I did not vote to close this as a duplicate. I voted for "unclear what you're asking" pending a response to Carpetsmoker and @Antony's queries. – Rich Apr 09 '18 at 15:18
  • I've re-closed it as "unclear what you're asking". It's clearly not a duplicate, but it's also not clear how to reproduce this. I'll be happy to re-open when the steps to reproduce are clearer. – Martin Tournoij Apr 09 '18 at 16:10
  • @Carpetsmoker It says log: unmodified: line 1 at the very bottom as opposed to "log" 1L, 32C which is what it did before. Any attempts to escape cause the box at the bottom to popup. I'm not sure how this happened. I was trying to exit and I guess I pressed some wrong keys or keys out of order which causes this to happen. – smmr Apr 10 '18 at 20:54
  • @Antony I'm not exactly sure what .exrc is. It was most likely causes when I tried to exit and pressed some extra keys or keys in the incorrect order. – smmr Apr 10 '18 at 20:57
  • The command-line history is enabled with the cedit option, 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

0 Answers0