             e.find(".salvus-console-cursor-focus").removeClass("salvus-console-cursor-focus").addClass("salvus-console-cursor-blur")
 
     focus: () =>
+        if @is_focused
+            return
         focused_console = @
+        @is_focused = true
 
         $(@terminal.element).focus()
         if not @_character_height?

client_keydown = (ev) ->
    focused_console?.client_keydown(ev)

    
class Console extends EventEmitter
    constructor: (opts={}) ->
        @opts = defaults opts,

                )
        else
            # TODO:  *leak!!* these should be deleted when the terminal is closed
            $(document).on 'mousedown', (e) =>
                t = $(e.target)
                if t.hasParent($(@terminal.element)).length > 0
