2

I quite like tmux and Aquamacs. I've recently been interested in how to integrate the two together. As far as I know, one cannot run Aquamacs within a terminal even with the Aquamacs CLI tool, so the next natural option is to run tmux in Aquamacs via something like Emacs' shell mode. Unfortunately, I've been running into some bottlenecks in doing this. Namely, running tmux from shell mode throws an error:

$ tmux attach -t 0 # same thing happens by just running `$ tmux`
tmux attach -t 0
open terminal failed: terminal does not support clear

I've been searching for Aquamacs / tmux integration, but haven't found much. It seems like most folks are content to just use Emacs in the shell within tmux, but unfortunately this isn't an option for Aquamacs as stated above.

EDIT:

It seems that the error stated below in the comments (open terminal failed: can't find terminfo database) also happens in vanilla Emacs, even on Linux.

  • 1
    shell is a "limited" terminal (limited to replace some of the terminal functionality with Emacs-style functionality). I believe that if you try M-x term with tmux, that'll work. – wvxvw Feb 6 '16 at 9:20
  • @wvxvw Interesting, I didn't know about term. However, I'm getting another error upon running tmux: open terminal failed: can't find terminfo database. Btw, I'm using zsh if that makes any difference. I've also tried setting the $TERM variable to screen-256color and xterm-color, but that seems to have no effect. – GDP2 Feb 6 '16 at 16:18
  • It works here with Bash, but I'm not a pro / don't really know what terminfo database even is. So, sorry :( – wvxvw Feb 6 '16 at 18:33
  • @wvxvw Np, thanks for the suggestion anyway. – GDP2 Feb 6 '16 at 18:39
  • @GDP2 - Does Auqamacs use the new package manager? If so multi-term package is reasonable alternative to tmux. Once multi-term is installed, you can call with M-x multi-term. Does that help? – Melioratus Mar 3 '16 at 17:22
0

So, I solved this particular issue in both vanilla Emacs and Aquamacs by running TERM=screen-256color before running tmux. Apparently $TERM was set to eterm-color, thus causing the problem with tmux. A caveat for tmux in *macs, though: I did notice that sometimes I could see tmux rendering things slowly because I could see the point cascading across the screen after some commands, which was mildly annoying.

Additionally, I've tried out Melioratus's suggestion for using the multi-term package and have found that it works pretty well. Granted, it needs some configuration to work well with multiple windows (i.e., panes within a frame), but I've found that winner-mode and windmove might mitigate this.

Also, I found a blog post here which might help start off with multi-term (but haven't read too much of it yet): http://rawsyntax.com/blog/learn-emacs-zsh-and-multi-term/. Personally, I'm not leaving tmux for multi-term for the time being, but I think that I'll be using both and leveraging the ability to use the terminal in *macs to see what good can come of it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.