diff --git a/lib/cli.js b/lib/cli.js
index <HASH>..<HASH> 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -80,7 +80,6 @@ module.exports = function (options) {
     var slap = new Slap(opts);
 
     Promise.all(opts._.map(function (path, i) {
-      slap.fileBrowser.refresh(path, _.noop);
       return slap.open(path.toString(), !i);
     })).done();
 
diff --git a/lib/ui/Slap.js b/lib/ui/Slap.js
index <HASH>..<HASH> 100644
--- a/lib/ui/Slap.js
+++ b/lib/ui/Slap.js
@@ -11,6 +11,8 @@ var util = require('slap-util');
 var BaseWidget = require('base-widget');
 var Editor = require('editor-widget');
 
+var fs = require('fs');
+
 function Slap (opts) {
   var self = this;
 
@@ -52,6 +54,10 @@ Slap.prototype.open = Promise.method(function (filePath, current) {
 
   var pane = self.paneForPath(filePath);
   pane = pane || new Pane({parent: self});
+  if (fs.lstatSync(filePath).isDirectory()) { // check if filePath is a directory
+    self.fileBrowser.refresh(filePath, _.noop); // open the directory on the sidebar
+    return;
+  } 
   return pane.editor.open(filePath)
     .then(function () {
       if (current) pane.setCurrent();
fix(slap): fix bug when given 'path/to/dir', slap opens the given directory instead of throwing an error EISDIR.