Comments (10)
Im using v0.6.0-dev+26-g9c7e04eb3 on MacOS Big Sur
I printed the options
var on line 388 of lua.job and got:
{
args = { "auth", "status" },
command = "gh",
env = { "NO_COLOR=1" },
stdio = { <userdata 1>, <userdata 2>, <userdata 3> }
}
Also, printing self.pid
after the call to spawn
Im getting ENOENT: no such file or directory
When not using the env, I get:
{
args = { "auth", "status" },
command = "gh",
stdio = { <userdata 1>, <userdata 2>, <userdata 3> }
}
and self.pid
returns a correct pid
from plenary.nvim.
Can you run make test
(i dont know if plenary busted even works on mac os) so you might only want to try this:
plenary.nvim/tests/plenary/job_spec.lua
Lines 98 to 110 in ca51b68
And i am currently writing libuv c script to figure out where the problem is.
Another thing would be to write a luv script and check that. I will send you more snippets :)
from plenary.nvim.
Just found out that passing the absolute path to spawn
's command make it work:
local job =
Job:new(
{
enable_recording = true,
command = "/usr/local/bin/gh",
args = opts.args,
on_exit = vim.schedule_wrap(
function(j_self, _, _)
if mode == "async" and opts.cb then
local output = table.concat(j_self:result(), "\n")
local stderr = table.concat(j_self:stderr_result(), "\n")
opts.cb(output, stderr)
end
end
),
env = { NO_COLOR = 1 },
}
)
if mode == "sync" then
Which is inconvenient since I have to figure out the path myself before calling gh
.
Not sure what the reason is, maybe, passing an env table with only one var, overrides all PATH 🤔
from plenary.nvim.
Not sure what the reason is, maybe, passing an env table with only one var, overrides all PATH
Yep, that seems to be the case since gh
is no longer authenticated when setting the NO_COLOR
var.
I think the solution would be to merge vim.env
with the passed env
table. Does it make sense?
from plenary.nvim.
Maybe try { path = vim.env["PATH"], NO_COLOR = 1 }
from plenary.nvim.
We can't merge the tables we cant look in vim.env
table, because its a metatable.
from plenary.nvim.
Maybe try { path = vim.env["PATH"], NO_COLOR = 1 }
That seems to be enough to get gh
working. Thanks!
from plenary.nvim.
I would just pick the once you need? According to libuv docs if env is NULL it will take the parent environment: http://docs.libuv.org/en/v1.x/process.html#c.uv_process_options_t.env
from plenary.nvim.
Wondering why does it work for you on linux then 🤔
from plenary.nvim.
Can confirm that this happens to me too on MacOS M1 @pwntester
I used the absolute path solution that you mentioned and it worked fine for me now
from plenary.nvim.
Related Issues (20)
- Are some tests expected to Fail? HOT 1
- job:pid() returns function? HOT 1
- [Feat] `selene` linter support
- Unintentionally global variables stat and ret in async_lib?
- test_harness does not handle when exceptions are thrown in a spec HOT 1
- vim.tbl_islist deprecation HOT 1
- Plenary Callback issue in dependent plugin HOT 8
- too many curl processes spawned by plenary HOT 2
- Plenary's global `busted` definitions get picked up by LuaLS
- Attach debugger to test harness
- Build Failed HOT 2
- Build Failed HOT 1
- Plenary needs lua version 5.1 but disabled on homebrew HOT 8
- New release?
- Build failed? HOT 10
- [Feature] Improve `Path:normalize` to return shorter relative path using ../
- Curl module may accidentally reuse URL
- Plenary/Hererocks fails to compile HOT 1
- [Question] what is the point of checking executable right in scandir?
- Feature request: Expose status code to stream in curl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plenary.nvim.