diff --git a/lib/proxy/base.lua b/lib/proxy/base.lua index 584a7cf..7bedfb8 100644 --- a/lib/proxy/base.lua +++ b/lib/proxy/base.lua @@ -169,8 +169,10 @@ function Proxy:process_command() self.request_timer:stop() self:send_response(req_id, "Timed out", addr) self.current_request = nil - self:on_stdout(self.buffer) - self.buffer = nil + if self.buffer ~= nil then + self:on_stdout(self.buffer, '') + self.buffer = nil + end self:process_command() end)) end diff --git a/lib/proxy/pdb.lua b/lib/proxy/pdb.lua index 15bea10..7ea7925 100644 --- a/lib/proxy/pdb.lua +++ b/lib/proxy/pdb.lua @@ -5,6 +5,6 @@ package.path = dir .. '/?.lua;' .. package.path local Proxy = require'base' -local proxy = Proxy.new('[\n\r]%(Pdb%+*%) ') +local proxy = Proxy.new('[\n\r]%(Pdb%+*%) *') proxy:start() vim.wait(10^9, function() return false end) diff --git a/lua/nvimgdb/backend/pdb.lua b/lua/nvimgdb/backend/pdb.lua index 3209dcc..56bca65 100644 --- a/lua/nvimgdb/backend/pdb.lua +++ b/lua/nvimgdb/backend/pdb.lua @@ -154,7 +154,11 @@ end ---@return string[] command to launch the debugger with termopen() function C.get_launch_cmd(client_cmd, tmp_dir, proxy_addr) local _ = tmp_dir - local cmd = {'nvim', '--clean', '-u', 'NONE', '-l', utils.get_plugin_file_path('lib', 'proxy', 'pdb.lua'), '-a', proxy_addr} + local cmd = { + utils.is_windows and 'nvim.exe' or 'nvim', '--clean', '-u', 'NONE', + '-l', utils.get_plugin_file_path('lib', 'proxy', 'pdb.lua'), + '-a', proxy_addr + } -- Append the rest of arguments for i = 1, #client_cmd do cmd[#cmd + 1] = client_cmd[i]