From 40872a9555b7a04d0eb8dc812ca7d054118fdc05 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 26 Jan 2020 08:01:34 -0500 Subject: [PATCH] Don't use job pty unless Vim supports it Closes https://github.com/tpope/vim-fugitive/issues/1444 --- autoload/fugitive.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 721d448..cf11203 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2383,7 +2383,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort let env = get(opts, 'env', {}) if s:RunJobs() 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 let args = s:AskPassArgs(dir) + args endif @@ -2422,9 +2422,11 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort if exists('*job_start') let jobopts = { \ 'mode': 'raw', - \ 'pty': state.pty, \ 'callback': function('s:RunReceive', [state]), \ } + if state.pty + let jobopts.pty = 1 + endif if len(env) let jobopts.env = env endif