Skip to content

Commit 92f2699

Browse files
authored
fix(utils): properly pass cwd as argument to system wrapper (#1458)
1 parent 3ee1a96 commit 92f2699

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lua/CopilotChat/config/functions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ return {
408408

409409
resolve = function(input, source)
410410
local cmd = { 'bash', '-c', input.command }
411-
local out = utils.system(cmd, { cwd = source.cwd() })
411+
local out = utils.system(cmd, source.cwd())
412412

413413
return {
414414
{

lua/CopilotChat/utils.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ end
125125
--- Call a system command
126126
---@param cmd table The command
127127
---@async
128-
M.system = async.wrap(function(cmd, callback)
129-
vim.system(cmd, { text = true }, callback)
130-
end, 2)
128+
M.system = async.wrap(function(cmd, cwd, callback)
129+
vim.system(cmd, { cwd = cwd, text = true }, callback)
130+
end, 3)
131131

132132
--- Schedule a function only when needed (not on main thread)
133133
---@param callback function The callback

0 commit comments

Comments
 (0)