Skip to content

Commit a801c12

Browse files
johannes-granerthienandangthanh
authored andcommitted
fix(provider): add pty for jobstart to fix devpod setup
1 parent 444d908 commit a801c12

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

lua/remote-nvim/providers/devpod/devpod_provider.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ function DevpodProvider:_handle_provider_setup()
158158
if self._devpod_provider then
159159
self.local_provider:run_command(
160160
("%s provider list --output json"):format(remote_nvim.config.devpod.binary),
161-
("Checking if the %s provider is present"):format(self._devpod_provider)
161+
("Checking if the %s provider is present"):format(self._devpod_provider),
162+
nil,
163+
nil,
164+
false,
165+
false
162166
)
163167
local stdout = self.local_provider.executor:job_stdout()
164168
local provider_list_output = vim.json.decode(vim.tbl_isempty(stdout) and "{}" or table.concat(stdout, "\n"))

lua/remote-nvim/providers/executor.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ local Executor = require("remote-nvim.middleclass")("Executor")
1111
---@field additional_opts? string[] Additional options to pass to the `tar` command. See `man tar` for possible options
1212

1313
---@class remote-nvim.provider.Executor.JobOpts
14+
---@field pty boolean? Whether to set pty option
1415
---@field additional_conn_opts string? Connection options
1516
---@field stdout_cb function? Standard output callback
1617
---@field exit_cb function? On exit callback
@@ -76,7 +77,7 @@ function Executor:run_executor_job(command, job_opts)
7677

7778
self:reset() -- Reset job internal state variables
7879
self._job_id = vim.fn.jobstart(command, {
79-
pty = true,
80+
pty = job_opts.pty == nil or job_opts.pty,
8081
on_stdout = function(_, data_chunk)
8182
self:process_stdout(data_chunk, job_opts.stdout_cb)
8283
end,

lua/remote-nvim/providers/provider.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,8 @@ end
10581058
---@param extra_opts string? Extra options to pass to the underlying command
10591059
---@param exit_cb function? Exit callback to execute
10601060
---@param on_local_executor boolean? Should run this command on the local executor
1061-
function Provider:run_command(command, desc, extra_opts, exit_cb, on_local_executor)
1061+
---@param pty boolean? Whether to use pty or not
1062+
function Provider:run_command(command, desc, extra_opts, exit_cb, on_local_executor, pty)
10621063
self.logger.fmt_debug("[%s][%s] Running %s", self.provider_type, self.unique_host_id, command)
10631064
on_local_executor = on_local_executor or false
10641065
local executor = on_local_executor and self.local_executor or self.executor
@@ -1075,6 +1076,7 @@ function Provider:run_command(command, desc, extra_opts, exit_cb, on_local_execu
10751076
exit_cb = exit_cb(section_node)
10761077
end
10771078
executor:run_command(command, {
1079+
pty = pty == nil or pty,
10781080
additional_conn_opts = extra_opts,
10791081
exit_cb = exit_cb,
10801082
stdout_cb = self:_get_stdout_fn_for_node(section_node),

0 commit comments

Comments
 (0)