0

KiTTY (the Windows-based PuTTY clone, not the other terminal emulator) has an option that underscores URLs in terminal output and, when Ctrl+LeftClick'd, opens them in the host browser.

This works outside of tmux. It also works inside of a tmux session with set-option -g mouse off. It doesn't work with set-option -g mouse on, which makes me think that what's happening is tmux intercepting the Ctrl+LeftClick.

I tried unbinding left-click on pane in tmux.conf, but that didn't help:

unbind MouseDown1Pane
unbind C-MouseDown1Pane
unbind M-MouseDown1Pane

Is there a way to stop tmux from intercepting just the Ctrl+LeftClick while preserving the rest of its mouse functionality?

2

No. There is no way for tmux to tell the outside terminal it only wants some mouse events, it is all or nothing.

You can configure what tmux does for different mouse events by changing the key bindings, but there is no way to have the outside terminal handle them instead without turning off the mouse in tmux entirely.

However, most terminals provide a way to bypass the application - in xterm you press Shift when using the mouse, perhaps Kitty has a way too.

| improve this answer | |
  • It is configurable in PuTTY. KiTTY does not appear to have a single user manual like that. It might be configurable in KiTTY. – JdeBP Mar 3 at 19:22
  • Shift-LeftClick does bypass tmux for text selection + copying; Ctrl-Shift-LeftClick, apparently, doesn't. Luckily, there's a Kitty setting that allows plain LeftClick on hyperlink to launch it, which means Shift-LeftClick works. – Simon Podhajsky Mar 3 at 23:00

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.