 $ = require './jquery-extensions'
 _ = require './underscore-extensions'
 ipc = require 'ipc'
-remote = require 'remote'
+shell = require 'shell'
 Subscriber = require './subscriber'
 fsUtils = require './fs-utils'
 

    @subscribeToCommand $(document), 'core:focus-next', @focusNext
    @subscribeToCommand $(document), 'core:focus-previous', @focusPrevious

    @subscribe $(document), 'keydown', keymap.handleKeyEvent

    @subscribe $(document), 'drop', onDrop
    @subscribe $(document), 'dragover', (e) ->

    @subscribe $(window), 'focus', -> $("body").removeClass('is-blurred')
    @subscribe $(window), 'blur',  -> $("body").addClass('is-blurred')
    @subscribe $(window), 'window:open-path', (event, {pathToOpen, initialLine}) ->
      atom.rootView?.open(pathToOpen, {initialLine}) unless fsUtils.isDirectorySync(pathToOpen)
    @subscribe $(window), 'beforeunload', =>
      confirmed = atom.rootView?.confirmClose()
      atom.hide() if confirmed and not @reloadRequested and atom.getCurrentWindow().isWebViewFocused()
      @reloadRequested = false
      confirmed
    @subscribe $(window), 'unload', ->
