To reproduce:
Open neovim-qt
type :q<CR>
observe that the window doesn't close
click the mouse, or press any key
observe that only now does the window close.
I'm using HEAD of both neovim and neovim-qt
@expipiplus1 are you having this issue Windows?
@raghur reported the same issue, and I can replicate, but only on Windows. It seems Neovim blocks in the event loop (loop_close comment) until another event arrives.
Whoops! yes I am on Windows.
This also happens when double clicking the icon on the top left corner to close. Just downloaded latest versions from appveyor.
I got the same issue in win7, just marked.
This issue also happens when simply closing the window with the X in the top right corner. One has to press the X button twice.
For the second input, anything is fine. One can for example click the X and then anywhere in the window. Or type :q! and then type f or open the menu on the top left and press Close and then hit Enter.
This issue happens to me too have to click the X button twice to close it. I'm on Windows 8.1 compiled from latest src
So with the runtimepath bug fixed, this is the only remaining big show stopper on Windows as far as I can tell right now.
I'm already building bad muscle memory by clicking enter twice.
I've tested Nyaovim and Oni on Windows and they don't seem to have this problem. So it's likely not a nvim issue or they added a workaround.
So there are at least a couple different cases:
:q that terminates nvimIn either case nvim-qt should be notified about the event here https://github.com/equalsraf/neovim-qt/blob/28e305fe54725481daafcda84dce0cd99083f522/src/gui/mainwindow.cpp#L61
Poking a bit at it in https://github.com/equalsraf/neovim-qt/pull/241
Ok, it was late last night, but I think there is a workaround in https://github.com/equalsraf/neovim-qt/pull/241. Can someone with windows give it a shot.
I tested closing the window with :q!, :qa and by pressing the close button on the window. All of them work perfectly.
I tested with https://ci.appveyor.com/api/buildjobs/w8bn10spxcorpour/artifacts/neovim-qt.zip, which is on 7b4bbbc53e0fe23b6ec606e7f17669b3918e5c5f.
As far as I can tell, this issue is fixed.
Closing then.
I'd like to re-open this issue (or I can create a new one if you prefer).
It seems the fix works in that latest release (v0.2.6), but if I add this line to init.vim, I have the same behavior as before (after :q, I need to press Enter again to close nvim-qt):
let &rtp .= 'C:\FolderThatDoesNotExist'
Note that the behavior is the same regardless of if the folder exists or not.
If you break the runtimepath then yes, the fix won't work. Add a comma:
let &rtp .= ',C:\FolderThatDoesNotExist'
If you break the runtimepath then yes, the fix won't work. Add a comma:
I'm still considering working out a solution that does not require the shim, you can follow #247 for that
Oops, you're right (though I didn't expect this to be related), thanks for explaining, I'll follow #247:)
@christianrondeau The GuiClose() functions are implemented in the neovim-gui-shim plugin. If you don't have the shim loaded, it won't work. Breaking rtp is what made it not load in your case.
That's what #247 is actually about. That in a remote session you need to specifically load the shim as a plugin, because it can't just be added to rtp by Neovim-Qt.
That makes perfect sense @xelra :) Thanks!
I have the same problem but I am using Arch Linux. When I write :q<CR> Neovim-qt wont close and will ask for confirmation. It is strange, because I use the same init.vim file in another computer with Ubuntu and the problem does not exist. In Arch Linux I am using the git version from AUR.

@cristobaltapia that looks like a different issue, the Press ENTER prompt was not what was happening here. Does it also happen with
nvim-qt -- -u NORC
or
nvim-qt -- -u NONE
No, it does not happen with those commands. I suppose the problem lies then in my vimrc/init.vim file then? I will look into it.
Seems like it. Maybe its a specific plugin you are using.
I found the problem. It was YouCompleteMe [0]. I just replaced it with Duoplete. But it is still somewhat strange, that I only experienced the problem in Archlinux and not in Ubuntu.
Most helpful comment
I tested closing the window with
:q!,:qaand by pressing the close button on the window. All of them work perfectly.I tested with https://ci.appveyor.com/api/buildjobs/w8bn10spxcorpour/artifacts/neovim-qt.zip, which is on 7b4bbbc53e0fe23b6ec606e7f17669b3918e5c5f.
As far as I can tell, this issue is fixed.