Open fxliang opened 3 years ago
any update? I check latest version, it seems not solved. adding some code here to tell nvim backend to exit, might be the solution?
https://github.com/equalsraf/neovim-qt/blob/master/src/gui/mainwindow.cpp
void MainWindow::closeEvent(QCloseEvent *ev)
{
// Do not save window geometry in '--fullscreen' mode. If saved, all
// subsequent Neovim-Qt sessions would default to fullscreen mode.
if (!isFullScreen()) {
saveWindowGeometry();
}
if (m_neovim_requested_close) {
// If this was requested by nvim, shutdown
emit closing(m_exitStatus);
ev->accept();
} else if (m_shell->close()) {
// otherwise only if the Neovim shell closes too
emit closing(m_exitStatus);
ev->accept();
} else {
ev->ignore();
}
}
That function should already be calling m_shell->close()
which would result in a call to the Shell class
void Shell::closeEvent(QCloseEvent *ev)
{
if (m_attached &&
m_nvim->connectionType() == NeovimConnector::SpawnedConnection) {
// If attached to a spawned Neovim process, ignore the event
// and try to close Neovim as :qa
ev->ignore();
bailoutIfinputBlocking();
m_nvim->api0()->vim_command("confirm qa");
} else {
QWidget::closeEvent(ev);
}
}
The event itself is ignored there and confirm qa
is used to close neovim. Can you check if this also happens when using :confirm qa
manually?
manually:confirm qa
is ok, so does manully using :q
but by click the close button, no. only nvim-qt.exe exit, nvim.exe with sub processes(seems for coc) left there alive.
I've tried to reproduce this earlier, but no luck so far. In my case I was running python, but all processes terminated when I closed.
It might be worth trying to reproduce without loading any configuration just to be sure (nvim-qt -- -u NOCFG) it is not caused by some plugin/setting.
Maybe we can try to reconnect to the running neovim to see what is happening inside
:call serverstart('\\.\pipe\nvim-qt-944')
nvim-qt --server \\.\pipe\nvim-qt-944
no error msgs shown...
I try start nvim-qt from powershell( windows terminal), it close normally, no processes left. I make a lnk to nvim-qt -- -u NOCFG, no plugins, close normally, nothing left. any time I start nvim-qt not in console, it would left processes there. don't know why.
Maybe some plugin is preventing it from shutting down properly. It is strange that the window is closing though. That would mean this function is being called but nvim does not actually close:
https://github.com/equalsraf/neovim-qt/blob/master/src/gui/runtime/plugin/nvim_gui_shim.vim#L32
Can you share the autogroups that are setup for the leave events?
:au VimLeave
:au VimLeavePre
So coc_nvim is the only one there
Tricky to track past that point.
Just to confirm and narrow it down, can you try disabling the coc.nvim plugin and see if the problem still happens?
disable coc, close the window with mouse, then nvim.exe,conhosts.exe, python.exe left back.
Ok I've come across something that might be related to this one.
See https://github.com/equalsraf/neovim-qt/pull/1076 for a possible fix. Although we might become too aggressive in killing the processes.
Ok I've come across something that might be related to this one.
See #1076 for a possible fix. Although we might become too aggressive in killing the processes.
pity thing is that windows build not ok...
The tests are causing our windows builds to fail :S, here is a working one
https://ci.appveyor.com/project/equalsraf/neovim-qt/builds/47679296/job/7rc7nmxjxw5rb8ex/artifacts
I've checked that output, it works. Thanks a lot!~
hi,
if I use command :q to exit, everything works fine.
however if I click close button on caption bar, nvim.exe and other apps work with nvim (node.exe, python, etc.) not exit properly. a group of process leaves there everytime.
system: windows 10 1909(18363.592) 64bit nvim-qt release with nvim 0.5.1