     $rootScope.$on('$stateChangeStart', (event, toState, toParams, fromState, fromParams) ->
         if toState.name isnt "terminal"
             $("#terminal").appendTo(".terminalOuter")
+            $.terminal.active()?.scroll_to_bottom()
     )
 
     $rootScope.$on('$viewContentLoaded', (event, toState, toParams, fromState, fromParams) ->
         if $state.current.name is "terminal"
             $("#terminal").appendTo("#terminalTab")
+            $.terminal.active()?.scroll_to_bottom()
     )
 
     $scope.$watch((-> $mdMedia('gt-sm')), (big) ->

            prompt: ''
        )

        terminal().scroll_to_bottom()

    listen.startDebugging = ->
        $scope.debugging = yes


        $scope.astString = ast

        $scope.instructionsString = instructions

    listen.executionFinish = ({ status }) ->
        # TODO: Show status somehow
