Skip to content
Open an Emacs shell in the current directory
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
shell-here.el Update to make finding the root more flexible. Jul 28, 2015


Open a shell buffer in (or relative to) default-directory, e.g. whatever directory the current buffer is in. If you have projectile or find-file-in-project installed, you can also move around relative to the root of the current project.

I use Emacs shell buffers for everything, and shell-here is great for getting where you need to quickly. Projectile / FFIP integration makes it very easy to manage multiple shells and maintain your path / history / scrollback when switching between projects.


Use Marmalade and ELPA / package.el.

Recommended binding: C-c !

(require 'shell-here)
(define-key (current-global-map) "\C-c!" 'shell-here)


C-c !Open a shell in the current directory
C-1 C-c !Open a shell one level up from current
C-2 C-c !Open a shell two levels up from current (etc)
C-u C-c !Open a new shell in the current directory
C-- C-c !Open a shell in the current project root
C-- C-1 C-c !Open a shell one level up from root
C-- C-2 C-c !Open a shell two levels up from root (etc)
C-- C-u C-c !Open a new shell in the project root


There are two things you can configure, both dealing with how shell-here determines the root of the project you’re in.

  1. shell-here-project-root-functions. This variable contains a list of functions to determine the root of the project. The first one that’s bound will be called with no arguments. The first truthy value returned will be the root.
  2. shell-here-project-root-files. If shell-here-project-root-functions is nil or doesn’t produce a truthy value, locate-dominating-file will be called for each entry in this variable, until one returns a truthy value.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

You can’t perform that action at this time.