FTerm.nvim icon indicating copy to clipboard operation
FTerm.nvim copied to clipboard

Error when trying to quit with :xa

Open JakeAdler opened this issue 3 years ago • 4 comments

Steps to reproduce:

  • toggle term on
  • toggle term off
  • try to quit with :xa

Error:

E948: Job still running                                                                                                                                                                                                                      
E676: No matching autocommands for acwrite buffer   

Nvim version: nightly@fe808f0

JakeAdler avatar Apr 16 '21 23:04 JakeAdler

From :h xa

:xa Write all changed buffers and exit Vim. If there are buffers without a file name, which are readonly or which cannot be written for another reason, Vim will not quit.

JakeAdler avatar Apr 16 '21 23:04 JakeAdler

IMO that's expected. When you toggle the terminal. the terminal buffer stays in the background for reuse and the terminal buffer is a modified buffer. But you can't save the terminal buffer.

Because of this behavior, I am also force closing the terminal buffer. https://github.com/numToStr/FTerm.nvim/blob/94e767f2f0fdd436c8aceadeae4d3e23166ee1f8/lua/FTerm/terminal.lua#L182

You can try to close (not toggle) the terminal and then try :xa.

numToStr avatar May 07 '21 05:05 numToStr

I also encountered this. Not really an issue with fterm but curious to hear if anyone has some solution which doesn't involve manually closing the terminal buffer before wqa.

AckslD avatar Aug 05 '21 09:08 AckslD

Actually @numToStr how do you mean "close" the buffer? I tried both lua require('FTerm').close() and :q but neither help with wqa.

The confusing thing is that wa followed by qa works but not wqa.

AckslD avatar Aug 05 '21 09:08 AckslD