Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated stty session state save to check for an interactive terminal #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rye/box.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rye/hop.rb
Expand Up @@ -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
Expand Down