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,15 +2303,26 @@ function! s:RunWait(state, job) abort
|
||||
if !exists('*jobwait')
|
||||
sleep 1m
|
||||
endif
|
||||
if !get(a:state, 'closed')
|
||||
let peek = getchar(1)
|
||||
if peek != 0 && !(has('win32') && peek == 128)
|
||||
let c = getchar()
|
||||
let c = type(c) == type(0) ? nr2char(c) : c
|
||||
if c ==# "\<C-D>"
|
||||
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
|
||||
endwhile
|
||||
sleep 1m
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user