I am running Tmux 2.2 on Arch Linux. I tend to use it from a raw TTY console, rather than an xterm in a window manager. I have GPM installed and running, however I cannot seem to get GPM and Tmux to work together at all.

I've enabled the mouse functions with setw -g mouse on however, none of the operations actually function. Selecting a panel/window doesn't work; and I cannot use the mouse in mouse-enabled applications running in Tmux, such as MidnightCommander. MC works with the mouse outside of Tmux, but not inside.

Is there a way to get GPM and Tmux to get along? Or does tmux rely on X11 to handle the mouse interaction?

Thanks in advance!

  • Have you tried other apps inside tmux besides MC? I had some odd experiences myself with mc/tmux together which were working fine with mc only. – schaiba May 4 '16 at 19:06
  • @schaiba Yeah, vim is the other one I primarily use; mouse actions do not get passed to it either, even when vim is set with mouse=a – Chris May 4 '16 at 19:07
  • afaik tmux doesn't rely on X to handle mouse interactions, that's what gpm is for. – schaiba May 5 '16 at 7:04

Short: no.

Long: it does not work because gpm and tmux make conflicting interpretations about the TERM environment variable.

  • gpm checks if TERM begins with "xterm", and if so does nothing more in Gpm_Open than return a file descriptor. This is done for clients (the gpm server works as designed).
  • the Linux console reportedly provides for an application initializing it and enabling a subset of xterm-style mouse controls. gpm will not do this, because it checks TERM.
  • tmux could (somehow) determine that it is really talking to gpm on Linux console, but that isn't done (too specialized).
  • Not even with some creative environment var manipulation? I presume not... – Chris Sep 14 '16 at 13:40
  • No - reading the code and a quick check with vttest in tmux, what I see is that the application (tmux) would have to fill in the initialization parts that gpm might have done rather than simply returning a file descriptor. – Thomas Dickey Sep 14 '16 at 19:45
  • Wow, I really appreciate you looking so deep into this :) Thanks! – Chris Sep 14 '16 at 20:20
  • no problem (it's related to one of my FAQs) – Thomas Dickey Sep 14 '16 at 20:21

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.