gpm: And you thought you were mouseless

No, living at the terminal does not mean you are rodentless (and I don’t mean gopher). In fact, there is very strong mouse support for you, and your text-only lifestyle.


If you actually sat through that whole gif, I applaud you. If you could make out what was happening, then doubly so.

Basically, gpm is a mouse daemon for consoles. Perhaps you know about it; it’s no big secret. Not like gnuit was. 😕

You’ve got both left- and right-button functions, middle button and/or mousewheel — depending of course on the application. Highlighting is (mostly) done by holding down the shift key. You can see most of the practical use there, with elinks.

But I’m guessing you know most of the basics of a mouse. 🙄

The home page suggests it’s wired for the console and for xterm, but I don’t use xterm so I’m not sure what the special benefit there is.

And take a look at the man page if you get a chance. It strikes me as odd that the default behavior for a triple-click is a system shutdown. 😯

Aside from elinks, vim I think, Midnight Commander and maybe a few others, I’m not sure how much practical gpm support is out there. If you know of something, please share.

P.S., depending on your system, you might have to manually start the gpm daemon. In Debian I think that’s taken care of for you, when you install gpm. In Arch, you’ll need sudo systemctl start gpm. Enjoy.

2 thoughts on “gpm: And you thought you were mouseless

  1. thisnameisfalse


    please, reread gpm(8) manpage.

    Triple-click is NOT triple-click X-D. gpm implements a type of gestures (“special commands” in manpage) invoked by a very uncommon mouse button combination: pressing one of the buttons and triple-click the other one; then releases all the buttons and presses one of them again within three seconds, then the special command corresponding to the button is executed. The idea is to have a emergency procedure to issue a clean shutdown when the keyboard is locked.

    You normally won’t use gpm in X11, because X protocol has its own way to manage mouse. I think in some old X11 version you can use gpm as mouse protocol, but it only gives you very basic support, not the same that gpm full support in console.

    vim has also gpm support: you can use copy&paste from the mouse; you can also browse the vim help, clicking in the different keywords, similar to an hypertextual document

    1. K.Mandla Post author

      You’re right; I knew that and I had meant to edit out the triple-click part. Real life distracted me. Thanks for clearing that up. Cheers! 🙂

Comments are closed.