From df7ba07b0f060940c3b9cff0018bf3b40aafd743 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Wed, 28 Oct 2020 01:39:57 -0600 Subject: [PATCH] Support fish shell --- lua/lazygit.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 71c4925..2d86cc1 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -18,6 +18,10 @@ end --- Get project_root_dir for git repository local function project_root_dir() + -- always use bash + local oldshell = vim.o.shell + vim.o.shell = 'bash' + -- try file location first local gitdir = fn.system('cd "' .. fn.expand('%:p:h') .. '" && git rev-parse --show-toplevel') local isgitdir = fn.matchstr(gitdir, '^fatal:.*') == "" @@ -32,6 +36,9 @@ local function project_root_dir() return trim(gitdir) end + -- revert to old shell + vim.o.shell = oldshell + -- just return current working directory return fn.getcwd(0, 0) end