From 6258d50b09f9ae087317e392efe7c05a7323492d Mon Sep 17 00:00:00 2001 From: James Trew <66286082+jamestrew@users.noreply.github.com> Date: Mon, 10 Apr 2023 06:23:51 -0400 Subject: [PATCH] fix: escape cwd symbols for `async_oneshot_finder` (#2460) --- lua/telescope/_.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/telescope/_.lua b/lua/telescope/_.lua index 6800c9e..e9b5e64 100644 --- a/lua/telescope/_.lua +++ b/lua/telescope/_.lua @@ -21,7 +21,7 @@ function AsyncJob.new(opts) self.stderr = opts.stderr or M.NullPipe() if opts.cwd and opts.cwd ~= "" then - self.uv_opts.cwd = vim.fn.expand(opts.cwd) + self.uv_opts.cwd = vim.fn.expand(vim.fn.escape(opts.cwd, "$")) -- this is a "illegal" hack for windows. E.g. If the git command returns `/` rather than `\` as delimiter, -- vim.fn.expand might just end up returning an empty string. Weird -- Because empty string is not allowed in libuv the job will not spawn. Solution is we just set it to opts.cwd