Avoid cooked terminal mode (#1604)

as `:help system()` states

		When prepended by |:silent| the terminal will not be set to
		cooked mode.  This is meant to be used for commands that do
		not need the user to type.  It avoids stray characters showing
		up on the screen which require |CTRL-L| to remove. >
			:silent let f = system('ls *.vim')
This commit is contained in:
Enno
2025-12-09 00:49:13 +01:00
committed by GitHub
parent 879db51d09
commit ddc14a6a54

View File

@@ -718,7 +718,7 @@ function! s:get_git_root(dir)
return FugitiveWorkTree()
endif
let dir = len(a:dir) ? a:dir : substitute(split(expand('%:p:h'), '[/\\]\.git\([/\\]\|$\)')[0], '^fugitive://', '', '')
let root = systemlist('git -C ' . shellescape(dir) . ' rev-parse --show-toplevel')[0]
silent let root = systemlist('git -C ' . shellescape(dir) . ' rev-parse --show-toplevel')[0]
return v:shell_error ? '' : (len(a:dir) ? fnamemodify(a:dir, ':p') : root)
endfunction