How can mouse support be enabled in an Emacs terminal session started with emacs -nw? Is there a keyboard shortcut or a flag to do this? If not how can it be done in terminal emulators? I use Guake.

  • 1
    Are you running emacs in a GUI terminal emulator? What kind of support do you need? Placing the cursor? Copy/pasting?
    – terdon
    Jan 3, 2016 at 11:52
  • 1
  • 1
    @terdon I am using guake.
    – user
    Jan 3, 2016 at 11:56
  • OK, please edit your question and add that information. Also explain exactly what type of mouse support you need.
    – terdon
    Jan 3, 2016 at 11:57
  • 2
    @user Type ALT-X, then xterm-mouse-mode, then return. Jan 3, 2016 at 12:03

2 Answers 2


Hit F10 to open the menu and use the arrow keys to navigate to “Options” → “Customize Emacs” → “All Settings Matching…”. Type mouse and Enter.

If your Emacs version doesn't have a menu when running in a terminal then run M-x customize. (This means: press Alt+X, type customize and press Enter.) Navigate to the search box, type mouse and press Enter.

Mouse support is called “Xterm Mouse mode”. You can find that in the manual. The manual also gives a way to turn it on (for the current session) — M-x xterm-mouse-mode.

In the Customize interface, on the setting you want to change, press Enter on “Show Value”. A “Toggle” button appears, press Enter on it. Then press Enter on the “State” box and choose either 0 for “Set for Current Session” or “1” for “Save for Future Sessions”. (You can choose 0 for now and come back there and choose 1 later if you're happy with the setting.)


add (xterm-mouse-mode 1) to your init.el file

  • 1
    Lol I read the whole accepted answer when I could have just done this. Thanks. Apr 1, 2021 at 0:35
  • For any other emacs noobs who are wondering, that's ~/.emacs.d/init.el. Apr 1, 2021 at 0:36

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.