rohit-px2 / nvui

A modern frontend for Neovim.
MIT License
1.72k stars 49 forks source link

nvui window does not close with latest neovim releases. #153

Open damanis opened 1 year ago

damanis commented 1 year ago

Steps to reproduce:

Expected: file saved, then nvui closed Problem: nvui window isn't closed. The neovim process (ps ax) does not exist, but nvui process still exists.

It is not nvui specific, goneovim also has it, but not nvim-qt. Seems, something changed in nvim API.

damanis commented 1 year ago

It relates to configuration option o.clipboard = [[unnamed]] in nvim init file. When the option is commented out, there is no problem, but it required for PRIMARY selection support.

damanis commented 1 year ago

Also, the problem caused by any clipboard operation, not change/save only.

damanis commented 1 year ago

At exit the /usr/bin/xsel --nodetach -i -p is called to save * register to primary selection. Same for + register (system clipboard). By default, primary selection of X application should be lost when the application exists, but neovim changed this behavior and tries save it. The workaround below prevents nvui stuck at exit.

if vim.g.nvui then
  -- Workaround: clear primary before exit
  vim.api.nvim_exec([[
    :autocmd VimLeavePre * call setreg('*', [])
    :autocmd VimLeavePre * call setreg('+', [])
  ]], false)
damanis commented 1 year ago

Seems, it caused by https://github.com/neovim/neovim/commit/1d16bba4d8b8b648d2dabd610924bcf3051a0f29