lib/sup/modes/text_mode.rb in sup-0.20.0 vs lib/sup/modes/text_mode.rb in sup-0.21.0

- old
+ new

@@ -22,11 +22,16 @@ def pipe command = BufferManager.ask(:shell, "pipe command: ") return if command.nil? || command.empty? - output = pipe_to_process(command) do |stream| + output, success = pipe_to_process(command) do |stream| @text.each { |l| stream.puts l } + end + + unless success + BufferManager.flash "Invalid command: '#{command}' is not an executable" + return end if output BufferManager.spawn "Output of '#{command}'", TextMode.new(output.ascii) else