diff --git a/README.md b/README.md index 06719fb..bdf05a0 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ lua require('dap-go').setup { -- whether the dlv process to be created detached or not. there is -- an issue on Windows where this needs to be set to false -- otherwise the dlv server creation will fail. - detached = true, + detached = vim.fn.has("win32") == 0, -- the current working directory to run dlv from, if other than -- the current working directory. cwd = nil, diff --git a/lua/dap-go.lua b/lua/dap-go.lua index a365043..eb5eaf6 100644 --- a/lua/dap-go.lua +++ b/lua/dap-go.lua @@ -13,7 +13,9 @@ local default_config = { port = "${port}", args = {}, build_flags = "", - detached = true, + -- Automativally handle the issue on Windows where delve needs + -- to be run in attched mode or it will fail (actually crashes). + detached = vim.fn.has("win32") == 0, }, }