We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EBADF: bad file descriptor
NeoVim Version
NVIM v0.10.4 Build type: Release LuaJIT 2.1.1713484068 Run "nvim -V1 -v" for more info
Describe the bug
Running a command with nio.process.run on windows does not read stdout:
nio.process.run
local text = "hello" local exe = "echo" local nio = require("nio") nio.run(function() local nio_proc = require("nio").process local echo_proc, echo_err = nio_proc.run({ cmd = exe, args = { text }, }) local echo_output, echo_read_err = echo_proc.stdout.read() assert(echo_read_err == nil, "read err: " .. echo_read_err) end)
To Reproduce Please provide a minimal init.lua to reproduce which can be run as the following:
init.lua
nvim --clean -u minimal.lua
You can edit the following example file to include your adapters and other required setup.
vim.env.LAZY_STDPATH = ".repro" load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() require("lazy.minit").repro({ spec = { { "nvim-neotest/nvim-nio", version = "v1.10.1", lazy = false, }, }, }) local text = "hello" local exe = "echo" local echo_out = vim.system({ exe, text }, { text = true }):wait() -- vim.system({ "echo", "hello" }, { text = true }):wait() assert(echo_out.code == 0) assert(echo_out.stdout) assert(vim.trim(echo_out.stdout) == text, "stdout: " .. echo_out.stdout .. " != text: " .. text) local nio = require("nio") nio.run(function() local nio_proc = require("nio").process local echo_proc, echo_err = nio_proc.run({ cmd = exe, args = { text }, }) assert(echo_proc ~= nil) assert(echo_proc.result(true) == 0) local echo_output, echo_read_err = echo_proc.stdout.read() -- FIXME: read error assert(echo_read_err == nil, "read err: " .. echo_read_err) -- assert(echo_output and echo_output ~= "", "echo output is empty") end)
Steps to reproduce the behavior:
mkdir -Force "$env:TEMP\test-neovim-nio" cd "$env:TEMP\test-neovim-nio" nvim --clean -u minimal.lua
Please provide example test files to reproduce.
Expected behavior
stdout.read() should return the output of the command
stdout.read()
The text was updated successfully, but these errors were encountered:
rcarriga
No branches or pull requests
NeoVim Version
Describe the bug
Running a command with
nio.process.run
on windows does not read stdout:To Reproduce
Please provide a minimal
init.lua
to reproduce which can be run as the following:You can edit the following example file to include your adapters and other required setup.
Steps to reproduce the behavior:
Please provide example test files to reproduce.
Expected behavior
stdout.read()
should return the output of the commandThe text was updated successfully, but these errors were encountered: