Text of elpa.gnu.org › devel › termint.html as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

GNU-devel ELPA: termint

termint Description Run REPLs in a terminal backend Latest termint-0.3.0.20261104.0.tar ( .sig ), 2026-Nov-04, 100 KiB Maintainer Milan Glacier <dev@milanglacier.com> Other versions: release version Website https://github.com/milanglacier/termint.el ELPA's Repository CGit or Gitweb To install this package from Emacs, use package-install or list-packages . Full description Run REPLs in a terminal emulator backend termint.el provides a flexible way to define and manage interactions with Read-Eval-Print Loops (REPLs) running inside a terminal emulator backend within Emacs.

It allows you to easily configure how Emacs communicates with different REPLs, leveraging the capabilities of fully-featured terminal emulators like term , vterm , eat , or ghostel . Instead of relying on Emacs's built-in "dumb" terminal ( comint-mode ), termint runs REPLs in a full terminal emulator, enabling features like bracketed paste mode, proper rendering, and potentially advanced interaction for complex terminal applications.

The core of the package is the termint-define macro, which generates a set of functions and keybindings tailored to a specific REPL, making it easy to start sessions, send code snippets, source files, and manage the REPL window. Features Flexible REPL Definition: Define interactions for various REPLs using the termint-define macro. Multiple Backends: Supports term , vterm , eat , and ghostel as terminal emulator backends.

Configure your preferred backend using termint-backend . Customizable Interaction: Control aspects like bracketed paste mode, start/end patterns for sending code (with different behaviour for single vs. multi-line input), and code preprocessing. Code Sourcing: Provides a mechanism ( :source-syntax ) to source code, often by writing to a temporary file and sending a command to source it (helpers included for common languages).

Generated Commands: Automatically creates functions for: Starting/switching to REPL sessions Sending regions/strings Sourcing regions Hiding the REPL window Evil Integration: Automatically defines Evil operators if Evil mode is detected. Dedicated Keymap: Creates a prefix keymap for easy access to the generated commands. Installation termint is available on the ELPA and MELPA package repository. You can install it using your preferred package manager. (package-install 'termint) ;; Alternatively, using straight.el (straight-use-package 'termint) Configuration Choose your preferred terminal backend by customizing the termint-backend variable: ;; Choose one: 'term, 'vterm, 'eat, or 'ghostel (setq termint-backend 'eat) Make sure the corresponding backend package ( vterm , eat , or ghostel ) is installed if you choose it. term is built-in.

We recommend using eat , ghostel , or vterm due to their superior performance compared to the built-in term . Usage The primary way to use termint is by defining REPL configurations in your Emacs init file using the termint-define macro. This approach takes inspiration from the reformatter package, which similarly provides a macro to define distinct formatters. Each formatter is accompanied by its own command, allowing you to apply different configurations across various languages.

This macro defines a schema for interacting with a specific REPL. (termint-define REPL-NAME REPL-CMD &rest ARGS) Helper Functions for Project-Local Binaries termint-find-binary - Search upward for executables in a subdirectory (e.g., .venv/bin/python ). Use this for project-local binaries: (termint-define "ipython" (lambda () (termint-find-binary ".venv/bin" "ipython" "ipython"))) termint-ipython-cmd-function / termint-python-cmd-function - Return the command for IPython/Python, preferring project-local .venv binaries before falling back to system PATH.

Pass these directly as REPL-CMD to termint-define . Generated Components For a (termint-define "myrepl" ...) definition, the macro generates several components prefixed with termint-myrepl- : Functions: A set of interactive functions are created for common REPL interactions: termint-myrepl-start : Start or switch to the REPL session. termint-myrepl-send-string : Send a string (prompted) to the REPL. termint-myrepl-hide-window : Hide the REPL window. _Region Operations:_ termint-myrepl-send-region : Send the selected region to the REPL. termint-myrepl-source-region : Source the selected region in the REPL. _Paragraph Operations:_ termint-myrepl-send-paragraph : Send the current paragraph to the REPL. termint-myrepl-source-paragraph : Source the current paragraph in the REPL. _Buffer Operations:_ termint-myrepl-send-buffer : Send the current buffer to the REPL. termint-myrepl-source-buffer : Source the current buffer in the REPL. _Defun Operations:_ termint-myrepl-send-defun : Send the current defun to the REPL. termint-myrepl-source-defun : Source the current defun in the REPL.

Evil Operators: If Evil mode is loaded, the following operators are defined, mirroring the region operations: termint-myrepl-send-region-operator : Evil operator for sending text objects, motions, or regions. termint-myrepl-source-region-operator : Evil operator for sourcing text objects, motions, or regions. Keymap: termint-myrepl-map : A keymap containing default bindings for the generated functions. You can bind this map to a prefix key for convenient access.

Customizable Variables: Several variables are generated to allow customization of the REPL's behavior: termint-myrepl-cmd : The command used to start the REPL. termint-myrepl-use-bracketed-paste-mode : Whether to use bracketed paste mode. termint-myrepl-start-pattern : Pattern marking the start of code to send (optional). termint-myrepl-end-pattern : Pattern marking the end of code to send (optional). termint-myrepl-str-process-func : Function to preprocess strings before sending. termint-myrepl-source-syntax : Template for the command used to source code. termint-myrepl-show-source-command-hint : When enabled, display the first non-empty line of the code chunk as overlay.

Alongside the source command sent to the REPL, providing a useful hint about the actual command being executed. the default value is nil. termint-myrepl-send-delayed-final-ret : When enabled, send the final return with a slight delay. Some REPLs may not properly recognize when a large chunk of text sent with bracketed paste mode has finished being input and needs to be evaluated. This option should generally remain false (the default), with Claude Code and OpenAI Codex being notable exceptions that require to set to true.

PRs are welcome if other REPLs are found to need this option enabled. Global Customization Options: Configure these before calling termint-define to ensure all schemas inherit the same extensions to avoid per-REPL repetition: termint-region-dispatchers : Register additional region selectors to automatically generate corresponding send/source commands across all schemas. termint-schema-custom-commands : Define universal custom commands that apply to every schema. termint-mode-map-additional-keys : Specify keybindings (key + command suffix) to include in all generated schema keymaps, keeping common shortcuts synchronized.

Examples As termint-define is a macro, it cannot automatically generate autoloads for the derived commands. To address this, we recommend configuring termint using use-package , which provides advanced lazy-loading functionality out of the box. We also recommend declare separate use-package forms for each REPL schema. This structure allows you to activate specific REPL commands as long as their corresponding programming language mode loads.

In the below example, we created two REPL schemas: ipython - loads with Python mode claude-code - lazy-loaded with global keybindings (use-package termint :demand t :after python :bind (:map python-ts-mode-map ("C-c s" . termint-ipython-start)) :config ;; Uses project-local ipython from .venv if available (termint-define "ipython" #'termint-ipython-cmd-function :bracketed-paste-p t :sourc

The rest of this page is on the live site.