Skip to content

Instantly share code, notes, and snippets.

@thinca
Forked from supermomonga/test.rb
Last active December 16, 2015 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinca/5511837 to your computer and use it in GitHub Desktop.
Save thinca/5511837 to your computer and use it in GitHub Desktop.
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
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