Mouse support for WeeChat – Catch mouse events in WeeChat


This page will explain something about Mouse support in WeeChat.

Mouse support is possible through a series of scripts: buffers, coords, urlopener_remote and menu.

There is mouse support in core in the latest WeeChat development versions now. However, it still remains inferior to my mouse scripts (no text, URL, clipboard support). Until those features make their way into core, I will keep this page.

The script supports the mouse to switch and sort buffers. Get it from the official site. – regain URL clicking and select / copy support

native URL recognition

(Read the instruction manual.)

Note: this script, as well as some of the following ones, requires the library to be installed into your WeeChat perl directory.

The library contains some functions to process mouse input more easily.

(Developer note. read the reference manual.)

As select and copy is impaired when the mouse mode is enabled, it is necessary for applications to natively support selection and copy when tracking mouse events.

With loaded, you can directly use your mouse to select text in the chat window. This has the added benefit of working with vertical splits and nicklist properly. (screenshot)

Another nifty feature is that URLs in chat can be detected and directly clicked on. Again, this will work despite line breaks, so especially well for long URLs.

Note: the following functions require WeeChat version 0.4.0+ or a WeeChat development version: interactive highlighting. double-click support for word wise selection. – companion to react to URL clicks

By default, when in xterm, the script will only copy the URL you clicked on into the selection. That will allow you to open it in Firefox or your favourite browser by a simple middle click.

If you need more convenience, the script might be for you. Whenever you click on an URL, it will execute a specific action such as opening your web browser (or text mode web browser in tmux and screen).

(Note. you can easily modify the source code to call the web browser program you want, in tmux and screen it is "w3m" by default.) – companion to react to URL clicks and do remote things

(Read the instruction manual.)

If you are running WeeChat on a remote host and want the web browser to open locally, you should check out this remote alternative to Make sure to read the instruction manual if you want to use it.

nick popup

(Read the instruction manual.)

What good is the mouse for with no menu to click on? will add a menu system to WeeChat that you can configure yourself to run whatever command you like. By default, you can split and close windows with a mouse click.

If you click on the nicklist, the nick popup will open with useful operations to be done on a nick.

With loaded as well, you can also click on a nickname on the left side to do the same.

The nick popup contains the usual entries to Query, Whois, Kick and Op a user. A Slap entry can be added easily.

With loaded, you can right-click on buffers in the buffer list to open a buffer context menu.