I have created a package, which I have named dtache. The name originates from dtach and Emacs, where dtach describes itself as “a simple program that emulates the detach feature of screen”.

The package makes it possible to dispatch shell commands which, under the hood, becomes completely detached from the Emacs session. Which means closing Emacs has no effect on the launched shell command. The dtache package implements a user interface which is highly integrated, despite the disconnection that happens underneath.

The package offers multiple ways of dispatching shell commands. We can do so with either:

  • M-x dtache-shell-command
  • The function dtache-start-session
  • In M-x shell with dtache-shell-create-session

The latest addition is dtache-eshell-create-session, which is provided through the dtache-eshell package. This allows the users to create, detach and attach to sessions.

Local session

Here is dtache-eshell when running on localhost.

Remote session

Here is dtache-eshell when running on a remote host.

Here we can see that we can only attach to sessions running on the same host as eshell is currently in.

Dtache interface

With dtache-open-session we can list all sessions independent on host and see all the ones that were just created.

If you are an eshell user, and this functionality seems interesting to you, checkout the README in dtache for more information about how to get started :)