Skip to content

Conversation

Copy link

Copilot AI commented Oct 17, 2025

Closes #[issue_number]

Overview

This PR adds support for vterm and eat terminal backends to aider.el, allowing users to choose their preferred terminal emulator for running aider sessions. Previously, aider.el only supported comint-mode. Now users can select from three options based on their preferences and requirements.

Motivation

As requested in the issue, many users prefer vterm or eat over comint for their terminal needs due to better terminal emulation, performance, or personal workflow preferences. This implementation provides that flexibility while maintaining full backward compatibility.

Changes

New Customization Variable

Added aider-terminal-backend with three options:

  • 'comint - Built-in Emacs comint-mode (default, no extra dependencies)
  • 'vterm - Requires emacs-libvterm
  • 'eat - Requires emacs-eat

Backend Abstraction Layer

Created a clean protocol-based abstraction with the following functions:

  • aider--backend-available-p - Check if backend is available
  • aider--backend-require - Lazy load backend with error handling
  • aider--backend-create-buffer - Create terminal buffer
  • aider--backend-send-input - Send commands to terminal
  • aider--backend-check-proc - Check process status
  • aider--backend-setup-buffer - Configure buffer keybindings

Added aider--in-aider-buffer-p helper for backend-agnostic buffer detection.

Updated Core Functions

  • Modified aider--send-command to dispatch via backend abstraction
  • Updated aider--create-aider-buffer for multi-backend support
  • Enhanced aider-clear-buffer to work with all backends
  • Fixed buffer checks in aider-file.el and aider-highlight-changes.el

Documentation

Updated both English and Chinese README files with:

  • Configuration examples showing how to set the backend
  • FAQ entries explaining backend options and requirements
  • Clear documentation of dependencies for each backend

Usage Example

(use-package aider
  :config
  ;; Choose your preferred terminal backend
  (setq aider-terminal-backend 'vterm)  ; or 'eat, or 'comint (default)
  
  (setq aider-args '("--model" "sonnet" "--no-auto-accept-architect"))
  (setenv "ANTHROPIC_API_KEY" anthropic-api-key)
  (global-set-key (kbd "C-c a") 'aider-transient-menu))

Backward Compatibility

This change is fully backward compatible:

  • Default backend remains comint (no configuration change needed)
  • All existing functionality preserved
  • Optional backends only loaded when explicitly configured
  • Clear error messages if configured backend is unavailable

Testing

Manual testing is recommended:

  • Test with default comint backend (should work exactly as before)
  • Test with vterm backend (requires emacs-libvterm installation)
  • Test with eat backend (requires emacs-eat installation)
  • Verify all aider commands work correctly with each backend
  • Test buffer clearing, process checking, and command sending

Implementation Notes

  • Used pcase for clean backend dispatch
  • Lazy loading prevents loading unused backends
  • Each backend uses its native functions (vterm uses vterm-send-string, eat uses process-send-string)
  • Proper declare-function declarations to avoid byte-compilation warnings
Original prompt

This section details on the original issue you should resolve

<issue_title>vterm/eat support?</issue_title>
<issue_description>Hello,

How about being able to set some variable so it uses vterm (https://github.com/akermu/emacs-libvterm) or eat (https://codeberg.org/akib/emacs-eat) ?

This should be relatively straightforward to implement.</issue_description>

Comments on the Issue (you are @copilot in this section)

@tninja Hi @Silex , Thanks for using aider.el. Yes it currently only support comint based terminal. But we are open to add other backend support.

If you like feature of this package, prefer to use vterm / eat, and don't mind to switch to Claude Code / Gemini CLI / OpenAI Codex / Github Copilot CLI, (actually these alternative tool are pretty good, support MCP), please take a look at ai-code-interface.el, most of aider.el feature got migrated there, and I use it more.</comment_new>

Fixes #234


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add support for vterm and eat terminals Add vterm and eat terminal backend support Oct 17, 2025
Copilot AI requested a review from tninja October 17, 2025 16:28
Copilot finished work on behalf of tninja October 17, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vterm/eat support?

2 participants