Persistent terminals for your projects and general use.
An extension of multi-vterm.el, providing persistent terminal access
through TMux (optionally over SSH using TRAMP).
This package is not yet in any packaging repositories, has not undergone any review except for my own purposes, and should be considered to be in a pre-release state.
Should you still wish to try it:
- Install the dependencies.
- Clone [this] repository
- And either:
(load ...)thevterm-tmux.elfile explicitly.- Or move/symlink
vterm-tmux.elinto your load path and(require 'vterm-tmux).
vtermmulti-vterm
This package provides one command:
vterm-tmuxAttach to a tmux session. The raw prefix argument will indicate that thedefault-directorymust be set before attaching to the session. This operation supports TRAMP paths.vterm-tmux-projectAttach to the current project’s tmux session. (project root is determined by(project-root (project-current)))
This package may be customised through the following variables:
vterm-tmux-default-sessionThe default name for a tmux sessionvterm-tmux-default-hostnameThe default (host)name for local connections (this does not have to be valid on a network, it is only used for the buffer name)vterm-tmux-connection-methodThe tmux command used to connect to the sessionvterm-tmux-envA list of environment variables to explicitly pass to the shellvterm-tmux-buffer-name-formatFunction of HOSTNAME and SESSION to return the string to be used as the buffer name for terminals created by this package.
This command’s default binding is <project-prefix> t, but is not
bound by default. Call vterm-tmux-default-binding to bind it.
Previously, this package would rely on some specific behaviour of
vterm when running over TRAMP. At some point, this behaviour changed,
such that attempting to run vterm-tmux with a remote
default-directory would yield a regular vterm buffer, with no TMux
running. Why? Because of a longstanding bug in TMux, which happened to
be avoided by the older versions of vterm and TRAMP.
This version of vterm-tmux unfortunately has to send the command to
launch TMux to the terminal as if the user had typed it in. As a
result, closing the remote terminal involves sending C-d C-d to
first exit TMux, then exit the actual vterm session. I do not know if
or when this change can be reverted to the desired behaviour of the
vterm session closing with the TMux session.
- Todd Goodall <tgoodall@utexas.edu>, for inspiration in the form of (the seemingly defunct) multi-term-tmux.el.
- The good people at the Emacs IRC channel, for their encouragement.