         input = @state.input.trim()
         if not input
             return
+        error = BAD_COMMANDS[input.split(' ')[0]]
+        if error
+            @setState
+                state : 'edit'
+                error : error
+            return
+
         input0 = input + '\necho $HOME "`pwd`"'
         @setState(state:'run')
 
         @_id = (@_id ? 0) + 1
         id = @_id
+        start_time = new Date()
         salvus_client.exec
             project_id : @props.project_id
             command    : input0
-            timeout    : 10
+            timeout    : EXEC_TIMEOUT
             max_output : 100000
             bash       : true
             path       : @props.current_path

                    return
                if err
                    @setState(error:err, state:'edit')
                else
                    if output.stdout
                        # Find the current path

    maxHeight : '450px'
    overflow  : 'auto'

BAD_COMMANDS =
    sage    : "Create a Sage worksheet instead,\nor type 'sage' in a full terminal."
    ipython : "Create a Jupyter notebook instead,\nor type 'ipython' in a full terminal."
    gp      : "Create a Sage worksheet in GP mode\nor type 'gp' in a full terminal."
    vi      : "Type vi in a full terminal instead,\nor just click on the file in the listing."
    vim     : "Type vim in a full terminal instead,\nor just click on the file in the listing."
    emacs   : "Type emacs in a full terminal instead,\nor just click on the file in the listing."
    open    : "The open command is not yet supported\nin the miniterminal.  See\nhttps://github.com/sagemathinc/smc/issues/230"

EXEC_TIMEOUT = 10 # in seconds    

exports.MiniTerminal = MiniTerminal = rclass
    displayName : 'MiniTerminal'

