From 2f935df27b6ff74824e7de5bcf6138c2e3b06ae8 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 19 Mar 2026 18:44:25 +0800 Subject: [PATCH] expand "." to cwd on Windows `LazyVim.root.detectors.pattern` returns `.` when the pattern matches in the current directory. If we do not expand the directory, Snacks will consider the current terminal window is for another directory. Instead of hiding the window, Snacks opens a new terminal window instead. --- lua/lazyvim/util/root.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index 9ce96141..9865756f 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -78,7 +78,11 @@ function M.realpath(path) if path == "" or path == nil then return nil end - path = vim.fn.has("win32") == 0 and vim.uv.fs_realpath(path) or path + if vim.fn.has("win32") == 0 then + path = vim.uv.fs_realpath(path) + elseif path == "." then + path = vim.uv.cwd() + end return LazyVim.norm(path) end