Hacker News new | ask | show | jobs
by pama 29 days ago
Congrats on the launch. If emacs was unavailable and I needed tmux, I would try it. I am old school, and use emacs daemons for all shell multiplexing. The agents dont need explanations and know how to use emacsclient to create, read, or send inputs to named buffers that run the shells. Elisp is powerful, so manipulating windows is a breeze. Lots of people on tmux would benefit from this design though.
3 comments

Funny, I started vibing this (https://github.com/deangiberson/emacs-mux) yesterday on the train after playing with cmux for the day and thinking to myself there was nothing that emacs couldn't accomplish.

The repo doesn't quite work yet. Many sharp corners. But the basic idea is there.

pama, I'd be interested in hearing more about how you are using emacs for multiplexing. I'm trying to build up tooling for myself based around file and input workflows and I /really/ don't want to write a text editor and would prefer to stick with emacs.

The key idea is to have many differently named shells. Typically, I group them by project (common prefix name), and the projects live in directories. I have some hacks to organize ibuffer, to split frames, to reflow buffers in the existing windows (eg to organize related project buffers (shells, magit, dired), or to show shells from multiple projects, or selected buffers, and so on). Emacs’ natural frame splitting and buffer selecting/switching commands are good enough if you dont display more than four buffers at a time, but soon you may need to show 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24 or have funky arrangements, so you may collect functions to help along splitting n*m grids or keeping useful splits. The shells work very organically inside Emacs and you can still use it as a text editor. The so-called “dumb terminal” in M-x shell is a thing of beauty as it really is just a text buffer like any other; I think of it as a bash repl. If you are used to curses TUI commands it may not work, so for these rare occasions I also use eat (but tend to avoid). See also answer to a sibling comment.
Are there any guides on accomplishing this with Emacs? Perhaps something that might be useful for someone coming from Tmux?
Not sure, tbh. I use emacs -daemon to start a server; emacsclient -nw to connect. I use ssh and start a server on the remote. I spawn multiple shells with infinte buffer size and dumb terminals (M-x shell) so I can seamlessly edit. (These are based on comint, a neat command interpreter.) I use my own hacks for named shells (https://github.com/pjj/Emacs-nsh) and for rearranging/splitting windows, but any of the latest powerful LLMs can help with ergonomic modifications to M-x shell or the various improved terminal emulators (vterm, eat, ansi-term) or with renaming and moving/splitting windows. The Emacs manual is excellent but long; worth it IMHO, but focus on things you use. The tutorial is quick; worth it. I avoid curses programs (fancy TUI) or write wrappers around some of them. I love the -p option in codex/claude/copilot.
I didn't know you could do this with Emacs
It's just too bad Emacs doesn't also include a decent text editor, right?
Eh? Not sure what you mean by that...
An ancient joke:

"Emacs is a nice programming language but the editor sucks"