Disable middle-click paste in Terminal

Is it possible to disable the middle-click paste feature of macOS Terminal? I have a Keyboard Maestro macro assigned to the middle mouse (wheel) button, but it won't work in Terminal because of this issue.


What's really bizarre is that it's pasting things that have never been on my clipboard—sometimes including a newline character, which could potentially have devastating consequences.

MacBook Pro (2020 and later)

Posted on May 19, 2022 10:51 AM

Reply
Question marked as Top-ranking reply

Posted on May 22, 2022 11:22 AM

It's not possible to disable Logitech's default Middle Click behavior, but I solved the problem by creating a weird keyboard macro in G HUB (Cmd-Shift-F9), assigning that to the middle mouse button, and taking over that new keyboard shortcut within Keyboard Maestro for my triple-click, copy, trim macro.

6 replies
Question marked as Top-ranking reply

May 22, 2022 11:22 AM in response to mph206

It's not possible to disable Logitech's default Middle Click behavior, but I solved the problem by creating a weird keyboard macro in G HUB (Cmd-Shift-F9), assigning that to the middle mouse button, and taking over that new keyboard shortcut within Keyboard Maestro for my triple-click, copy, trim macro.

May 19, 2022 1:13 PM in response to mph206

macOS does not define any middle-click feature in its apps, such as Terminal. Mostly because Apple does not make 3 button mice. At most Apple has Right and left Click, plus holding modifier keys when clicking.


While not a complete list, there are the macOS Terminal copy and paste options, none of which are click based.


    • Command-C macOS Copy to the clipboard.
    • Command-V macOS Paste.
    • Command-Shift-V will paste the Terminal selected text WITHOUT needing to Command-C copy first. This will not change the clipboard.
    • Command-Option-Right-Click will paste the Terminal selected text WITHOUT needing to Command-C copy first (same as Command-Shift-V)


So I would look at Keyboard Maestro for excluding your middle click from working in Terminal, or I would see if you an find what Terminal commands do what you have defined as Middle-Click and then see about mapping that into your Keyboard Maestro command when Terminal has window focus.


NOTE: Middle-Click paste feature does exist in other operating systems, such as Unix/Linux GUI interfaces. Not sure about Windows, as I rarely interact with a Windows system. And I do know that there are 3rd party mice with a middle click, but what that maps to is generally dependent on the mouse vendor and any 3rd party mouse control software you install.

May 20, 2022 3:54 PM in response to mph206

With respect to Barney-15E's comment.


I've liked Logitech mice, but I have not liked their software.


I owned a nice Logitech 9-button mouse, but I used separate 3-party mouse drivers for it. And to day if I was still using a Logitech mouse, I would be using BetterTouchTool to configure the button.


I stopped using any mice when I got my first Apple Magic Trackpad in 2010. It took less than a week of owning the Magic Trackpad to put my Logitech mouse (and every other mouse) on the side of my desk where the "Dust Bunnies" collect.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Disable middle-click paste in Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.