mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Enable closing stdin by pressing CTRL-D
This provides a way to use commands like :Git hash-object --stdin without a PTY, which is not to say that there are any such commands that one would actually want to use. It also has debugging applications.
This commit is contained in:
@@ -2303,13 +2303,24 @@ function! s:RunWait(state, job) abort
|
|||||||
if !exists('*jobwait')
|
if !exists('*jobwait')
|
||||||
sleep 1m
|
sleep 1m
|
||||||
endif
|
endif
|
||||||
let peek = getchar(1)
|
if !get(a:state, 'closed')
|
||||||
if peek != 0 && !(has('win32') && peek == 128)
|
let peek = getchar(1)
|
||||||
let c = getchar()
|
if peek != 0 && !(has('win32') && peek == 128)
|
||||||
let c = type(c) == type(0) ? nr2char(c) : c
|
let c = getchar()
|
||||||
call s:RunSend(a:job, c)
|
let c = type(c) == type(0) ? nr2char(c) : c
|
||||||
if !a:state.pty
|
if c ==# "\<C-D>"
|
||||||
echon c
|
let a:state.closed = 1
|
||||||
|
if type(a:job) ==# type(0)
|
||||||
|
call chanclose(a:job, 'stdin')
|
||||||
|
else
|
||||||
|
call ch_close_in(a:job)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
call s:RunSend(a:job, c)
|
||||||
|
if !a:state.pty
|
||||||
|
echon c
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
|
|||||||
Reference in New Issue
Block a user