bug: Cannot get stdout while running !commands
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)
v0.11.0
Operating system/version
Ubuntu 24.04
Describe the bug
Hi How are you?
While running :!commands (like :!date) I cannot get the stdout of the command while using nvim v0.11.0
The
checkhealth noice show the following output:
If I use the same config, but using nvim v0.10.0, I get the message notification normally.
Thanks in advance. Best Regards
Steps To Reproduce
Open nvim v0.11.0
In normal mode, use the following "command" :!date
Expected Behavior
Show notification with command stdout
Repro
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
"folke/noice.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
I am experiencing the same problem, stdout doesnt show in the notification.
require("noice").setup({
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
},
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- (i dont have inc rename plugin so dont care)
lsp_doc_border = true, -- this is nice
},
})
` ``
Long messages of type `show_msg.shell_out` show by running :Noice ... but appart from that all the stdout of short commands that you want to see the output of get filtered
Same issue here
I'm also experience this issue.
Got the same bug, running Mint (ubuntu 24.04/noble), at least there's progress with the PR
Same issue. The only way to get it output was to
- write some custom logic to capture it in a notification, or
- disable noice in order to get the old behavior.
Here's what I did to get the output into a notification, although I don't like this at all -
-- ensure you have carriga/nvim-notify
local function capture_command_output(command)
local output = vim.fn.systemlist(command)
local output_str = table.concat(output, "\n")
require("notify")(output_str, "info", {
title = "Command Output",
timeout = 5000,
})
end
vim.api.nvim_create_autocmd("CmdlineLeave", {
callback = function()
local cmd = vim.fn.getcmdline()
capture_command_output(cmd)
end,
})
Same here, hope there will be a solution to this soon.
Also getting this issue. All shell commands return as a success even if they don't exist. No terminal output is returned
routes = {
{
filter = { event = "msg_show", },
view = "notify",
opts = {
level = "info",
skip = false,
replace = false,
}
}
This seems to be a more direct temporary fix. Unless I am missing something, it doesn't seem possible to filter directly by msg_show.shell_out/err. It seems like the problem is that the msg_show.shell outputs dont have a level assigned to them. Assigning them a level here shows them similar to how they would be shown in :Noice all.
Definitely does not feel intentional.
@Avsilver
Thanks for the workaround. I was able to filter the !cmd output using kind:
{
filter = { event = 'msg_show', kind = { 'shell_out', 'shell_err' } },
view = 'split',
opts = {
level = 'info',
skip = false,
replace = false,
},
}
i have this issue too
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Still an issue
same error
Anyone tested if after #1098 This is fixed?
Still an issue
Sorry, got it working after
routes = {
{
view = "notify",
filter = {
event = "msg_show",
kind = "shell_out",
},
},
}
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I'm getting the same behavior (no stdout shown on most commands, such as :!ls) but with an added behavior where :NoiceAll shows the following: 09:10:00 PM msg_show.shell_out ls Desktop (notice the appended "Desktop" which would be the first directory in my ~).
If I do :!ls / it'll show this: 09:14:32 PM msg_show.shell_out ls / bin, with bin also being the first directory in /.
Also, :!ls doesn't trigger the notification but :!ls / does as if a newline is required from the command output to trigger the notification.
Same issue, too.
Same issue.
Same issue here.
Just try using this config, it should work:
routes = {
{
view = "notify",
filter = {
event = "msg_show",
kind = {
"shell_out",
"shell_err",
},
},
}