mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Extract helper to determine PTY availability
I constantly have to ask about this to troubleshoot bug reports, so make it easier to determine. Also rename g:fugitive_pty to make it clearer that it's not a preference but a debugging tool.
This commit is contained in:
@@ -3433,6 +3433,11 @@ augroup fugitive_job
|
||||
\ endfor
|
||||
augroup END
|
||||
|
||||
function! fugitive#CanPty() abort
|
||||
return get(g:, 'fugitive_pty_debug_override',
|
||||
\ has('unix') && !has('win32unix') && (has('patch-8.0.0744') || has('nvim')) && fugitive#GitVersion() !~# '\.windows\>')
|
||||
endfunction
|
||||
|
||||
function! fugitive#PagerFor(argv, ...) abort
|
||||
let args = a:argv
|
||||
if empty(args)
|
||||
@@ -3609,7 +3614,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
||||
endif
|
||||
if s:run_jobs
|
||||
call extend(env, {'COLUMNS': '' . (&columns - 1)}, 'keep')
|
||||
let state.pty = allow_pty && get(g:, 'fugitive_pty', has('unix') && !has('win32unix') && (has('patch-8.0.0744') || has('nvim')) && fugitive#GitVersion() !~# '\.windows\>')
|
||||
let state.pty = allow_pty && fugitive#CanPty()
|
||||
if !state.pty
|
||||
let args = s:AskPassArgs(dir) + args
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user