vim-patch:8.2.0952: no simple way to interrupt Vim

Problem:    No simple way to interrupt Vim.
Solution:   Add the SigUSR1 autocommand, triggered by SIGUSR1. (Jacob Hayes,
            closes vim/vim#1718)
be5ee8686a
This commit is contained in:
Jan Edmund Lazo 2020-10-22 00:30:07 -04:00
parent df726408d7
commit d69a8a3fc4
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 16 additions and 0 deletions

View File

@ -450,6 +450,9 @@ Eval:
*js_decode()*
*v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead.
Events:
*SigUSR1* Use |Signal| to detect `SIGUSR1` signal instead.
Highlight groups:
*hl-StatusLineTerm* *hl-StatusLineTermNC* are unnecessary because Nvim
supports 'winhighlight' window-local highlights.

View File

@ -1897,4 +1897,17 @@ func Test_autocmd_FileReadCmd()
delfunc ReadFileCmd
endfunc
" Tests for SigUSR1 autocmd event, which is only available on posix systems.
func Test_autocmd_sigusr1()
CheckUnix
let g:sigusr1_passed = 0
au Signal SIGUSR1 let g:sigusr1_passed = 1
call system('/bin/kill -s usr1 ' . getpid())
call WaitForAssert({-> assert_true(g:sigusr1_passed)})
au! Signal
unlet g:sigusr1_passed
endfunc
" vim: shiftwidth=2 sts=2 expandtab