From 8f1f93350e717d1d4341be0c495e2c8322d7eceb Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Thu, 21 Apr 2022 23:41:00 +0800 Subject: [PATCH] fix(shell): fix default cwd of terminal close https://github.com/SpaceVim/SpaceVim/issues/4644 --- autoload/SpaceVim/layers/shell.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/SpaceVim/layers/shell.vim b/autoload/SpaceVim/layers/shell.vim index 897dc3d9f..0d022d526 100644 --- a/autoload/SpaceVim/layers/shell.vim +++ b/autoload/SpaceVim/layers/shell.vim @@ -159,6 +159,11 @@ function! s:open_default_shell(open_with_file_cwd) abort endif else let path = SpaceVim#plugins#projectmanager#current_root() + " if the current file is not in a project, the projectmanager return empty + " string. Then use current directory as default cwd. + if empty(path) + let path = getcwd() + endif endif " look for already opened terminal windows