targets="msg" + ui2: a kind="confirm" msg immediately after a kind="empty" msg sends the confirm content to "msg" instead of "dialog"
Author: edisjCreated Sep 29, 2026Updated Sep 29, 2026
Labelsui2
Problem
"confirm" messages should go to the ui2 dialog window next to the confirmation prompt in the cmdline. This is normally the case, but when a kind="empty" message is processed, it leaves the messaging system in a state such that if the next message is kind="confirm", it is incorrectly sent to the "msg" window.
If default target is set to "cmd", this does not happen.
Steps to reproduce
- create a minimal
init.lua(the inputlist keymap is just for convenience of generating a confirm message)
require("vim._core.ui2").enable({
msg = { targets = "msg" }
})
vim.keymap.set({"n"}, "<Enter>", function()
vim.fn.inputlist({
" item 1 ",
" item 2 ",
" item 3 "
})
end)- emit a
kind="confirm"message after doing something that causes akind="empty"message to be processed
for example
nvim --clean -u init.luathen
:to enter cmdline<Esc>to abort and send empty message<Enter>to open a confirm message (in this case aninputlist)- see that the confirm content is not in the dialog window
Here's a video demonstration
https://github.com/user-attachments/assets/60e364bc-f360-4030-8ad0-3672e4035d1f
Expected behavior
Confirm messages belong in the dialog window next to the confirmation prompt. Concretely, kind="confirm" message should be routed to "dialog" in the case outline above
System info
- Nvim version (nvim -v):
v0.13.0-dev-1758 gb4528ba65cneovim/neovim@b4528ba65c - Vim (not Nvim) behaves the same?: ?
- Operating system/version: Linux 7.1.12-100.fc43.x86_64
- Terminal name/version: ghostty 1.3.1-4.fc43
- $TERM environment variable:
xterm-ghostty - Installation: built from source
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=$HOME/opt/nvim && make install
Source: neovim/neovim