-
-
Save thinca/5511837 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signal.trap(:QUIT) do | |
puts "QUIT signal sent." | |
exit 0 | |
end | |
puts "Signal.list['QUIT'] => #{Signal.list['QUIT']}" | |
puts "My pid is #{$$}\n" | |
loop do | |
puts 'I\'m alive!' | |
# print "\a" # bell | |
sleep 2 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:script_path = substitute(substitute(expand('<sfile>'), '\.vim$', '.rb', ''), '\\', '/', 'g') | |
echo s:script_path | |
function! TestRun() | |
let s:vimproc = vimproc#popen2('ruby ' . s:script_path . ' 12345') | |
echo 'launched. (pid:' . s:vimproc.pid . ')' | |
endfunction | |
function! TestKill() | |
call s:vimproc.kill(3) | |
call s:vimproc.waitpid() | |
echo 'closed. (pid:' . s:vimproc.pid . ')' | |
" debug for vimproc#kill | |
" kill seems make zombie process... | |
echo 'last errmsg : ' . vimproc#get_last_errmsg() | |
echo 'last status : ' . vimproc#get_last_status() | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment