From 08920a32881c87759f1afcc6714814821423695c Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Wed, 14 Jul 2021 14:00:04 -0600 Subject: [PATCH] Fix shell not reverting to oldshell --- lua/lazygit.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 5480de4..eb67cbf 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -26,6 +26,7 @@ local function project_root_dir() -- try submodule first local gitdir = fn.system('cd "' .. fn.expand('%:p:h') .. '" && git rev-parse --show-superproject-working-tree') if gitdir ~= '' then + vim.o.shell = oldshell return trim(gitdir) end @@ -33,6 +34,7 @@ local function project_root_dir() local gitdir = fn.system('cd "' .. fn.expand('%:p:h') .. '" && git rev-parse --show-toplevel') local isgitdir = fn.matchstr(gitdir, '^fatal:.*') == '' if isgitdir then + vim.o.shell = oldshell return trim(gitdir) end @@ -41,6 +43,7 @@ local function project_root_dir() 'cd "' .. fn.fnamemodify(fn.resolve(fn.expand('%:p')), ':h') .. '" && git rev-parse --show-toplevel') isgitdir = fn.matchstr(gitdir, '^fatal:.*') == '' if isgitdir then + vim.o.shell = oldshell return trim(gitdir) end