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.el
file explicitly.- Or move/symlink
vterm-tmux.el
into your load path and(require 'vterm-tmux)
.
vterm
multi-vterm
This package provides one command:
vterm-tmux
Attach to a tmux session. The raw prefix argument will indicate that thedefault-directory
must be set before attaching to the session. This operation supports TRAMP paths.vterm-tmux-project
Attach 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-session
The default name for a tmux sessionvterm-tmux-default-hostname
The 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-method
The tmux command used to connect to the sessionvterm-tmux-env
A list of environment variables to explicitly pass to the shellvterm-tmux-buffer-name-format
Function 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.