From 9d42b9f468c5c9dcca20affca2a24cf425c346f2 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Sun, 18 Jan 2015 23:38:51 -0700 Subject: [PATCH] Change shell to use bash || sh --- app/pods/container/shell/route.js | 2 +- app/pods/container/shell/view.js | 7 ++++++- app/pods/overlay/route.js | 9 +++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/pods/container/shell/route.js b/app/pods/container/shell/route.js index 4e92d6d55a..176649d842 100644 --- a/app/pods/container/shell/route.js +++ b/app/pods/container/shell/route.js @@ -7,7 +7,7 @@ export default OverlayRoute.extend({ attachStdin: true, attachStdout: true, tty: true, - command: ['/bin/sh'], + command: ["/bin/sh","-c",'[ -x /bin/bash ] && exec /bin/bash || exec /bin/sh'], }; var promise = container.doAction('execute',opt).then(function(exec) { exec.set('instance', container); diff --git a/app/pods/container/shell/view.js b/app/pods/container/shell/view.js index 0b3649a8be..ac3f305c4e 100644 --- a/app/pods/container/shell/view.js +++ b/app/pods/container/shell/view.js @@ -4,6 +4,7 @@ export default Overlay.extend({ templateName: 'container/shell', status: 'Connecting...', + useClosed: false, socket: null, term: null, @@ -49,13 +50,17 @@ export default Overlay.extend({ socket.onclose = function() { self.set('status','Closed'); term.destroy(); - self.send('overlayClose'); + if ( !self.get('userClosed') ) + { + self.send('overlayClose'); + } }; }; }, willDestroyElement: function() { this.set('status','Closed'); + this.set('userClosed',true); var term = this.get('term'); if (term) diff --git a/app/pods/overlay/route.js b/app/pods/overlay/route.js index 7eeaaaeba9..6cf55739c0 100644 --- a/app/pods/overlay/route.js +++ b/app/pods/overlay/route.js @@ -27,18 +27,19 @@ export default Ember.Route.extend({ actions: { goToPrevious: function() { - var route = this.get('previousRoute'); + var self = this; + var route = self.get('previousRoute'); if ( route === 'loading' ) { route = 'index'; } - var args = (this.get('previousParams')||[]).slice(); + var args = (self.get('previousParams')||[]).slice(); args.unshift(route); - var res = this.transitionTo.apply(this,args); + var res = self.transitionTo.apply(self,args); res.catch(function() { - this.transitionTo('index'); + self.transitionTo('index'); }); }, }