: vim-location ( file line -- )
vim-command
vim-detach get-global
- [ run-detached ] [ run-process ] if drop ;
+ [ try-detached ] [ try-process ] if ;
"vim" vim-path set-global
[ vim-location ] edit-hook set-global
{ $values { "desc" "a launch descriptor" } }
{ $description "Launches a process and waits for it to complete. If it exits with a non-zero status code, throws a " { $link process-failed } " error." } ;
+{ run-process try-process run-detached } related-words
+
HELP: kill-process
{ $values { "process" process } }
{ $description "Kills a running process. Does nothing if the process has already exited." } ;
"Launching processes:"
{ $subsection run-process }
{ $subsection try-process }
+{ $subsection run-detached }
"Redirecting standard input and output to a pipe:"
{ $subsection <process-stream> }
{ $subsection with-process-stream } ;
run-detached
dup detached>> [ dup wait-for-process drop ] unless ;
-TUPLE: process-failed code ;
-
-: process-failed ( code -- * )
- \ process-failed boa throw ;
+ERROR: process-failed code ;
: try-process ( desc -- )
run-process wait-for-process dup zero?