Skip to content

jackkamm/ob-emamux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

ob-emamux

Org-babel support for tmux via emamux.

  • Send commands to external tmux sessions through org-babel source blocks.
  • Integrated with TRAMP.
  • Doesn’t require forwarding sockets.

Installation

Add ob-emamux.el to your load-path, then load it and add emamux to org-babel-load-languages:

(require 'ob-emamux)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (shell . t)
   (python . t)
   (emamux . t)))

Usage

An ob-emamux source block looks like this:

#+begin_src emamux :session 0:0.0
    echo hello world
#+end_src

The :session parameter is specified as session:window.pane. If not set to a specific value, it will use the default emamux target, or prompt for one if it isn’t set.

Configuring emamux with tmux 2.0+

While this does not directly affect ob-emamux, some emamux functions (e.g. emamux:yank-from-list-buffers) require the following configuration to work with tmux versions 2.0+.

(setq emamux:show-buffers-with-index nil)
(setq emamux:get-buffers-regexp
      "^\\(buffer[0-9]+\\): +\\([0-9]+\\) +\\(bytes\\): +[\"]\\(.*\\)[\"]")

Alternatives

See ob-tmux for an alternative. Summary of the main differences:

  • ob-tmux
    • Launches an external terminal (e.g. xterm) with a new tmux session.
    • Manages its own sessions, and prefixes their tmux session names with org-babel-.
    • Interacting with existing sessions requires a socket file to connect. Remote sessions also require forwarding an SSH tunnel.
  • ob-emamux
    • Aimed at interacting with existing tmux sessions.
    • Handles remote sessions through TRAMP.

About

Org-babel + tmux via emamux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published