From 67eece6d74f071035ca7b934a753d71d1677dd9b Mon Sep 17 00:00:00 2001 From: Adam K <105152139+akthe-at@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:31:41 -0500 Subject: [PATCH] fix(extras.python): avoid launching extra console with dap on Windows (#3723) On Windows, when using dap, python.exe will launch an extra console. If you target pythonw.exe this avoids that. Explanation source: https://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe ## What is this PR for? Modify which exe is targeted for python + dap on windows. If you use python.exe an extra console launches (eg, nvim is runnining on Wezterm, boot up dap, and as a result an external console (usually through windows terminal or built-in console terminal) will launch (dap still runs in the original window). This is avoided with pythonw.exe ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 9aeca2a4..399f28e3 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -93,7 +93,7 @@ return { }, config = function() if vim.fn.has("win32") == 1 then - require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/python.exe")) + require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/pythonw.exe")) else require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python")) end