Introducing vtermux

angelixd1 pts0 comments

Introducing vtermux – M.C. PantzThe terminal is still where most developers live. The UNIX philosophy of being able to shuffle data<br>from one application to another is essential when one&rsquo;s job is building things; reusable components<br>are a critical necessity. As such, when developers build tools, even when not thinking about<br>interoperability, the first class audience is the terminal. Now with LLMs making it almost trivial<br>to build decent UIs, terminal user interfaces (TUIs) are popping up to supplement command-line<br>interfaces (CLIs) that came from the first command prompts.<br>If you are an Emacs user, you might have a terminal open on another screen next to your full-screen<br>Emacs instance to handle the various commands you will need to enter, and this is a perfectly valid<br>workflow that many of us use. However, terminal emulation in emacs has gotten pretty good in the<br>past few years; and in particular vterm is amazingly performant. Unless you are doing something<br>that is pushing the boundaries of performance, vterm is able to handle your needs.<br>Unfortunately, the window management for vterm is pretty abysmal. Creating new windows gives you<br>vterm , vterm , vterm , and so on, which isn&rsquo;t very helpful and has an obnoxious<br>cognitive overhead when working with multiple windows. The package multi-vterm helps by<br>associating one vterm instance per project directory, but in order to go beyond that, falling back<br>to vterm numbered buffers is still necessary.<br>I want to run multiple terminal buffers per project, and sometimes even multiple instances of the<br>same program in the same project, and be able to name them semantically. This isn&rsquo;t a huge ask, and<br>multiple packages do various parts of this, but not altogether. So that is why<br>vtermux exists.<br>vtermux allows you to specify any number of programs that you<br>can run individually in the context of a directory. The package exports one macro, vtermux-define,<br>which allows you to specify the programs you want in a straightforward way:<br>(use-package vtermux<br>:ensure<br>(:host github :repo "pcmantz/vtermux")<br>:after vterm<br>:bind ("C-c v" . vtermux-run)<br>:config

;; shells<br>(vtermux-define bash)<br>(vtermux-define zsh)

;; dev tools<br>(vtermux-define pitchfork :args "tui")<br>(vtermux-define claude)<br>(vtermux-define opencode :args "-m")

;; ops tools<br>(vtermux-define btop)<br>(vtermux-define htop))

For claude, this gives you the following commands:<br>CommandDescriptionclaudeLaunch claude.claude-newCreate a new claude instance.claude-nextSwitch to the next claude buffer, skipping OFFSET buffersclaude-prevSwitch to the previous claude buffer, skipping OFFSET buffersclaude-selectSelect a claude buffer with completing-read.For those following at home, this gives you a TUI or CLI interface to any existing program in<br>Emacs in one line.<br>So what can you do with this? Well, during development, I had OpenCode working on fixing bugs while<br>I had Claude do code review. You could even use two instances, as the claude-new command that gets<br>generated takes a label argument, so you would end up with *claude - ~/git/vtermux/* and<br>*claude - ~/git/vtermux/* (review), which makes it easier to manage an ever-increasing amount of<br>tools in one place.<br>Rather than having to run every command manually, there is a built-in launcher vtermux-run which<br>can be bound from the use-package statement as seen above. so with the above configuration, you<br>get the following prompt:<br>vtermux b c h o p t z:<br>Which launches the corresponding program. If you already have a corresponding buffer for the project<br>(or directory, read the docs!), you will be asked for a label and you&rsquo;ll have both your programs<br>running happily together.<br>Please give vtermux a try! I&rsquo;ve been using it happily in my efforts to turn Emacs into an<br>LLM-powered IDE (article forthcoming&mldr;). I suspect this package can put to rest<br>Many thanks to the authors of the packages<br>reformatter,<br>multi-term,<br>multi-vterm, and<br>vterm itself for all the inspiration and time they have<br>saved me by allowing me to cobble together an effective workspace to get things done. I hope this<br>helps others in the same fashion.

M.C. Pantz<br>Something Bloglike

2026-05-24

vtermux claude vterm define terminal rsquo

Related Articles