diff --git a/lib/rye/box.rb b/lib/rye/box.rb index 4475753..c4f457b 100644 --- a/lib/rye/box.rb +++ b/lib/rye/box.rb @@ -155,8 +155,8 @@ def initialize(host='localhost', opts={}) @rye_password_prompt = @rye_opts.delete(:password_prompt) # Store the state of the terminal - @rye_stty_save = `stty -g`.chomp rescue nil - + @rye_stty_save = `stty -g`.chomp if STDIN.tty? rescue nil + unless @rye_templates.nil? require @rye_templates.to_s # should be :erb end diff --git a/lib/rye/hop.rb b/lib/rye/hop.rb index c891e0d..507d0b6 100644 --- a/lib/rye/hop.rb +++ b/lib/rye/hop.rb @@ -123,7 +123,7 @@ def initialize(host, opts={}) @rye_templates = @rye_opts.delete(:templates) # Store the state of the terminal - @rye_stty_save = `stty -g`.chomp rescue nil + @rye_stty_save = `stty -g`.chomp if STDIN.tty? rescue nil unless @rye_templates.nil? require @rye_templates.to_s # should be :erb