What
current_file() in the statusline computes the display path using vim.uv.cwd(), which returns the OS-level process cwd — it ignores any :lcd window-local directory override.
Where
lua/config/statusline.lua line 256:
local root_path = vim.uv.cwd() or ""
Why it matters
init.lua explicitly documents :lcd as a useful feature:
"lcd allows you to set root directory for current window, which might be useful in some cases"
But after :lcd /some/subdir, the statusline still shows paths relative to the original global cwd rather than the window-local one. The path trimming logic on lines 258–268 (home_path:find(root_dir)) can silently produce wrong-looking paths or fall back to showing the full ~-prefixed path whenever the lcd doesn't match the global cwd's trailing component.
Recommended action
Replace vim.uv.cwd() with vim.fn.getcwd(0, 0), which returns the local cwd for the current window (falls back to global cwd if no lcd is set):
-local root_path = vim.uv.cwd() or ""
+local root_path = vim.fn.getcwd(0, 0)
vim.fn.getcwd() always returns a string so the or "" fallback is not needed. This is a one-liner change but the right behaviour depends on whether you want per-window relative paths — hence the issue rather than a direct PR.
What
current_file()in the statusline computes the display path usingvim.uv.cwd(), which returns the OS-level process cwd — it ignores any:lcdwindow-local directory override.Where
lua/config/statusline.lualine 256:Why it matters
init.luaexplicitly documents:lcdas a useful feature:But after
:lcd /some/subdir, the statusline still shows paths relative to the original global cwd rather than the window-local one. The path trimming logic on lines 258–268 (home_path:find(root_dir)) can silently produce wrong-looking paths or fall back to showing the full~-prefixed path whenever the lcd doesn't match the global cwd's trailing component.Recommended action
Replace
vim.uv.cwd()withvim.fn.getcwd(0, 0), which returns the local cwd for the current window (falls back to global cwd if nolcdis set):vim.fn.getcwd()always returns a string so theor ""fallback is not needed. This is a one-liner change but the right behaviour depends on whether you want per-window relative paths — hence the issue rather than a direct PR.