diff --git a/lib/yap/shell/execution/shell_command_execution.rb b/lib/yap/shell/execution/shell_command_execution.rb
index <HASH>..<HASH> 100644
--- a/lib/yap/shell/execution/shell_command_execution.rb
+++ b/lib/yap/shell/execution/shell_command_execution.rb
@@ -6,7 +6,7 @@ module Yap::Shell::Execution
       possible_parameters = {
         command: command.str,
         args: command.args,
-        stdin: @stdin,
+        stdin: (@stdin != $stdin ? @stdin : StringIO.new),
         stdout: @stdout,
         stderr: @stderr,
         world: @world,
@@ -19,8 +19,13 @@ module Yap::Shell::Execution
         h
       end
 
-      Treefell['shell'].puts "shell command executing with params: #{params.inspect}"
-      command_result = func.call(**params)
+      Treefell['shell'].puts "shell command executing with params: #{params.inspect} $stdout=#{$stdout.inspect} $stderr=#{$stderr.inspect}"
+      pid = fork { func.call(**params) }
+
+      if wait
+        pid, status = Process.wait2(pid, Process::WUNTRACED)
+      end
+
       @stdout.close if @stdout != $stdout && !@stdout.closed?
       @stderr.close if @stderr != $stderr && !@stderr.closed?
     end
Fork shell command executions so they can be used in pipelines.

   history | grep foo

where "history" is a shell command.