mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Don't use job pty unless Vim supports it
Closes https://github.com/tpope/vim-fugitive/issues/1444
This commit is contained in:
@@ -2383,7 +2383,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
let env = get(opts, 'env', {})
|
let env = get(opts, 'env', {})
|
||||||
if s:RunJobs()
|
if s:RunJobs()
|
||||||
let state = {'dir': dir, 'mods': s:Mods(a:mods), 'temp': tempname(), 'log': []}
|
let state = {'dir': dir, 'mods': s:Mods(a:mods), 'temp': tempname(), 'log': []}
|
||||||
let state.pty = get(g:, 'fugitive_pty', has('unix'))
|
let state.pty = get(g:, 'fugitive_pty', has('unix') && (has('patch-8.0.0744') || has('nvim')))
|
||||||
if !state.pty
|
if !state.pty
|
||||||
let args = s:AskPassArgs(dir) + args
|
let args = s:AskPassArgs(dir) + args
|
||||||
endif
|
endif
|
||||||
@@ -2422,9 +2422,11 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
if exists('*job_start')
|
if exists('*job_start')
|
||||||
let jobopts = {
|
let jobopts = {
|
||||||
\ 'mode': 'raw',
|
\ 'mode': 'raw',
|
||||||
\ 'pty': state.pty,
|
|
||||||
\ 'callback': function('s:RunReceive', [state]),
|
\ 'callback': function('s:RunReceive', [state]),
|
||||||
\ }
|
\ }
|
||||||
|
if state.pty
|
||||||
|
let jobopts.pty = 1
|
||||||
|
endif
|
||||||
if len(env)
|
if len(env)
|
||||||
let jobopts.env = env
|
let jobopts.env = env
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user