]> git.mdlowis.com Git - projs/tide.git/commitdiff
launch commands in the background instead of foreground with tide-fetch
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 19 Jul 2017 17:01:48 +0000 (13:01 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 19 Jul 2017 17:01:48 +0000 (13:01 -0400)
tide-fetch.rb

index a92ea665c86a51b7b1a5264716dc70f70e770aaf..add42719bc2eac4329e9802cff1c247f530facdc 100755 (executable)
@@ -27,14 +27,19 @@ def match(regex)
   end
 end
 
+def spawn(cmd)
+  job = fork { exec cmd }
+  Process.detach(job)
+end
+
 def open_file
-  system("xdg-open #{$item}")
+  spawn("xdg-open #{$item}")
 end
 
 def open_with(app)
   app = Apps[app] || ENV[app.to_s.upcase]
   raise RuleError.new() if not app
-  system("#{app} #{$item}")
+  spawn("#{app} #{$item}")
 end
 
 def find_files(file)