How to actually fix Emacs mouse support

1,695 views
Skip to first unread message

David Nolen

unread,
Jul 10, 2011, 5:00:30 PM7/10/11
to iterm2-discuss
I finally figured out how to get the mouse working in Emacs. Perhaps
the FAQ should be updated with this solution?

In your .emacs file add:

(require 'mouse)
(xterm-mouse-mode t)

mwheel.el is not necessary at all.

George Nachman

unread,
Jul 11, 2011, 1:05:24 PM7/11/11
to iterm2-...@googlegroups.com
This kind-of works for me. When I click, the mouse moves (yay), but it
beeps and says:

Symbol's function definition is void: track-mouse

I'm using emacs 22.1.1. Any idea if this can be fixed?

David Nolen

unread,
Jul 11, 2011, 2:18:44 PM7/11/11
to iterm2-discuss
How about?

(require
'mouse)
(xterm-mouse-mode
t)
(defun track-mouse (e))

George Nachman

unread,
Jul 11, 2011, 2:39:52 PM7/11/11
to iterm2-...@googlegroups.com
That works! I'll update the faq.

Kevin Downey

unread,
Jul 11, 2011, 2:42:54 PM7/11/11
to iterm2-...@googlegroups.com
I get control sequences in my buffer like:
[M Çc [M#Çc [M 'a [M#3a

ssh'ed into a vm, running emacs inside of tmux, so maybe ssh is
screwing me out of sweet mouse events?

--
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

David Nolen

unread,
Jul 11, 2011, 3:09:57 PM7/11/11
to iterm2-discuss
So are you saying it works for you normally and just not under ssh? I
installed Emacs 24 on a remote machine, ssh'ed in, and mouse events
worked just fine for me.

David

On Jul 11, 2:42 pm, Kevin Downey <redc...@gmail.com> wrote:
> I get control sequences in my buffer like:
> [M Çc [M#Çc [M 'a [M#3a
>
> ssh'ed into a vm, running emacs inside of tmux, so maybe ssh is
> screwing me out of sweet mouse events?
>
>
>
>
>
> On Mon, Jul 11, 2011 at 11:39 AM, George Nachman <gnach...@llamas.org> wrote:
> > That works! I'll update the faq.
>

George Nachman

unread,
Jul 11, 2011, 3:11:08 PM7/11/11
to iterm2-...@googlegroups.com
Try it without tmux. I wonder if it doesn't handle mouse reporting correctly. I know it tries to translate escape codes into the "screen" terminal.
Reply all
Reply to author
Forward
0 new messages