         if not IS_MOBILE
             @textarea.on 'blur', =>
                 if @_focusing?          # see comment in @focus.
-                    delete @_focusing
-                    @textarea.focus()   # steal it back.
+                    @_focus_hidden_textarea()
                 else
                     @blur()
 


        e = @element.find(".salvus-console-terminal")

        e.mousedown () => @pause_rendering(false)

        e.mouseup () =>
            if not getSelection().toString()

                # nothing in the terminal is selected
                @unpause_rendering()

        e.on 'copy', =>
            @unpause_rendering()
            setTimeout(@focus, 0)  # must happen in next cycle or copy will not work due to loss of focus.

    _init_colors: () =>
        colors = Terminal.color_schemes[@opts.color_scheme].colors
