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

bug: Noice is causing NeoVim on macOS to hang on exit

Open duckpuppy opened this issue 1 year ago • 14 comments

Did you check docs and existing issues?

  • [X] I have read all the noice.nvim docs
  • [X] I have updated the plugin to the latest version before submitting this issue
  • [X] I have searched the existing issues of noice.nvim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.1

Operating system/version

macOS 14.5

Describe the bug

After commit 1698725a663aca56bcd07a0e405bc441a5f6613b and using Noice via LazyVim, I'm seeing hangs for several seconds (5-10) when exiting NeoVim on macOS. I couldn't reproduce the issue on another OS. There are some weird behaviors - it's only happening when a buffer is open on a file in a git repo, if no buffers are open at all it doesn't hang, and most of the time simply entering the command line (thus invoking Noice) and just hitting ESC stops the hang from happening on a subsequent :q. It's most noticeable to me when running nvim to look at a file in a git repo and exiting without doing anything but navigation (the only command issued is :q).

See discussion here

Steps To Reproduce

  1. Clone LazyVim's starter template as directed to use as your neovim config
  2. Start neovim with nvim <file in git repo>
  3. Immediately type :q to quit.

Expected Behavior

NeoVim exits immediately upon issuing the quit command.

Repro

Basic LazyVim starter

duckpuppy avatar Jul 26 '24 19:07 duckpuppy

Pinning Noice to the commit prior to the one mentioned removes the problem for me. Done using the below line in my personal ~/.config/nvim/lua/plugins/init.lua file.

{ "folke/noice.nvim", enabled = true, commit = "d9328ef903168b6f52385a751eb384ae7e906c6f" },

duckpuppy avatar Jul 26 '24 19:07 duckpuppy

Similar issue on macOS. Are we sure the nvim__redraw API is stable enough to use?

b0ae989c avatar Jul 26 '24 20:07 b0ae989c

I see the same issue here. However, reverting to the previous commit only improves the hang time, it doesn't really solve the problem entirely. I have been noticing this issue for about a month or more now. Disable noice altogether completely eliminates the problem for me.

I experience it only when working on rust files with LSP. Exiting with :wq hangs the UI for about 2-3 seconds. Exiting with only :q never hangs.

telbizov avatar Jul 27 '24 05:07 telbizov

I can add that I have been noticing this as well. OS: Windows 10 nvim ver: 0.10.1

Not all file types...seems to be certain filetypes...perhaps when an lsp is attached as well? I was able to capture this error message but felt like I couldn't find it in any logs.

image

akthe-at avatar Jul 27 '24 10:07 akthe-at

I am noticing a similar issue of hanging on exit as well on Windows on both Ubuntu and Alpine WSL. When I exit with :x on nvim, the screen freezes with the Noice command line box arrow before fully exiting. Using: NVIM v0.10.0 2024-07-28 14-11-08

When I tried disabling Noice plugin, the issue resolves.

I don’t think my issue is related to file types or LSP. Reverting to tag v4.4.7 or the previous commit d9328ef903168b6f52385a751eb384ae7e906c6f as mentioned by @duckpuppy solves the issue.

mau-mauricelim avatar Jul 27 '24 14:07 mau-mauricelim

Mine has nothing to do with filetypes or attached LSPs. It's all or nothing, only that there's an open buffer with a file that resides in a git repo.

On Sat, Jul 27, 2024, 10:47 AM mau-mauricelim @.***> wrote:

I am noticing a similar issue as well on Windows on both Ubuntu and Alpine WSL. When I exit with :x nvim, the screen freezes with the Noice command line box arrow before fully exiting.

— Reply to this email directly, view it on GitHub https://github.com/folke/noice.nvim/issues/921#issuecomment-2254168546, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEWNIBVHRV7BH3KTJ7JA3ZOOXGLAVCNFSM6AAAAABLRCNPLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGE3DQNJUGY . You are receiving this because you authored the thread.Message ID: @.***>

duckpuppy avatar Jul 27 '24 15:07 duckpuppy

Just to add that this also happens on Fedora 40.

Reverting to the prior commit as instructed above by @duckpuppy solves the problem.

The hangs usually last between 2 and even 60 - 90 seconds.

LowArmour avatar Jul 27 '24 21:07 LowArmour

Seeing the same issue on Ubuntu 22, and again, the commit @duckpuppy 's mentions fixes it.

xyven1 avatar Aug 02 '24 16:08 xyven1

Same problem, error on screenshot :) Capture d’écran 2024-08-08 à 21 16 32

GeoffreyBrunet avatar Aug 08 '24 19:08 GeoffreyBrunet

I used redir! > ~/some/path/nvim_msgs.txt to see the error log right before neovim exits and essentially got the same as what other people did but x4:

Error executing vim.schedule lua callback: ...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: Cursor position outside buffer
stack traceback:
	[C]: in function 'nvim_win_set_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: in function 'fix_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/util/hacks.lua:43: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: Cursor position outside buffer
stack traceback:
	[C]: in function 'nvim_win_set_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: in function 'fix_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/util/hacks.lua:43: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: Cursor position outside buffer
stack traceback:
	[C]: in function 'nvim_win_set_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: in function 'fix_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/util/hacks.lua:43: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: Cursor position outside buffer
stack traceback:
	[C]: in function 'nvim_win_set_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/ui/cmdline.lua:237: in function 'fix_cursor'
	...ocal/share/nvim/lazy/noice.nvim/lua/noice/util/hacks.lua:43: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

n-crespo avatar Aug 10 '24 04:08 n-crespo

This happens to me too quite a lot honestly when I'm using Windows Terminal btw

6H075T2 avatar Aug 21 '24 02:08 6H075T2

Same thing on NixOS. It seems much worse for files that load a lot of plugins, e.g. Rust.

Unfortunately Noice is in the default lazyvim configuration, so this is affecting a lot of people.

Baughn avatar Aug 24 '24 16:08 Baughn

Same problem for me on Linux, but only when I'm using Vue LSP and do :qa after editing a few files. I tried different terminals but result is the same, it hangs on for ~1 minute and throws the error

dennis-lookin avatar Aug 26 '24 12:08 dennis-lookin

Hey, I am facing a similar issue, when i tried exiting neovim it takes about 2-3 seconda to exit. Its a bit annyoing when working. I am on arch linux and on latest version of neovim.

Ghanshyam-shaktawat avatar Aug 28 '24 05:08 Ghanshyam-shaktawat