lib/contexto/ssh.rb in contexto-0.4.2 vs lib/contexto/ssh.rb in contexto-0.4.3
- old
+ new
@@ -13,12 +13,16 @@
@bastion_user = ''
@user_name = 'ec2-user'
@options = {}
end
+ def term
+ 'env TERM=xterm'
+ end
+
def console
- exec "#{ssh_cmd} #{cmd} bin/rails c'\""
+ exec "#{ssh_cmd} #{cmd} #{term} bin/rails c'\""
end
def ssh
exec "#{ssh_cmd}\""
end
@@ -26,14 +30,14 @@
def rake(rake_cmd)
exec "#{ssh_cmd} #{cmd} #{rake_cmd}'\""
end
def bash
- exec "#{ssh_cmd} #{cmd} /bin/bash'\""
+ exec "#{ssh_cmd} #{cmd} #{term} /bin/bash'\""
end
def ssh_cmd
- "ssh -t -A #{@bastion_host} \"ssh -t ec2-user@#{ipaddress} "
+ "TERM=xterm ssh -t -A #{@bastion_host} \"ssh -t ec2-user@#{ipaddress} "
end
def cmd
"'docker exec -it \\$(docker ps | grep ecs-#{cluster}-#{service}-.*-#{container} | cut -d\\ -f1) "
end